mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_price_revision: Migration to 15.0
This commit is contained in:
@@ -1,17 +1,22 @@
|
|||||||
# Copyright 2019 Tecnativa - Vicent Cubells
|
# Copyright 2019 Tecnativa - Vicent Cubells
|
||||||
# Copyright 2019 Tecnativa - Carlos Dauden
|
# Copyright 2019 Tecnativa - Carlos Dauden
|
||||||
|
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Contract Price Revision",
|
"name": "Contract Price Revision",
|
||||||
"summary": "Easy revision of contract prices",
|
"summary": "Easy revision of contract prices",
|
||||||
"version": "13.0.1.0.1",
|
"version": "15.0.1.0.0",
|
||||||
"category": "Contract",
|
"category": "Contract",
|
||||||
"author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"website": "https://github.com/OCA/contract",
|
"website": "https://github.com/OCA/contract",
|
||||||
"depends": ["contract"],
|
"depends": ["contract"],
|
||||||
"data": ["views/contract_line.xml", "wizards/contract_price_revision_views.xml"],
|
"data": [
|
||||||
|
"security/ir.model.access.csv",
|
||||||
|
"views/contract_line.xml",
|
||||||
|
"wizards/contract_price_revision_views.xml",
|
||||||
|
],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"development_status": "Production/Stable",
|
"development_status": "Production/Stable",
|
||||||
"maintainers": ["carlosdauden"],
|
"maintainers": ["carlosdauden"],
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class ContractLine(models.Model):
|
|||||||
|
|
||||||
@api.depends_context("date_start")
|
@api.depends_context("date_start")
|
||||||
def _compute_price_can_be_revised(self):
|
def _compute_price_can_be_revised(self):
|
||||||
date_start = self.env.context.get("date_start", fields.Datetime.now())
|
date_start = self.env.context.get("date_start", fields.Date.today())
|
||||||
lines_can_be_revised = self.filtered(
|
lines_can_be_revised = self.filtered(
|
||||||
lambda line: not line.never_revise_price
|
lambda line: not line.never_revise_price
|
||||||
and not line.automatic_price
|
and not line.automatic_price
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
* Vicent Cubells
|
* Vicent Cubells
|
||||||
* Carlos Dauden
|
* Carlos Dauden
|
||||||
|
* Carolina Fernandez
|
||||||
|
|||||||
3
contract_price_revision/security/ir.model.access.csv
Normal file
3
contract_price_revision/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
access_contract_price_revision_wizard_account_invoice,access_contract_price_revision_wizard_account_invoice,model_contract_price_revision_wizard,account.group_account_invoice,1,1,1,1
|
||||||
|
access_contract_price_revision_wizard_account_manager,access_contract_price_revision_wizard_account_manager,model_contract_price_revision_wizard,account.group_account_manager,1,1,1,1
|
||||||
|
@@ -428,6 +428,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||||
<li>Vicent Cubells</li>
|
<li>Vicent Cubells</li>
|
||||||
<li>Carlos Dauden</li>
|
<li>Carlos Dauden</li>
|
||||||
|
<li>Carolina Fernandez</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Copyright 2019 Tecnativa - Vicent Cubells
|
# Copyright 2019 Tecnativa - Vicent Cubells
|
||||||
# Copyright 2019 Tecnativa - Carlos Dauden
|
# Copyright 2019 Tecnativa - Carlos Dauden
|
||||||
# Copyright 2020 ACSONE SA/NV
|
# Copyright 2020 ACSONE SA/NV
|
||||||
|
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
from odoo.addons.contract.tests.test_contract import TestContractBase
|
from odoo.addons.contract.tests.test_contract import TestContractBase
|
||||||
@@ -20,7 +21,7 @@ class TestContractPriceRevision(TestContractBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def execute_wizard(self):
|
def execute_wizard(self):
|
||||||
self.wizard.with_context({"active_ids": [self.contract.id]}).action_apply()
|
self.wizard.with_context(active_ids=self.contract.id).action_apply()
|
||||||
|
|
||||||
def test_contract_price_revision_wizard(self):
|
def test_contract_price_revision_wizard(self):
|
||||||
# This is for checking if this line is not versioned
|
# This is for checking if this line is not versioned
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ class ContractPriceRevisionWizard(models.TransientModel):
|
|||||||
line.stop(date_end)
|
line.stop(date_end)
|
||||||
new_line = line.copy(self._get_new_line_value(line))
|
new_line = line.copy(self._get_new_line_value(line))
|
||||||
line.update({"successor_contract_line_id": new_line.id})
|
line.update({"successor_contract_line_id": new_line.id})
|
||||||
action = self.env["ir.actions.act_window"].for_xml_id(
|
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||||
"contract", "action_customer_contract"
|
"contract.action_customer_contract"
|
||||||
)
|
)
|
||||||
action["domain"] = [("id", "in", active_ids)]
|
action["domain"] = [("id", "in", active_ids)]
|
||||||
return action
|
return action
|
||||||
|
|||||||
Reference in New Issue
Block a user