diff --git a/purchase.py b/purchase.py
index 03c1bb9d79..060a4e290e 100644
--- a/purchase.py
+++ b/purchase.py
@@ -15,6 +15,8 @@ from trytond.tools import sortable_values
from trytond.transaction import Transaction
from trytond.wizard import Wizard, StateView, StateTransition, Button
+from trytond.modules.currency.fields import Monetary
+
from .exceptions import PreviousQuotation
@@ -289,14 +291,13 @@ class QuotationLine(ModelSQL, ModelView):
product_uom_category = fields.Function(
fields.Many2One('product.uom.category', 'Product Uom Category'),
'on_change_with_product_uom_category')
- unit_price = fields.Numeric('Unit Price', digits=price_digits)
+ unit_price = Monetary(
+ "Unit Price", currency='currency', digits=price_digits)
currency = fields.Many2One('currency.currency', 'Currency',
states={
'required': Bool(Eval('unit_price')),
},
depends=['unit_price'])
- currency_digits = fields.Function(
- fields.Integer('Currency Digits'), 'on_change_with_currency_digits')
request = fields.Many2One('purchase.request', 'Request',
ondelete='CASCADE', select=True, required=True,
domain=[
@@ -364,12 +365,6 @@ class QuotationLine(ModelSQL, ModelView):
if self.product:
return self.product.default_uom_category.id
- @fields.depends('currency')
- def on_change_with_currency_digits(self, name=None):
- if self.currency:
- return self.currency.digits
- return None
-
@classmethod
def get_quotation_state(cls):
pool = Pool()
diff --git a/view/purchase_request_quotation_line_form.xml b/view/purchase_request_quotation_line_form.xml
index 2b51731487..c800a0ed7c 100644
--- a/view/purchase_request_quotation_line_form.xml
+++ b/view/purchase_request_quotation_line_form.xml
@@ -16,7 +16,7 @@ this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/view/purchase_request_quotation_line_list.xml b/view/purchase_request_quotation_line_list.xml
index 295f510e5d..ca09dec691 100644
--- a/view/purchase_request_quotation_line_list.xml
+++ b/view/purchase_request_quotation_line_list.xml
@@ -7,5 +7,5 @@ this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/view/purchase_request_quotation_line_list_request.xml b/view/purchase_request_quotation_line_list_request.xml
index 72aa8e5742..96fbeae5f4 100644
--- a/view/purchase_request_quotation_line_list_request.xml
+++ b/view/purchase_request_quotation_line_list_request.xml
@@ -6,6 +6,6 @@ this repository contains the full copyright notices and license terms. -->
-
+