mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_sale_invoicing: Migration to 15.0
TT45293 Co-Authored-By: Pedro M. Baeza <pedro.baeza@tecnativa.com>
This commit is contained in:
committed by
Pedro M. Baeza
parent
df41101390
commit
2c474e55ca
@@ -1,4 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
from . import tests
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# Copyright 2018 Tecnativa - Carlos Dauden
|
||||
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Contract Invoicing of Pending Sales Orders",
|
||||
"summary": "Include sales to invoice in contract invoice creation",
|
||||
"version": "12.0.1.0.4",
|
||||
"version": "15.0.1.0.0",
|
||||
"category": "Contract Management",
|
||||
"website": "https://github.com/OCA/contract",
|
||||
"author": "Tecnativa, " "Odoo Community Association (OCA)",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2018 Tecnativa - Carlos Dauden
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ContractContract(models.Model):
|
||||
@@ -13,7 +13,6 @@ class ContractContract(models.Model):
|
||||
"in contract invoice creation.",
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def _recurring_create_invoice(self, date_ref=False):
|
||||
invoices = super()._recurring_create_invoice(date_ref)
|
||||
for contract in self:
|
||||
@@ -36,7 +35,5 @@ class ContractContract(models.Model):
|
||||
]
|
||||
)
|
||||
if sales:
|
||||
invoice_ids = sales.action_invoice_create()
|
||||
invoices |= self.env["account.invoice"].browse(invoice_ids)[:1]
|
||||
|
||||
invoices |= sales._create_invoices()
|
||||
return invoices
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||
|
||||
* Carlos Dauden
|
||||
* Carolina Fernandez
|
||||
* Pedro M. Baeza
|
||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
||||
|
||||
@@ -419,6 +419,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Carlos Dauden</li>
|
||||
<li>Carolina Fernandez</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Souheil Bejaoui <<a class="reference external" href="mailto:souheil.bejaoui@acsone.eu">souheil.bejaoui@acsone.eu</a>></li>
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
# Copyright 2018 Tecnativa - Carlos Dauden
|
||||
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||
# Copyright 2023 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from freezegun import freeze_time
|
||||
|
||||
from odoo.addons.contract.tests.test_contract import TestContractBase
|
||||
|
||||
|
||||
@freeze_time("2016-02-28")
|
||||
class TestContractSaleInvoicing(TestContractBase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestContractSaleInvoicing, cls).setUpClass()
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(
|
||||
context=dict(
|
||||
cls.env.context,
|
||||
mail_create_nolog=True,
|
||||
mail_create_nosubscribe=True,
|
||||
mail_notrack=True,
|
||||
no_reset_password=True,
|
||||
tracking_disable=True,
|
||||
)
|
||||
)
|
||||
cls.contract.group_id = cls.env["account.analytic.account"].search([], limit=1)
|
||||
cls.product_so = cls.env.ref("product.product_product_1")
|
||||
cls.product_so.invoice_policy = "order"
|
||||
@@ -31,7 +46,6 @@ class TestContractSaleInvoicing(TestContractBase):
|
||||
],
|
||||
"pricelist_id": cls.partner.property_product_pricelist.id,
|
||||
"analytic_account_id": cls.contract.group_id.id,
|
||||
"date_order": "2016-02-15",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user