Add symbol widget

issue9059
review276871002
This commit is contained in:
Cédric Krier
2020-10-09 19:09:05 +02:00
parent b712a343ab
commit 8ce8293e05
15 changed files with 43 additions and 43 deletions
+7
View File
@@ -2310,6 +2310,8 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView):
digits=(16, Eval('_parent_invoice', {}).get('currency_digits', 2)),
states=_states,
depends=['tax', 'base', 'manual'] + _depends)
currency = fields.Function(fields.Many2One('currency.currency',
'Currency'), 'on_change_with_currency')
manual = fields.Boolean('Manual', states=_states, depends=_depends)
tax = fields.Many2One('account.tax', 'Tax',
ondelete='RESTRICT',
@@ -2364,6 +2366,11 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView):
if self.invoice:
return self.invoice.state
@fields.depends('invoice', '_parent_invoice.currency')
def on_change_with_currency(self, name=None):
if self.invoice:
return self.invoice.currency.id
@fields.depends('tax', 'invoice', '_parent_invoice.party', 'base')
def on_change_tax(self):
Tax = Pool().get('account.tax')
+4 -1
View File
@@ -394,7 +394,9 @@ class TestPaymentTermView(ModelView):
for date, amount in self.payment_term.compute(
self.amount, self.currency, self.date):
result.append(Result(
date=date, amount=amount,
date=date,
amount=amount,
currency=self.currency,
currency_digits=self.currency.digits))
self.result = result
return self._changed_values.get('result', [])
@@ -406,4 +408,5 @@ class TestPaymentTermViewResult(ModelView):
date = fields.Date('Date', readonly=True)
amount = fields.Numeric('Amount', readonly=True,
digits=(16, Eval('currency_digits', 2)), depends=['currency_digits'])
currency = fields.Many2One('currency.currency', "Currency")
currency_digits = fields.Integer('Currency Digits')
+5 -5
View File
@@ -40,11 +40,11 @@ this repository contains the full copyright notices and license terms. -->
</group>
<group col="2" colspan="2" id="amount" yfill="1">
<label name="untaxed_amount" xalign="1.0" xexpand="1"/>
<field name="untaxed_amount" xalign="1.0" xexpand="0"/>
<field name="untaxed_amount" xalign="1.0" xexpand="0" symbol="currency"/>
<label name="tax_amount" xalign="1.0" xexpand="1"/>
<field name="tax_amount" xalign="1.0" xexpand="0"/>
<field name="tax_amount" xalign="1.0" xexpand="0" symbol="currency"/>
<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>
</group>
</group>
@@ -67,9 +67,9 @@ this repository contains the full copyright notices and license terms. -->
</page>
<page string="Payment" id="payment">
<label name="amount_to_pay_today"/>
<field name="amount_to_pay_today"/>
<field name="amount_to_pay_today" symbol="currency"/>
<label name="amount_to_pay"/>
<field name="amount_to_pay"/>
<field name="amount_to_pay" symbol="currency"/>
<field name="lines_to_pay" colspan="4" view_ids="account_invoice.move_line_view_list_to_pay"/>
<field name="payment_lines" colspan="4"
view_ids="account_invoice.move_line_view_list_payment"/>
+2 -2
View File
@@ -19,9 +19,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"/>
<field name="taxes" colspan="4"/>
<label name="taxes_date"/>
<field name="taxes_date"/>
+3 -4
View File
@@ -6,9 +6,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="type"/>
<field name="product" expand="1"/>
<field name="account" expand="1"/>
<field name="quantity"/>
<field name="unit"/>
<field name="unit_price"/>
<field name="quantity" symbol="unit"/>
<field name="unit_price" symbol="currency"/>
<field name="taxes"/>
<field name="amount"/>
<field name="amount" symbol="currency"/>
</tree>
+3 -4
View File
@@ -6,9 +6,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="type"/>
<field name="product" expand="1"/>
<field name="account" expand="1"/>
<field name="quantity"/>
<field name="unit"/>
<field name="unit_price"/>
<field name="quantity" symbol="unit"/>
<field name="unit_price" symbol="currency"/>
<field name="taxes"/>
<field name="amount"/>
<field name="amount" symbol="currency"/>
</tree>
+2 -2
View File
@@ -15,9 +15,9 @@ this repository contains the full copyright notices and license terms. -->
<label name="manual"/>
<field name="manual"/>
<label name="base"/>
<field name="base"/>
<field name="base" symbol="currency"/>
<label name="amount"/>
<field name="amount"/>
<field name="amount" symbol="currency"/>
<separator name="legal_notice" colspan="4"/>
<field name="legal_notice" colspan="4"/>
</form>
+2 -2
View File
@@ -7,6 +7,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="description" expand="1"/>
<field name="account" expand="1"/>
<field name="manual"/>
<field name="base"/>
<field name="amount"/>
<field name="base" symbol="currency"/>
<field name="amount" symbol="currency"/>
</tree>
+2 -2
View File
@@ -3,8 +3,8 @@
this repository contains the full copyright notices and license terms. -->
<tree sequence="sequence">
<field name="description" expand="1"/>
<field name="base"/>
<field name="amount"/>
<field name="base" symbol="currency"/>
<field name="amount" symbol="currency"/>
<field name="sequence" tree_invisible="1"/>
<field name="manual" tree_invisible="1"/>
<field name="account" tree_invisible="1"/>
+4 -5
View File
@@ -7,12 +7,11 @@ this repository contains the full copyright notices and license terms. -->
<field name="reference"/>
<field name="invoice_date"/>
<field name="party" expand="2"/>
<field name="currency"/>
<field name="untaxed_amount"/>
<field name="tax_amount"/>
<field name="total_amount"/>
<field name="untaxed_amount" symbol="currency"/>
<field name="tax_amount" symbol="currency"/>
<field name="total_amount" symbol="currency"/>
<field name="state"/>
<field name="amount_to_pay_today"/>
<field name="amount_to_pay_today" symbol="currency"/>
<field name="description" expand="1"/>
<button name="cancel" tree_invisible="1"/>
<button name="draft" tree_invisible="1"/>
+3 -5
View File
@@ -3,9 +3,7 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="date"/>
<field name="debit" sum="Debit"/>
<field name="credit" sum="Credit"/>
<field name="amount_second_currency"
sum="Amount Second Currency"/>
<field name="second_currency"/>
<field name="debit" sum="Debit" symbol="currency"/>
<field name="credit" sum="Credit" symbol="currency"/>
<field name="amount_second_currency" sum="Amount Second Currency" symbol="second_currency"/>
</tree>
+3 -6
View File
@@ -3,10 +3,7 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="maturity_date"/>
<field name="debit" sum="Debit"/>
<field name="credit" sum="Credit"/>
<field name="amount_second_currency" sum="Amount Second Currency"/>
<field name="second_currency" expand="1"/>
<field name="currency_digits" tree_invisible="1"/>
<field name="second_currency_digits" tree_invisible="1"/>
<field name="debit" sum="Debit" symbol="currency"/>
<field name="credit" sum="Credit" symbol="currency"/>
<field name="amount_second_currency" sum="Amount Second Currency" symbol="second_currency"/>
</tree>
+1 -2
View File
@@ -7,6 +7,5 @@ this repository contains the full copyright notices and license terms. -->
<field name="ratio" factor="100">
<suffix string="%" name="ratio"/>
</field>
<field name="amount"/>
<field name="currency"/>
<field name="amount" symbol="currency"/>
</tree>
+1 -2
View File
@@ -6,6 +6,5 @@ this repository contains the full copyright notices and license terms. -->
<field name="ratio" factor="100">
<suffix string="%" name="ratio"/>
</field>
<field name="amount"/>
<field name="currency"/>
<field name="amount" symbol="currency"/>
</tree>
+1 -1
View File
@@ -3,5 +3,5 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="date"/>
<field name="amount"/>
<field name="amount" symbol="currency"/>
</tree>