changeset 1f9ce6dda52c in modules/account_invoice:default
details:
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=1f9ce6dda52c
description:
Add symbol widget
issue9059
review276871002
diffstat:
invoice.py | 7 +++++++
payment_term.py | 5 ++++-
view/invoice_form.xml | 10 +++++-----
view/invoice_line_form.xml | 4 ++--
view/invoice_line_tree.xml | 7 +++----
view/invoice_line_tree_sequence.xml | 7 +++----
view/invoice_tax_form.xml | 4 ++--
view/invoice_tax_tree.xml | 4 ++--
view/invoice_tax_tree_sequence.xml | 4 ++--
view/invoice_tree.xml | 9 ++++-----
view/move_line_list_payment.xml | 8 +++-----
view/move_line_list_to_pay.xml | 9 +++------
view/payment_term_line_list.xml | 3 +--
view/payment_term_line_list_sequence.xml | 3 +--
view/payment_term_test_result_list.xml | 2 +-
15 files changed, 43 insertions(+), 43 deletions(-)
diffs (247 lines):
diff -r feee3d2c1891 -r 1f9ce6dda52c invoice.py
--- a/invoice.py Thu Sep 24 22:49:09 2020 +0200
+++ b/invoice.py Fri Oct 09 19:09:05 2020 +0200
@@ -2310,6 +2310,8 @@
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 @@
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')
diff -r feee3d2c1891 -r 1f9ce6dda52c payment_term.py
--- a/payment_term.py Thu Sep 24 22:49:09 2020 +0200
+++ b/payment_term.py Fri Oct 09 19:09:05 2020 +0200
@@ -394,7 +394,9 @@
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 @@
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')
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_form.xml
--- a/view/invoice_form.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_form.xml Fri Oct 09 19:09:05 2020 +0200
@@ -40,11 +40,11 @@
</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 @@
</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"/>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_line_form.xml
--- a/view/invoice_line_form.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_line_form.xml Fri Oct 09 19:09:05 2020 +0200
@@ -19,9 +19,9 @@
<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"/>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_line_tree.xml
--- a/view/invoice_line_tree.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_line_tree.xml Fri Oct 09 19:09:05 2020 +0200
@@ -6,9 +6,8 @@
<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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_line_tree_sequence.xml
--- a/view/invoice_line_tree_sequence.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_line_tree_sequence.xml Fri Oct 09 19:09:05 2020 +0200
@@ -6,9 +6,8 @@
<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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_tax_form.xml
--- a/view/invoice_tax_form.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_tax_form.xml Fri Oct 09 19:09:05 2020 +0200
@@ -15,9 +15,9 @@
<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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_tax_tree.xml
--- a/view/invoice_tax_tree.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_tax_tree.xml Fri Oct 09 19:09:05 2020 +0200
@@ -7,6 +7,6 @@
<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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_tax_tree_sequence.xml
--- a/view/invoice_tax_tree_sequence.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_tax_tree_sequence.xml Fri Oct 09 19:09:05 2020 +0200
@@ -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"/>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/invoice_tree.xml
--- a/view/invoice_tree.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/invoice_tree.xml Fri Oct 09 19:09:05 2020 +0200
@@ -7,12 +7,11 @@
<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"/>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/move_line_list_payment.xml
--- a/view/move_line_list_payment.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/move_line_list_payment.xml Fri Oct 09 19:09:05 2020 +0200
@@ -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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/move_line_list_to_pay.xml
--- a/view/move_line_list_to_pay.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/move_line_list_to_pay.xml Fri Oct 09 19:09:05 2020 +0200
@@ -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>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/payment_term_line_list.xml
--- a/view/payment_term_line_list.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/payment_term_line_list.xml Fri Oct 09 19:09:05 2020 +0200
@@ -7,6 +7,5 @@
<field name="ratio" factor="100">
<suffix string="%" name="ratio"/>
</field>
- <field name="amount"/>
- <field name="currency"/>
+ <field name="amount" symbol="currency"/>
</tree>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/payment_term_line_list_sequence.xml
--- a/view/payment_term_line_list_sequence.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/payment_term_line_list_sequence.xml Fri Oct 09 19:09:05 2020 +0200
@@ -6,6 +6,5 @@
<field name="ratio" factor="100">
<suffix string="%" name="ratio"/>
</field>
- <field name="amount"/>
- <field name="currency"/>
+ <field name="amount" symbol="currency"/>
</tree>
diff -r feee3d2c1891 -r 1f9ce6dda52c view/payment_term_test_result_list.xml
--- a/view/payment_term_test_result_list.xml Thu Sep 24 22:49:09 2020 +0200
+++ b/view/payment_term_test_result_list.xml Fri Oct 09 19:09:05 2020 +0200
@@ -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>