[MIG] contract_price_revision: Migration to 15.0

This commit is contained in:
Carolina Fernandez
2023-09-28 07:42:40 -03:00
committed by Juanjo
parent 83b369c838
commit 5e5c12efbd
10 changed files with 36 additions and 24 deletions

View File

@@ -7,7 +7,7 @@ Contract Price Revision
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c8a59ff02fbb6be23950f10dec81d9fac5d8dceb53a5213a9cce91789ca63230
!! source digest: sha256:de222a92e86474bc20e85dbdae73adfb5e21bd3f96b065006dcb12b04f58b2ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -17,13 +17,13 @@ Contract Price Revision
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/13.0/contract_price_revision
:target: https://github.com/OCA/contract/tree/15.0/contract_price_revision
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_price_revision
:target: https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract_price_revision
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=13.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=15.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -63,7 +63,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_price_revision%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_price_revision%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -83,6 +83,7 @@ Contributors
* Vicent Cubells
* Carlos Dauden
* Carolina Fernandez
Maintainers
~~~~~~~~~~~
@@ -105,6 +106,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-carlosdauden|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/13.0/contract_price_revision>`_ project on GitHub.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/15.0/contract_price_revision>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -1,17 +1,22 @@
# Copyright 2019 Tecnativa - Vicent Cubells
# Copyright 2019 Tecnativa - Carlos Dauden
# Copyright 2023 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Contract Price Revision",
"summary": "Easy revision of contract prices",
"version": "13.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Contract",
"author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/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,
"development_status": "Production/Stable",
"maintainers": ["carlosdauden"],

View File

@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"

View File

@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-17 12:20+0100\n"
"PO-Revision-Date: 2023-07-20 09:11+0000\n"
"PO-Revision-Date: 2023-10-29 09:38+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: \n"
"Language: es\n"
@@ -30,7 +30,7 @@ msgstr "Cancelar"
#. module: contract_price_revision
#: model:ir.model.fields,help:contract_price_revision.field_contract_line__never_revise_price
msgid "Check this if you don't want to allow price revision."
msgstr ""
msgstr "Marque esta casilla si no desea permitir la revisión de precios."
#. module: contract_price_revision
#: model:ir.model,name:contract_price_revision.model_contract_line
@@ -70,7 +70,7 @@ msgstr "Nombre mostrado"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__fixed_price
msgid "Fixed Price"
msgstr ""
msgstr "Precio Fijo"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__id
@@ -95,7 +95,7 @@ msgstr "Última actualización en"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__never_revise_price
msgid "Never Revise Price"
msgstr ""
msgstr "No Revisar Nunca el Precio"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__previous_price
@@ -105,7 +105,7 @@ msgstr "Precio anterior"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__price_can_be_revised
msgid "Price Can Be Revised"
msgstr ""
msgstr "El Precio Puede ser Revisado"
#. module: contract_price_revision
#: model_terms:ir.ui.view,arch_db:contract_price_revision.contract_line_duplicate_wizard_view
@@ -125,7 +125,7 @@ msgstr ""
#. module: contract_price_revision
#: model:ir.model.fields,help:contract_price_revision.field_contract_line__price_can_be_revised
msgid "Technical field in order to know if the line price can be revised."
msgstr ""
msgstr "Campo técnico para saber si se puede revisar el precio de la línea."
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__variation_percent
@@ -136,7 +136,7 @@ msgstr "Variación %"
#. module: contract_price_revision
#: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__variation_type
msgid "Variation Type"
msgstr ""
msgstr "Tipo de Variación"
#. module: contract_price_revision
#: model:ir.model,name:contract_price_revision.model_contract_price_revision_wizard

View File

@@ -30,7 +30,7 @@ class ContractLine(models.Model):
@api.depends_context("date_start")
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(
lambda line: not line.never_revise_price
and not line.automatic_price

View File

@@ -2,3 +2,4 @@
* Vicent Cubells
* Carlos Dauden
* Carolina Fernandez

View 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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 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
3 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

View File

@@ -367,9 +367,9 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c8a59ff02fbb6be23950f10dec81d9fac5d8dceb53a5213a9cce91789ca63230
!! source digest: sha256:de222a92e86474bc20e85dbdae73adfb5e21bd3f96b065006dcb12b04f58b2ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/13.0/contract_price_revision"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_price_revision"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&amp;target_branch=13.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/15.0/contract_price_revision"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract_price_revision"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to create revisions of contract line prices.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@@ -410,7 +410,7 @@ Check Never Revise Price on line level to avoid price revisions.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract_price_revision%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract_price_revision%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -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>Vicent Cubells</li>
<li>Carlos Dauden</li>
<li>Carolina Fernandez</li>
</ul>
</li>
</ul>
@@ -441,7 +442,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/carlosdauden"><img alt="carlosdauden" src="https://github.com/carlosdauden.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/13.0/contract_price_revision">OCA/contract</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/15.0/contract_price_revision">OCA/contract</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -1,6 +1,7 @@
# Copyright 2019 Tecnativa - Vicent Cubells
# Copyright 2019 Tecnativa - Carlos Dauden
# Copyright 2020 ACSONE SA/NV
# Copyright 2023 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.addons.contract.tests.test_contract import TestContractBase
@@ -20,7 +21,7 @@ class TestContractPriceRevision(TestContractBase):
)
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):
# This is for checking if this line is not versioned

View File

@@ -69,8 +69,8 @@ class ContractPriceRevisionWizard(models.TransientModel):
line.stop(date_end)
new_line = line.copy(self._get_new_line_value(line))
line.update({"successor_contract_line_id": new_line.id})
action = self.env["ir.actions.act_window"].for_xml_id(
"contract", "action_customer_contract"
action = self.env["ir.actions.act_window"]._for_xml_id(
"contract.action_customer_contract"
)
action["domain"] = [("id", "in", active_ids)]
return action