From ec6c3137a70f19b091748a446d1346af10679720 Mon Sep 17 00:00:00 2001 From: MarinaNico Date: Thu, 21 May 2020 13:19:00 +0200 Subject: [PATCH] Move the analytics fields of supplier invoices to General tab of invoice line. Task 040379 --- invoice.py | 8 ++++++++ invoice.xml | 12 ++++++++++++ tryton.cfg | 2 ++ view/invoice_line_form.xml | 9 +++++++++ 4 files changed, 31 insertions(+) create mode 100644 invoice.xml create mode 100644 view/invoice_line_form.xml diff --git a/invoice.py b/invoice.py index eac19ab..2b6e485 100644 --- a/invoice.py +++ b/invoice.py @@ -30,3 +30,11 @@ class InvoiceLine(metaclass=PoolMeta): if analytic_lines: line.analytic_lines = analytic_lines return lines + + @classmethod + def view_attributes(cls): + return super(InvoiceLine, cls).view_attributes() + [ + ('/form/notebook/page[@id="analytic_accounts"]', 'states', { + 'invisible': True, + }), + ] diff --git a/invoice.xml b/invoice.xml new file mode 100644 index 0000000..0fff583 --- /dev/null +++ b/invoice.xml @@ -0,0 +1,12 @@ + + + + + + account.invoice.line + + invoice_line_form + + + diff --git a/tryton.cfg b/tryton.cfg index 13cde48..c870280 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -6,7 +6,9 @@ depends: company extras_depend: account_invoice + analytic_invoice xml: account.xml analytic.xml + invoice.xml messages.xml diff --git a/view/invoice_line_form.xml b/view/invoice_line_form.xml new file mode 100644 index 0000000..ff4317b --- /dev/null +++ b/view/invoice_line_form.xml @@ -0,0 +1,9 @@ + + + + + + +