summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-03-19 09:50:28 +0000
committerVictor Feyens <vfe@odoo.com>2020-03-26 10:27:57 +0000
commitf93965130cadc3b97f8154093074779dc470ec83 (patch)
tree52a09ee52232f2cbf7169d2d0761205976c86a78
parent75069b4edc8a7671cda2af71b19ea38412a732b5 (diff)
[IMP] product: show the attribute extra price with product currency.
-rw-r--r--addons/product/models/product_attribute.py2
-rw-r--r--addons/product/views/product_attribute_views.xml6
2 files changed, 6 insertions, 2 deletions
diff --git a/addons/product/models/product_attribute.py b/addons/product/models/product_attribute.py
index 07202a64993..d4209bdb177 100644
--- a/addons/product/models/product_attribute.py
+++ b/addons/product/models/product_attribute.py
@@ -394,6 +394,8 @@ class ProductTemplateAttributeValue(models.Model):
default=0.0,
digits='Product Price',
help="Extra price for the variant with this attribute value on sale price. eg. 200 price extra, 1000 + 200 = 1200.")
+ currency_id = fields.Many2one(related='attribute_line_id.product_tmpl_id.currency_id')
+
exclude_for = fields.One2many(
'product.template.attribute.exclusion',
'product_template_attribute_value_id',
diff --git a/addons/product/views/product_attribute_views.xml b/addons/product/views/product_attribute_views.xml
index 16bb8c82422..63ad0debf6c 100644
--- a/addons/product/views/product_attribute_views.xml
+++ b/addons/product/views/product_attribute_views.xml
@@ -85,7 +85,8 @@
<field name="attribute_id"/>
<field name="name"/>
<field name="ptav_active" optional="hide"/>
- <field name="price_extra"/>
+ <field name="price_extra" widget="monetary"/>
+ <field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
@@ -100,7 +101,8 @@
<group>
<field name="ptav_active" readonly="1" attrs="{'invisible': [('ptav_active', '=', True)]}"/>
<field name="name"/>
- <field name="price_extra" />
+ <field name="price_extra" widget="monetary"/>
+ <field name="currency_id" invisible="1"/>
<field name="exclude_for" widget="one2many" mode="tree">
<tree editable="bottom">
<field name="product_tmpl_id" />