[MIG] contract_variable_quantity: Migration to 15.0

TT40289
This commit is contained in:
Víctor Martínez
2022-11-03 11:04:23 +01:00
parent a169418d04
commit 9fe8209fb4
29 changed files with 17 additions and 120 deletions

View File

@@ -14,13 +14,13 @@ Variable quantity in contract recurrent invoicing
: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/14.0/contract_variable_quantity
:target: https://github.com/OCA/contract/tree/15.0/contract_variable_quantity
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-contract_variable_quantity
:target: https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract_variable_quantity
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/14.0
:target: https://runbot.odoo-community.org/runbot/110/15.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -49,7 +49,7 @@ Configuration
* *contract*: Contract whose line belongs to.
* *invoice*: Invoice (header) being created.
.. figure:: https://raw.githubusercontent.com/OCA/contract/14.0/contract_variable_quantity/images/formula_form.png
.. figure:: https://raw.githubusercontent.com/OCA/contract/15.0/contract_variable_quantity/images/formula_form.png
:alt: Formula form
:width: 600 px
@@ -70,7 +70,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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_variable_quantity%0Aversion:%2014.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_variable_quantity%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.
@@ -107,6 +107,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/14.0/contract_variable_quantity>`_ project on GitHub.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/15.0/contract_variable_quantity>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -5,7 +5,7 @@
{
"name": "Variable quantity in contract recurrent invoicing",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"category": "Contract Management",
"license": "AGPL-3",
"author": "Tecnativa, Odoo Community Association (OCA)",

View File

@@ -254,9 +254,3 @@ msgstr ""
"enter de\n"
" la quantitat a facturar a la variable\n"
" 'resultat'."
#~ msgid "Analytic Account"
#~ msgstr "Compte analític"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -253,9 +253,3 @@ msgstr ""
" irgendwo einen float/integer -Wert der\n"
" abzurechnenden Menge in der Variablen\n"
" 'result' speichert."
#~ msgid "Analytic Account"
#~ msgstr "Kostenstelle"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Αναλυτικός Λογαριασμός"

View File

@@ -254,9 +254,3 @@ msgstr ""
"flotante / entero de\n"
" la cantidad a facturar en la variable\n"
" 'result'."
#~ msgid "Analytic Account"
#~ msgstr "Cuenta analítica"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Cuenta analítica"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analyyttinen tili"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Compte analytique"

View File

@@ -230,6 +230,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Conta analítica"

View File

@@ -230,9 +230,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "विश्लेषणात्मक खाता"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -232,9 +232,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analitički konto"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -247,9 +247,3 @@ msgstr ""
"Morate upisati valjani blok python koda koji se u određenom trenutku "
"izvršava i vraća cjelobrojnu/decimalnu vrijednost kao rezultat za količine u "
"stavkama računa "
#~ msgid "Analytic Account"
#~ msgstr "Konto analitike"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -228,6 +228,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analitikus gyűjtőkód könyvelés"

View File

@@ -235,6 +235,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Conto Analitico"

View File

@@ -229,9 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Kostenplaats"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -243,9 +243,3 @@ msgstr ""
"Tem que inserir um bloco válido de código Python que guarde, em algum "
"momento, um valor float/integer na variável 'result' com a quantidade a "
"faturar."
#~ msgid "Analytic Account"
#~ msgstr "Conta Analítica"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -244,6 +244,3 @@ msgstr ""
"Você deve inserir um bloco de código Python válido que armazena em algum "
"momento um valor inteiro/flutuante da quantidade para faturar na variável "
"'resultado'."
#~ msgid "Analytic Account"
#~ msgstr "Conta Analítica"

View File

@@ -239,6 +239,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Conta Analítica"

View File

@@ -230,6 +230,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Cont analitic"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analytický účet"

View File

@@ -230,6 +230,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analitični konto"

View File

@@ -229,6 +229,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analitik Hesap"

View File

@@ -230,9 +230,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "Analitik Hesap"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "account.analytic.invoice.line"

View File

@@ -244,9 +244,3 @@ msgid ""
msgstr ""
"您必须插入有效的Python代码块以便在变量'result'中存储需要发票的数量的浮点 / "
"整数值。"
#~ msgid "Analytic Account"
#~ msgstr "分析会计"
#~ msgid "account.analytic.invoice.line"
#~ msgstr "分析会计合同明细行"

View File

@@ -238,6 +238,3 @@ msgid ""
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
#~ msgid "Analytic Account"
#~ msgstr "核算科目"

View File

@@ -33,6 +33,6 @@ class ContractLineFormula(models.Model):
except Exception as e:
raise exceptions.ValidationError(
_("Error evaluating code.\nDetails: %s") % e
)
) from e
if "result" not in eval_context:
raise exceptions.ValidationError(_("No valid result returned."))

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Variable quantity in contract recurrent invoicing</title>
<style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/contract/tree/14.0/contract_variable_quantity"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-contract_variable_quantity"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/contract/tree/15.0/contract_variable_quantity"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract_variable_quantity"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>With this module, you will be able to define in recurring contracts some
lines with variable quantity according to a provided formula.</p>
<p><strong>Table of contents</strong></p>
@@ -403,7 +403,7 @@ float/integer value of the quantity to invoice in the variable result.</p>
</li>
</ol>
<div class="figure">
<img alt="Formula form" src="https://raw.githubusercontent.com/OCA/contract/14.0/contract_variable_quantity/images/formula_form.png" style="width: 600px;" />
<img alt="Formula form" src="https://raw.githubusercontent.com/OCA/contract/15.0/contract_variable_quantity/images/formula_form.png" style="width: 600px;" />
</div>
</div>
<div class="section" id="usage">
@@ -422,7 +422,7 @@ float/integer value of the quantity to invoice in the variable result.</p>
<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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract_variable_quantity%0Aversion:%2014.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_variable_quantity%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">
@@ -458,7 +458,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/14.0/contract_variable_quantity">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_variable_quantity">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

@@ -4,13 +4,12 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import exceptions
from odoo.tests.common import SavepointCase
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
class TestContractVariableQuantity(SavepointCase):
at_install = False
post_install = True
@tagged("post_install", "-at_install")
class TestContractVariableQuantity(TransactionCase):
def setUp(self):
super().setUp()
self.partner = self.env["res.partner"].create({"name": "Test partner"})