Browse Source

[FIX] contract_invoice_merge_by_partner: Minor fix

pull/33/head
Carlos Incaser 9 years ago
parent
commit
2a34a8cbc7
  1. 8
      contract_invoice_merge_by_partner/README.rst
  2. 3
      contract_invoice_merge_by_partner/models/account_analytic_analysis.py
  3. 2
      contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py

8
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
===========

3
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)

2
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')

Loading…
Cancel
Save