Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3158 Widoki

Hello, 

For a customer I changed the digital precision from the Product Price to 4 digits. This works perfect on the product-form and on the sale order. The only problem is that the price-extra field from the product_template_attribute_line does not alters its precision. This field keeps its 2 digits. I checked the code of the field and it looks correct:

price_extra = fields.Float(string="Value Price Extra",
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.")
The 'digits' parameter is set to "Product Price", so this should do the job, but apparently it doesn't for some reason. 

Anyone had this problem or knows the solution? 

Thank you in advance for your help!

Awatar
Odrzuć
Autor Najlepsza odpowiedź

I found what causes this. The secret is in the view-xml. If you want to display the digits correctly you need to add the attribute:

options="{'currency_field': 'currency_id', 'field_digits': True}

to the field tag.

Then the field displays with the correct number of digits.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sie 24
1297
1
lip 22
3226
1
sie 21
3685
0
lip 21
3313
2
maj 25
3850