diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 4611e0ab240..2d09753e584 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1735,7 +1735,7 @@ class res_partner(osv.osv): ''' Find the partner for which the accounting entries will be created ''' - # FIXME: after 7.0, to replace by function field partner.commercial_id + # FIXME: after 7.0, to replace by function field partner.commercial_partner_id #if the chosen partner is not a company and has a parent company, use the parent for the journal entries #because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait' diff --git a/addons/account_report_company/account_invoice.py b/addons/account_report_company/account_invoice.py index aae1ee77d0e..fe4a7b2c256 100644 --- a/addons/account_report_company/account_invoice.py +++ b/addons/account_report_company/account_invoice.py @@ -25,7 +25,7 @@ class account_invoice(osv.Model): _inherit = 'account.invoice' _columns = { - 'partner_commercial_id': fields.related('partner_id', 'commercial_id', string='Commercial Entity', type='many2one', + 'commercial_partner_id': fields.related('partner_id', 'commercial_partner_id', string='Commercial Entity', type='many2one', relation='res.partner', store=True, readonly=True, help="The commercial entity that will be used on Journal Entries for this invoice") - } \ No newline at end of file + } diff --git a/addons/account_report_company/account_invoice_view.xml b/addons/account_report_company/account_invoice_view.xml index 2db2d77ad87..89479c5a5e7 100644 --- a/addons/account_report_company/account_invoice_view.xml +++ b/addons/account_report_company/account_invoice_view.xml @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/addons/account_report_company/report/account_invoice_report.py b/addons/account_report_company/report/account_invoice_report.py index 09cf1caca83..5941aef9e6e 100644 --- a/addons/account_report_company/report/account_invoice_report.py +++ b/addons/account_report_company/report/account_invoice_report.py @@ -23,14 +23,14 @@ from openerp.osv import osv, fields class account_invoice_report(osv.Model): _inherit = 'account.invoice.report' _columns = { - 'partner_commercial_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"), + 'commercial_partner_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"), } def _select(self): - return super(account_invoice_report, self)._select() + ", sub.partner_commercial_id as partner_commercial_id" + return super(account_invoice_report, self)._select() + ", sub.commercial_partner_id as commercial_partner_id" def _sub_select(self): - return super(account_invoice_report, self)._sub_select() + ", ai.partner_commercial_id as partner_commercial_id" + return super(account_invoice_report, self)._sub_select() + ", ai.commercial_partner_id as commercial_partner_id" def _group_by(self): - return super(account_invoice_report, self)._group_by() + ", ai.partner_commercial_id" + return super(account_invoice_report, self)._group_by() + ", ai.commercial_partner_id" diff --git a/addons/account_report_company/report/account_invoice_report_view.xml b/addons/account_report_company/report/account_invoice_report_view.xml index bfdc99b1361..90fa4bdf2ec 100644 --- a/addons/account_report_company/report/account_invoice_report_view.xml +++ b/addons/account_report_company/report/account_invoice_report_view.xml @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ - +