diff options
| author | Laurent Smet <las@odoo.com> | 2019-05-29 13:35:09 +0000 |
|---|---|---|
| committer | qdp-odoo <qdp@odoo.com> | 2019-06-28 11:52:55 +0000 |
| commit | beaa30a3d1843de43a45f419bfbc1bfa7613a920 (patch) | |
| tree | 00e62f6861eb15b3735fe032b849fd3e6150868c /addons/account/report | |
| parent | 0bd61b5245e475825fdeb33fb7b9ddb4f378c657 (diff) | |
[IMP/REF] accounting-pocalypse yeaaahh
This commit merges the following models
* account.invoice and account.move
* account.invoice.line and account.move.line
* account.voucher and account.move
* account.voucher.line and account.move.line
It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.
==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.
The same reasoning applies to sale/purchase vouchers.
==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist
Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.
Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.
There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.
==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping
field (account.invoice) field (account.move)
----------------------- --------------------
name invoice_payment_ref
number name
reference ref
comment narration
user_id invoice_user_id
amount_ total_company_signed amount_total_signed
residual amount_residual
state state + invoice_payment_state /!\ selection changed
date_invoice invoice_date
date_due invoice_date_due
sent invoice_sent
origin invoice_origin
payment_term_id invoice_payment_term_id
partner_bank_id invoice_partner_bank_id
incoterm_id invoice_incoterm_id
vendor_bill_id invoice_vendor_bill_id
source_email invoice_source_email
vendor_display_name invoice_vendor_display_name
invoice_icon invoice_vendor_icon
cash_rounding_id invoice_cash_rounding_id
sequence_number_next invoice_sequence_number_next
sequence_number_next_prefix invoice_sequence_number_next_prefix
'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()
* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping
field (account.invoice.line) field (account.move.line)
---------------------------- -------------------------
invoice_id move_id
uom_id product_uom_id
invoice_line_tax_ids tax_ids
account_analytic_id analytic_account_id
'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'
* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping
field (account.invoice.tax) field (account.move.line)
--------------------------- -------------------------
invoice_id move_id
account_analytic_id analytic_account_id
amount price_unit
base tax_base_amount
'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'
* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line
==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'
Was task 1917430
Diffstat (limited to 'addons/account/report')
| -rw-r--r-- | addons/account/report/account_invoice_report.py | 265 | ||||
| -rw-r--r-- | addons/account/report/account_invoice_report_view.xml | 38 |
2 files changed, 148 insertions, 155 deletions
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 2cebf29d6d5..d63c997347f 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -8,46 +8,19 @@ class AccountInvoiceReport(models.Model): _name = "account.invoice.report" _description = "Invoices Statistics" _auto = False - _rec_name = 'date' + _rec_name = 'invoice_date' + _order = 'invoice_date desc' - @api.multi - @api.depends('currency_id', 'date', 'price_total', 'price_average', 'residual') - def _compute_amounts_in_user_currency(self): - """Compute the amounts in the currency of the user - """ - user_currency_id = self.env.company.currency_id - currency_rate_id = self.env['res.currency.rate'].search([ - ('rate', '=', 1), - '|', ('company_id', '=', self.env.company.id), ('company_id', '=', False)], limit=1) - base_currency_id = currency_rate_id.currency_id - for record in self: - date = record.date or fields.Date.today() - company = record.company_id - record.user_currency_price_total = base_currency_id._convert(record.price_total, user_currency_id, company, date) - record.user_currency_price_average = base_currency_id._convert(record.price_average, user_currency_id, company, date) - record.user_currency_residual = base_currency_id._convert(record.residual, user_currency_id, company, date) - - number = fields.Char('Invoice #', readonly=True) - date = fields.Date(readonly=True, string="Invoice Date") - product_id = fields.Many2one('product.product', string='Product', readonly=True) - product_qty = fields.Float(string='Product Quantity', readonly=True) - uom_name = fields.Char(string='Reference Unit of Measure', readonly=True) - payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term', readonly=True) - fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position', readonly=True) - currency_id = fields.Many2one('res.currency', string='Currency', readonly=True) - categ_id = fields.Many2one('product.category', string='Product Category', readonly=True) + # ==== Invoice fields ==== + move_id = fields.Many2one('account.move', readonly=True) + name = fields.Char('Invoice #', readonly=True) journal_id = fields.Many2one('account.journal', string='Journal', readonly=True) + company_id = fields.Many2one('res.company', string='Company', readonly=True) + currency_id = fields.Many2one('res.currency', string='Currency', readonly=True) partner_id = fields.Many2one('res.partner', string='Partner', readonly=True) commercial_partner_id = fields.Many2one('res.partner', string='Partner Company', help="Commercial Entity") - company_id = fields.Many2one('res.company', string='Company', readonly=True) - user_id = fields.Many2one('res.users', string='Salesperson', readonly=True) - price_total = fields.Float(string='Untaxed Total', readonly=True) - user_currency_price_total = fields.Float(string="Total Without Tax in Currency", compute='_compute_amounts_in_user_currency', digits=0) - price_average = fields.Float(string='Average Price', readonly=True, group_operator="avg") - user_currency_price_average = fields.Float(string="Average Price in Currency", compute='_compute_amounts_in_user_currency', digits=0) - currency_rate = fields.Float(string='Currency Rate', readonly=True, group_operator="avg", groups="base.group_multi_currency") - nbr = fields.Integer(string='Line Count', readonly=True) # TDE FIXME master: rename into nbr_lines - invoice_id = fields.Many2one('account.invoice', readonly=True) + country_id = fields.Many2one('res.country', string="Partner Company's Country") + invoice_user_id = fields.Many2one('res.users', string='Salesperson', readonly=True) type = fields.Selection([ ('out_invoice', 'Customer Invoice'), ('in_invoice', 'Vendor Bill'), @@ -56,32 +29,42 @@ class AccountInvoiceReport(models.Model): ], readonly=True) state = fields.Selection([ ('draft', 'Draft'), - ('open', 'Open'), - ('paid', 'Paid'), + ('posted', 'Open'), ('cancel', 'Cancelled') ], string='Invoice Status', readonly=True) - date_due = fields.Date(string='Due Date', readonly=True) - account_id = fields.Many2one('account.account', string='Receivable/Payable Account', readonly=True, domain=[('deprecated', '=', False)]) - account_line_id = fields.Many2one('account.account', string='Revenue/Expense Account', readonly=True, domain=[('deprecated', '=', False)]) - partner_bank_id = fields.Many2one('res.partner.bank', string='Bank Account', readonly=True) + invoice_payment_state = fields.Selection(selection=[ + ('not_paid', 'Not Paid'), + ('in_payment', 'In Payment'), + ('paid', 'paid') + ], string='Payment Status', readonly=True) + fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position', readonly=True) + invoice_date = fields.Date(readonly=True, string="Invoice Date") + invoice_payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term', readonly=True) + invoice_partner_bank_id = fields.Many2one('res.partner.bank', string='Bank Account', readonly=True) + nbr_lines = fields.Integer(string='Line Count', readonly=True) residual = fields.Float(string='Due Amount', readonly=True) - user_currency_residual = fields.Float(string="Total Residual", compute='_compute_amounts_in_user_currency', digits=0) - country_id = fields.Many2one('res.country', string="Partner Company's Country") - account_analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account', groups="analytic.group_analytic_accounting") amount_total = fields.Float(string='Total', readonly=True) - _order = 'date desc' + # ==== Invoice line fields ==== + quantity = fields.Float(string='Product Quantity', readonly=True) + product_id = fields.Many2one('product.product', string='Product', readonly=True) + product_uom_id = fields.Many2one('uom.uom', string='Unit of Measure', readonly=True) + product_categ_id = fields.Many2one('product.category', string='Product Category', readonly=True) + invoice_date_due = fields.Date(string='Due Date', readonly=True) + account_id = fields.Many2one('account.account', string='Revenue/Expense Account', readonly=True, domain=[('deprecated', '=', False)]) + analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', groups="analytic.group_analytic_accounting") + price_subtotal = fields.Float(string='Untaxed Total', readonly=True) + price_average = fields.Float(string='Average Price', readonly=True, group_operator="avg") _depends = { - 'account.invoice': [ - 'account_id', 'amount_total_company_signed', 'commercial_partner_id', 'company_id', - 'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id', - 'journal_id', 'number', 'partner_bank_id', 'partner_id', 'payment_term_id', - 'residual', 'state', 'type', 'user_id', + 'account.move': [ + 'name', 'state', 'type', 'partner_id', 'invoice_user_id', 'fiscal_position_id', + 'invoice_date', 'invoice_date_due', 'invoice_payment_term_id', 'invoice_partner_bank_id', ], - 'account.invoice.line': [ - 'account_id', 'invoice_id', 'price_subtotal', 'product_id', - 'quantity', 'uom_id', 'account_analytic_id', + 'account.move.line': [ + 'quantity', 'price_subtotal', 'amount_residual', 'balance', 'amount_currency', + 'move_id', 'product_id', 'product_uom_id', 'account_id', 'analytic_account_id', + 'journal_id', 'company_id', 'currency_id', 'partner_id', ], 'product.product': ['product_tmpl_id'], 'product.template': ['categ_id'], @@ -90,97 +73,107 @@ class AccountInvoiceReport(models.Model): 'res.partner': ['country_id'], } + @api.model def _select(self): - select_str = """ - SELECT sub.id, sub.number, sub.date, sub.product_id, sub.partner_id, sub.country_id, sub.account_analytic_id, - sub.payment_term_id, sub.uom_name, sub.currency_id, sub.journal_id, - sub.fiscal_position_id, sub.user_id, sub.company_id, sub.nbr, sub.invoice_id, sub.type, sub.state, - sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id, - sub.product_qty, sub.price_total as price_total, sub.price_average as price_average, sub.amount_total / COALESCE(cr.rate, 1) as amount_total, - COALESCE(cr.rate, 1) as currency_rate, sub.residual as residual, sub.commercial_partner_id as commercial_partner_id - """ - return select_str - - def _sub_select(self): - select_str = """ - SELECT ail.id AS id, - ai.date_invoice AS date, - ai.number as number, - ail.product_id, ai.partner_id, ai.payment_term_id, ail.account_analytic_id, - u2.name AS uom_name, - ai.currency_id, ai.journal_id, ai.fiscal_position_id, ai.user_id, ai.company_id, - 1 AS nbr, - ai.id AS invoice_id, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, - ai.partner_bank_id, - SUM ((invoice_type.sign_qty * ail.quantity) / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) AS product_qty, - SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, - SUM(ail.price_total * invoice_type.sign_qty) AS amount_total, - SUM(ABS(ail.price_subtotal_signed)) / CASE - WHEN SUM(ail.quantity / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) <> 0::numeric - THEN SUM(ail.quantity / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) - ELSE 1::numeric - END AS price_average, - ai.residual_company_signed / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) * - count(*) * invoice_type.sign AS residual, - ai.commercial_partner_id as commercial_partner_id, - coalesce(partner.country_id, partner_ai.country_id) AS country_id - """ - return select_str + return ''' + SELECT + line.id, + line.move_id, + line.product_id, + line.account_id, + line.analytic_account_id, + line.journal_id, + line.company_id, + line.currency_id, + line.partner_id AS commercial_partner_id, + move.name, + move.state, + move.type, + move.partner_id, + move.invoice_user_id, + move.fiscal_position_id, + move.invoice_payment_state, + move.invoice_date, + move.invoice_date_due, + move.invoice_payment_term_id, + move.invoice_partner_bank_id, + move.amount_residual_signed AS residual, + move.amount_total_signed AS amount_total, + uom_template.id AS product_uom_id, + template.categ_id AS product_categ_id, + SUM(line.quantity / NULLIF(COALESCE(uom_line.factor, 1) * COALESCE(uom_template.factor, 1), 0.0)) + AS quantity, + -SUM(line.balance) AS price_subtotal, + -SUM(line.balance / NULLIF(COALESCE(uom_line.factor, 1) * COALESCE(uom_template.factor, 1), 0.0)) + AS price_average, + COALESCE(partner.country_id, commercial_partner.country_id) AS country_id, + 1 AS nbr_lines + ''' + @api.model def _from(self): - from_str = """ - FROM account_invoice_line ail - JOIN account_invoice ai ON ai.id = ail.invoice_id - JOIN res_partner partner ON ai.commercial_partner_id = partner.id - JOIN res_partner partner_ai ON ai.partner_id = partner_ai.id - LEFT JOIN product_product pr ON pr.id = ail.product_id - left JOIN product_template pt ON pt.id = pr.product_tmpl_id - LEFT JOIN uom_uom u ON u.id = ail.uom_id - LEFT JOIN uom_uom u2 ON u2.id = pt.uom_id - JOIN ( - -- Temporary table to decide if the qty should be added or retrieved (Invoice vs Credit Note) - SELECT id,(CASE - WHEN ai.type::text = ANY (ARRAY['in_refund'::character varying::text, 'in_invoice'::character varying::text]) - THEN -1 - ELSE 1 - END) AS sign,(CASE - WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text]) - THEN -1 - ELSE 1 - END) AS sign_qty - FROM account_invoice ai - ) AS invoice_type ON invoice_type.id = ai.id - """ - return from_str + return ''' + FROM account_move_line line + LEFT JOIN res_partner partner ON partner.id = line.partner_id + LEFT JOIN product_product product ON product.id = line.product_id + LEFT JOIN account_account account ON account.id = line.account_id + LEFT JOIN account_account_type user_type ON user_type.id = account.user_type_id + LEFT JOIN product_template template ON template.id = product.product_tmpl_id + LEFT JOIN uom_uom uom_line ON uom_line.id = line.product_uom_id + LEFT JOIN uom_uom uom_template ON uom_template.id = template.uom_id + INNER JOIN account_move move ON move.id = line.move_id + LEFT JOIN res_partner commercial_partner ON commercial_partner.id = move.commercial_partner_id + ''' + + @api.model + def _where(self): + return ''' + WHERE move.type IN ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt') + AND line.account_id IS NOT NULL + AND NOT line.exclude_from_invoice_tab + ''' + @api.model def _group_by(self): - group_by_str = """ - GROUP BY ail.id, ail.product_id, ail.account_analytic_id, ai.date_invoice, ai.id, - ai.partner_id, ai.payment_term_id, u2.name, u2.id, ai.currency_id, ai.journal_id, - ai.fiscal_position_id, ai.user_id, ai.company_id, ai.id, ai.type, invoice_type.sign, ai.state, pt.categ_id, - ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual_company_signed, - ai.amount_total_company_signed, ai.commercial_partner_id, coalesce(partner.country_id, partner_ai.country_id) - """ - return group_by_str + return ''' + GROUP BY + line.id, + line.move_id, + line.product_id, + line.account_id, + line.analytic_account_id, + line.journal_id, + line.company_id, + line.currency_id, + line.partner_id, + move.name, + move.state, + move.type, + move.amount_residual_signed, + move.amount_total_signed, + move.partner_id, + move.invoice_user_id, + move.fiscal_position_id, + move.invoice_payment_state, + move.invoice_date, + move.invoice_date_due, + move.invoice_payment_term_id, + move.invoice_partner_bank_id, + uom_template.id, + template.categ_id, + COALESCE(partner.country_id, commercial_partner.country_id) + ''' @api.model_cr def init(self): - # self._table = account_invoice_report tools.drop_view_if_exists(self.env.cr, self._table) - self.env.cr.execute("""CREATE or REPLACE VIEW %s as ( - WITH currency_rate AS (%s) - %s - FROM ( - %s %s WHERE ail.account_id IS NOT NULL %s - ) AS sub - LEFT JOIN currency_rate cr ON - (cr.currency_id = sub.currency_id AND - cr.company_id = sub.company_id AND - cr.date_start <= COALESCE(sub.date, NOW()) AND - (cr.date_end IS NULL OR cr.date_end > COALESCE(sub.date, NOW()))) - )""" % ( - self._table, self.env['res.currency']._select_companies_rates(), - self._select(), self._sub_select(), self._from(), self._group_by())) + self.env.cr.execute(''' + CREATE OR REPLACE VIEW %s AS ( + %s %s %s %s + ) + ''' % ( + self._table, self._select(), self._from(), self._where(), self._group_by() + )) class ReportInvoiceWithPayment(models.AbstractModel): diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index fceb9ed526e..99f69cf9db0 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -6,9 +6,9 @@ <field name="model">account.invoice.report</field> <field name="arch" type="xml"> <pivot string="Invoices Analysis" disable_linking="True"> - <field name="categ_id" type="row"/> - <field name="date" type="col"/> - <field name="price_total" type="measure"/> + <field name="product_categ_id" type="row"/> + <field name="invoice_date" type="col"/> + <field name="price_subtotal" type="measure"/> </pivot> </field> </record> @@ -18,8 +18,8 @@ <field name="model">account.invoice.report</field> <field name="arch" type="xml"> <graph string="Invoices Analysis"> - <field name="categ_id"/> - <field name="price_total" type="measure"/> + <field name="product_categ_id"/> + <field name="price_subtotal" type="measure"/> </graph> </field> </record> @@ -30,35 +30,35 @@ <field name="model_id">account.invoice.report</field> <field name="domain">[]</field> <field name="user_id" eval="False"/> - <field name="context">{'group_by': ['date:month', 'user_id']}</field> + <field name="context">{'group_by': ['invoice_date:month', 'invoice_user_id']}</field> </record> <record id="filter_invoice_product" model="ir.filters"> <field name="name">By Product</field> <field name="model_id">account.invoice.report</field> <field name="domain">[]</field> <field name="user_id" eval="False"/> - <field name="context">{'group_by': ['date:month', 'product_id'], 'set_visible':True, 'residual_invisible':True}</field> + <field name="context">{'group_by': ['invoice_date:month', 'product_id'], 'set_visible':True, 'residual_invisible':True}</field> </record> <record id="filter_invoice_product_category" model="ir.filters"> <field name="name">By Product Category</field> <field name="model_id">account.invoice.report</field> <field name="domain">[]</field> <field name="user_id" eval="False"/> - <field name="context">{'group_by': ['date:month', 'categ_id'], 'residual_invisible':True}</field> + <field name="context">{'group_by': ['invoice_date:month', 'product_categ_id'], 'residual_invisible':True}</field> </record> <record id="filter_invoice_refund" model="ir.filters"> <field name="name">By Credit Note</field> <field name="model_id">account.invoice.report</field> <field name="domain">[('type', '=', 'out_refund')]</field> <field name="user_id" eval="False"/> - <field name="context">{'group_by': ['date:month', 'user_id']}</field> + <field name="context">{'group_by': ['invoice_date:month', 'invoice_user_id']}</field> </record> <record id="filter_invoice_country" model="ir.filters"> <field name="name">By Country</field> <field name="model_id">account.invoice.report</field> <field name="domain">[]</field> <field name="user_id" eval="False"/> - <field name="context">{'group_by': ['date:month', 'country_id']}</field> + <field name="context">{'group_by': ['invoice_date:month', 'country_id']}</field> </record> <record id="view_account_invoice_report_search" model="ir.ui.view"> @@ -66,9 +66,9 @@ <field name="model">account.invoice.report</field> <field name="arch" type="xml"> <search string="Invoices Analysis"> - <filter string="My Invoices" name="my_invoice" domain="[('user_id', '=', uid)]"/> + <filter string="My Invoices" name="my_invoice" domain="[('invoice_user_id', '=', uid)]"/> <separator/> - <field name="date"/> + <field name="invoice_date"/> <separator/> <filter string="To Invoice" name="toinvoice" domain="[('state','=','draft')]" help = "Draft Invoices"/> <filter string="Invoiced" name="current" domain="[('state','not in', ('draft','cancel'))]"/> @@ -79,19 +79,19 @@ <filter string="Invoices" name="invoice" domain="['|', ('type','=','out_invoice'),('type','=','in_invoice')]"/> <filter string="Credit Notes" name="creditnote" domain="['|', ('type','=','out_refund'),('type','=','in_refund')]"/> <field name="partner_id" operator="child_of"/> - <field name="user_id" /> + <field name="invoice_user_id" /> <field name="product_id" /> - <field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/> + <field name="product_categ_id" filter_domain="[('product_categ_id', 'child_of', self)]"/> <group expand="1" string="Group By"> - <filter string="Salesperson" name='user' context="{'group_by':'user_id'}"/> + <filter string="Salesperson" name='user' context="{'group_by':'invoice_user_id'}"/> <filter string="Partner" name="partner_id" context="{'group_by':'partner_id','residual_visible':True}"/> - <filter string="Product Category" name="category_product" context="{'group_by':'categ_id','residual_invisible':True}"/> + <filter string="Product Category" name="category_product" context="{'group_by':'product_categ_id','residual_invisible':True}"/> <filter string="Status" name="status" context="{'group_by':'state'}"/> - <filter string="Analytic Account" name="account_analytic_id" context="{'group_by':'account_analytic_id'}" groups="analytic.group_analytic_accounting" /> + <filter string="Analytic Account" name="analytic_account_id" context="{'group_by':'analytic_account_id'}" groups="analytic.group_analytic_accounting" /> <filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> <separator orientation="vertical" /> - <filter string="Date" name="date" context="{'group_by':'date'}"/> - <filter string="Due Date" name="duemonth" context="{'group_by':'date_due:month'}"/> + <filter string="Date" name="invoice_date" context="{'group_by':'invoice_date'}"/> + <filter string="Due Date" name="duemonth" context="{'group_by':'invoice_date_due:month'}"/> </group> </search> </field> |
