[IMP] nfu_ecommerce: add credit to portal details (#38)

Co-authored-by: Niels Göttsch <ng@ife.de>
This commit is contained in:
madmooose 2025-07-29 21:47:13 +02:00 committed by GitHub
parent fee5016550
commit ce23273f75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 2 deletions

View file

@ -52,6 +52,7 @@ Changelog
:1.3.1: Remove Max Qty from first page :1.3.1: Remove Max Qty from first page
:1.3.2: Add decimal to ribbon :1.3.2: Add decimal to ribbon
:1.4.0: Add credit warning and avoid debts option :1.4.0: Add credit warning and avoid debts option
:1.4.0: Add credit to portal details
Bug Tracker Bug Tracker
=========== ===========

View file

@ -4,13 +4,14 @@
"author": "BAKEUP", "author": "BAKEUP",
"website": "https://www.bakeup.org", "website": "https://www.bakeup.org",
"category": "website", "category": "website",
"version": "16.0.1.4.0", "version": "16.0.1.4.1",
"depends": [ "depends": [
"sale_product_configurator", "sale_product_configurator",
"website_sale", "website_sale",
"nfu_sale_order_batch_packaging", "nfu_sale_order_batch_packaging",
"website_decimal_quantity", "website_decimal_quantity",
"nfu_product_bnn_attributes", "nfu_product_bnn_attributes",
"nfu_account",
], ],
"data": [ "data": [
"views/res_config_settings_views.xml", "views/res_config_settings_views.xml",
@ -20,6 +21,7 @@
"assets": { "assets": {
"web.assets_frontend": [ "web.assets_frontend": [
"nfu_ecommerce/static/src/js/*.js", "nfu_ecommerce/static/src/js/*.js",
"nfu_ecommerce/static/src/scss/portal.scss",
] ]
}, },
"license": "LGPL-3", "license": "LGPL-3",

View file

@ -7,4 +7,5 @@
:1.3.0: Adapt new Open Packages format and add indicators :1.3.0: Adapt new Open Packages format and add indicators
:1.3.1: Remove Max Qty from first page :1.3.1: Remove Max Qty from first page
:1.3.2: Add decimal to ribbon :1.3.2: Add decimal to ribbon
:1.4.0: Add credit warning and avoid debts option :1.4.0: Add credit warning and avoid debts option
:1.4.0: Add credit to portal details

View file

@ -421,6 +421,8 @@ adjustes the uom quantitiy</li>
</tr> </tr>
<tr class="field"><th class="field-name">1.4.0:</th><td class="field-body">Add credit warning and avoid debts option</td> <tr class="field"><th class="field-name">1.4.0:</th><td class="field-body">Add credit warning and avoid debts option</td>
</tr> </tr>
<tr class="field"><th class="field-name">1.4.0:</th><td class="field-body">Add credit to portal details</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -0,0 +1,16 @@
.o_portal_wrap {
.o_portal_my_details_credit {
position: relative;
.fa {
@include o-position-absolute(0, $left: 0);
line-height: $line-height-base;
+ span,
+ div {
display: block;
// FontAwesome '.fa-fw' fixed-with + margin
padding-left: 1.28571429em + 0.5em;
}
}
}
}

View file

@ -285,4 +285,18 @@
</tr> </tr>
</xpath> </xpath>
</template> </template>
<template id="portal_layout_inherit" name="Portal Layout" inherit_id="portal.portal_layout">
<xpath expr="//div[hasclass('o_portal_my_details')]" position="inside">
<div class="o_portal_my_details_credit">
<i class="fa fa-credit-card fa-fw" role="img" aria-label="credit" title="Credit">
</i>
<span
itemprop="credit"
t-field="user_id.partner_id.nfu_credit"
t-att-class="'monetary_field' + (' text-danger' if user_id.partner_id.nfu_credit &lt; website.credit_warning_level else '')"
t-options='{"widget": "monetary" , "display_currency": website.currency_id}'
/>
</div>
</xpath>
</template>
</odoo> </odoo>