mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract: Migration to 13.0
- Standard procedure - Adapt invoice creation to new account.move - Tests adapted
This commit is contained in:
committed by
Jean-Charles Drubay
parent
92a4e7781e
commit
9ed0486d44
@@ -1,7 +1,7 @@
|
||||
# Copyright 2020 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ContractContractTerminate(models.TransientModel):
|
||||
@@ -27,7 +27,6 @@ class ContractContractTerminate(models.TransientModel):
|
||||
related="terminate_reason_id.terminate_comment_required"
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def terminate_contract(self):
|
||||
for wizard in self:
|
||||
wizard.contract_id._terminate_contract(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2018 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ContractLineWizard(models.TransientModel):
|
||||
@@ -28,7 +28,6 @@ class ContractLineWizard(models.TransientModel):
|
||||
ondelete="cascade",
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def stop(self):
|
||||
for wizard in self:
|
||||
wizard.contract_line_id.stop(
|
||||
@@ -36,7 +35,6 @@ class ContractLineWizard(models.TransientModel):
|
||||
)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def plan_successor(self):
|
||||
for wizard in self:
|
||||
wizard.contract_line_id.plan_successor(
|
||||
@@ -44,7 +42,6 @@ class ContractLineWizard(models.TransientModel):
|
||||
)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def stop_plan_successor(self):
|
||||
for wizard in self:
|
||||
wizard.contract_line_id.stop_plan_successor(
|
||||
@@ -52,7 +49,6 @@ class ContractLineWizard(models.TransientModel):
|
||||
)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def uncancel(self):
|
||||
for wizard in self:
|
||||
wizard.contract_line_id.uncancel(wizard.recurring_next_date)
|
||||
|
||||
@@ -36,7 +36,6 @@ class ContractManuallyCreateInvoice(models.TransientModel):
|
||||
)
|
||||
self.contract_to_invoice_count = len(self.contract_to_invoice_ids)
|
||||
|
||||
@api.multi
|
||||
def action_show_contract_to_invoice(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
@@ -48,16 +47,15 @@ class ContractManuallyCreateInvoice(models.TransientModel):
|
||||
"context": self.env.context,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def create_invoice(self):
|
||||
self.ensure_one()
|
||||
invoices = self.env["account.invoice"]
|
||||
invoices = self.env["account.move"]
|
||||
for contract in self.contract_to_invoice_ids:
|
||||
invoices |= contract.recurring_create_invoice()
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": _("Invoices"),
|
||||
"res_model": "account.invoice",
|
||||
"res_model": "account.move",
|
||||
"domain": [("id", "in", invoices.ids)],
|
||||
"view_mode": "tree,form",
|
||||
"context": self.env.context,
|
||||
|
||||
Reference in New Issue
Block a user