From 2a34a8cbc7936ddfd276b86a83adffb47e0f6f7d Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Tue, 14 Jun 2016 14:29:45 +0200 Subject: [PATCH] [FIX] contract_invoice_merge_by_partner: Minor fix --- contract_invoice_merge_by_partner/README.rst | 8 +------- .../models/account_analytic_analysis.py | 3 +-- .../tests/test_contract_invoice_merge_by_partner.py | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst index 4dba40bc..62a31b8d 100644 --- a/contract_invoice_merge_by_partner/README.rst +++ b/contract_invoice_merge_by_partner/README.rst @@ -18,7 +18,7 @@ To install this module you need *account_invoice_merge*, available in: Usage ===== -#. Go to *Sales > Contracts* and create some contrats with same partner +#. Go to *Sales > Contracts* and create some contracts with same partner #. Go to *Settings > Automation > Scheduled Actions* #. Select *Generate Recurring Invoices from Contracts* #. Set previous time that now in *Next Execution Date* @@ -28,12 +28,6 @@ Usage :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/95/8.0 -Known issues / Roadmap -====================== - -* If product supplier info min quantity is greater than procurement qty and we - have sale orders with distinct analytic account which contains this product, - each purchase order line takes seller min quantity. Bug Tracker =========== diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 5d31287c..a695ab29 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -19,8 +19,7 @@ class PurchaseOrderLine(models.Model): for partner in invoices.mapped('partner_id'): inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) if len(inv_to_merge) > 1: - invoices_info = inv_to_merge.do_merge( - keep_references=True, date_invoice=False) + invoices_info = inv_to_merge.do_merge() res.extend(invoices_info.keys()) for inv_ids_list in invoices_info.values(): unlink_list.extend(inv_ids_list) diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py index e7defcd6..84863d11 100644 --- a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -35,7 +35,7 @@ class TestContractInvoiceMergeByPartner(TransactionCase): self.contract4 = self.contract1.copy() def test_invoices_merged(self): - self.env['account.analytic.account']._cron_recurring_create_invoice() + self.env['account.analytic.account']._recurring_create_invoice() invoices = self.env['account.invoice'].search( [('partner_id', '=', self.partner.id)]) inv_draft = invoices.filtered(lambda x: x.state == 'draft')