Add symbol widget

issue9059
review276871002
This commit is contained in:
Cédric Krier committed 2020-10-09 19:09:05 +02:00
1 parent d2aa208132
commit 1236ed3388
6 files changed
+17 -13

No files matched your search

+7
View File
@@ -474,6 +474,8 @@ class PurchaseRequisitionLine(sequence_ordered(), ModelSQL, ModelView):
fields.Integer('Unit Digits'), 'on_change_with_unit_digits')
unit_price = fields.Numeric(
'Unit Price', digits=price_digits, states=_states, depends=_depends)
currency = fields.Function(fields.Many2One('currency.currency',
'Currency'), 'on_change_with_currency')
amount = fields.Function(
fields.Numeric('Amount',
digits=(
@@ -507,6 +509,11 @@ class PurchaseRequisitionLine(sequence_ordered(), ModelSQL, ModelView):
if self.product:
return self.product.default_uom_category.id
@fields.depends('requisition', '_parent_requisition.currency')
def on_change_with_currency(self, name=None):
if self.requisition:
return self.requisition.currency.id
@classmethod
def get_purchase_requisition_states(cls):
pool = Pool()
+1 -1
View File
@@ -22,7 +22,7 @@ this repository contains the full copyright notices and license terms. -->
<label id="empty" colspan="2"/>
<group col="2" colspan="2" id="amount" yfill="1">
<label name="total_amount" xalign="1.0" xexpand="1"/>
<field name="total_amount" xalign="1.0" xexpand="0"/>
<field name="total_amount" xalign="1.0" xexpand="0" symbol="currency"/>
</group>
</page>
<page string="Other Info" id="other_info">
+2 -2
View File
@@ -17,9 +17,9 @@ this repository contains the full copyright notices and license terms. -->
<label name="unit"/>
<field name="unit"/>
<label name="unit_price"/>
<field name="unit_price"/>
<field name="unit_price" symbol="currency"/>
<label name="amount"/>
<field name="amount"/>
<field name="amount" symbol="currency"/>
<separator name="description" colspan="4"/>
<field name="description" colspan="4"/>
</page>
+3 -4
View File
@@ -5,8 +5,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="requisition" expand="1"/>
<field name="product" expand="1"/>
<field name="supplier" expand="1"/>
<field name="quantity"/>
<field name="unit"/>
<field name="unit_price"/>
<field name="amount"/>
<field name="quantity" symbol="unit"/>
<field name="unit_price" symbol="currency"/>
<field name="amount" symbol="currency"/>
</tree>
@@ -5,8 +5,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="requisition" expand="1"/>
<field name="product" expand="1"/>
<field name="supplier" expand="1"/>
<field name="quantity"/>
<field name="unit"/>
<field name="unit_price"/>
<field name="amount"/>
<field name="quantity" symbol="unit"/>
<field name="unit_price" symbol="currency"/>
<field name="amount" symbol="currency"/>
</tree>
+1 -2
View File
@@ -6,7 +6,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="supply_date"/>
<field name="employee" expand="2"/>
<field name="warehouse" expand="1"/>
<field name="total_amount"/>
<field name="currency"/>
<field name="total_amount" symbol="currency"/>
<field name="state"/>
</tree>