Skip to content

Commit

Permalink
[IMP] contract_variable_quantity: Recompute price when changing qty
Browse files Browse the repository at this point in the history
If you have contract lines with automatic price and your pricelist
contains different prices per quantity, the price is not changed
when computing quantity.

This PR fixes this.
  • Loading branch information
pedrobaeza authored and victoralmau committed Sep 23, 2021
1 parent 7ab8f0f commit a793ca5
Show file tree
Hide file tree
Showing 72 changed files with 1,911 additions and 401 deletions.
4 changes: 2 additions & 2 deletions contract_variable_quantity/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2016-2018 Tecnativa - Pedro M. Baeza
# Copyright 2018 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Variable quantity in contract recurrent invoicing',
'version': '11.0.1.2.0',
'version': '11.0.1.2.1',
'category': 'Contract Management',
'license': 'AGPL-3',
'author': "Tecnativa,"
Expand Down
27 changes: 22 additions & 5 deletions contract_variable_quantity/i18n/am.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_quantity
#
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
Expand All @@ -12,17 +12,18 @@ msgstr ""
"PO-Revision-Date: 2016-09-11 02:47+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"Language: am\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: am\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: contract_variable_quantity
#: model:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<code>\n"
" result = env['product.product'].search_count([('sale_ok', '=', True)])\n"
" result = env['product.product']."
"search_count([('sale_ok', '=', True)])\n"
" </code>"
msgstr ""

Expand Down Expand Up @@ -89,7 +90,7 @@ msgid "Display Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:64
#: code:addons/contract_variable_quantity/models/contract.py:81
#, python-format
msgid ""
"Error evaluating code.\n"
Expand All @@ -102,6 +103,7 @@ msgid "Example of Python code"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Fixed quantity"
msgstr ""
Expand All @@ -122,6 +124,12 @@ msgstr ""
msgid "ID"
msgstr "ID"

#. module: contract_variable_quantity
#: model:ir.model.fields,help:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,help:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "If checked, contract lines with 0 qty don't create invoice line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula___last_update
msgid "Last Modified on"
Expand All @@ -144,22 +152,31 @@ msgid "Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:66
#: code:addons/contract_variable_quantity/models/contract.py:83
#, python-format
msgid "No valid result returned."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_formula_id
msgid "Qty. formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_type
msgid "Qty. type"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,field_description:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "Skip Zero Qty Lines"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Variable quantity"
msgstr ""
Expand Down
30 changes: 24 additions & 6 deletions contract_variable_quantity/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_quantity
#
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
Expand All @@ -12,17 +12,19 @@ msgstr ""
"PO-Revision-Date: 2016-09-11 02:47+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: contract_variable_quantity
#: model:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<code>\n"
" result = env['product.product'].search_count([('sale_ok', '=', True)])\n"
" result = env['product.product']."
"search_count([('sale_ok', '=', True)])\n"
" </code>"
msgstr ""

Expand Down Expand Up @@ -89,7 +91,7 @@ msgid "Display Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:64
#: code:addons/contract_variable_quantity/models/contract.py:81
#, python-format
msgid ""
"Error evaluating code.\n"
Expand All @@ -102,6 +104,7 @@ msgid "Example of Python code"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Fixed quantity"
msgstr ""
Expand All @@ -122,6 +125,12 @@ msgstr ""
msgid "ID"
msgstr "المعرف"

#. module: contract_variable_quantity
#: model:ir.model.fields,help:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,help:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "If checked, contract lines with 0 qty don't create invoice line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula___last_update
msgid "Last Modified on"
Expand All @@ -144,22 +153,31 @@ msgid "Name"
msgstr "الاسم"

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:66
#: code:addons/contract_variable_quantity/models/contract.py:83
#, python-format
msgid "No valid result returned."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_formula_id
msgid "Qty. formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_type
msgid "Qty. type"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,field_description:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "Skip Zero Qty Lines"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Variable quantity"
msgstr ""
Expand Down
27 changes: 22 additions & 5 deletions contract_variable_quantity/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_quantity
#
#
# Translators:
# OCA Transbot <[email protected]>, 2016
# Kaloyan Naumov <[email protected]>, 2016
Expand All @@ -13,17 +13,18 @@ msgstr ""
"PO-Revision-Date: 2016-09-17 09:01+0000\n"
"Last-Translator: Kaloyan Naumov <[email protected]>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_variable_quantity
#: model:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<code>\n"
" result = env['product.product'].search_count([('sale_ok', '=', True)])\n"
" result = env['product.product']."
"search_count([('sale_ok', '=', True)])\n"
" </code>"
msgstr ""

Expand Down Expand Up @@ -90,7 +91,7 @@ msgid "Display Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:64
#: code:addons/contract_variable_quantity/models/contract.py:81
#, python-format
msgid ""
"Error evaluating code.\n"
Expand All @@ -103,6 +104,7 @@ msgid "Example of Python code"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Fixed quantity"
msgstr ""
Expand All @@ -123,6 +125,12 @@ msgstr ""
msgid "ID"
msgstr "ID"

#. module: contract_variable_quantity
#: model:ir.model.fields,help:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,help:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "If checked, contract lines with 0 qty don't create invoice line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula___last_update
msgid "Last Modified on"
Expand All @@ -145,22 +153,31 @@ msgid "Name"
msgstr "Име"

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:66
#: code:addons/contract_variable_quantity/models/contract.py:83
#, python-format
msgid "No valid result returned."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_formula_id
msgid "Qty. formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_type
msgid "Qty. type"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,field_description:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "Skip Zero Qty Lines"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Variable quantity"
msgstr ""
Expand Down
30 changes: 24 additions & 6 deletions contract_variable_quantity/i18n/bs.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_quantity
#
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
Expand All @@ -12,17 +12,19 @@ msgstr ""
"PO-Revision-Date: 2016-09-11 02:47+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Bosnian (https://www.transifex.com/oca/teams/23907/bs/)\n"
"Language: bs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bs\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#. module: contract_variable_quantity
#: model:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<code>\n"
" result = env['product.product'].search_count([('sale_ok', '=', True)])\n"
" result = env['product.product']."
"search_count([('sale_ok', '=', True)])\n"
" </code>"
msgstr ""

Expand Down Expand Up @@ -89,7 +91,7 @@ msgid "Display Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:64
#: code:addons/contract_variable_quantity/models/contract.py:81
#, python-format
msgid ""
"Error evaluating code.\n"
Expand All @@ -102,6 +104,7 @@ msgid "Example of Python code"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Fixed quantity"
msgstr ""
Expand All @@ -122,6 +125,12 @@ msgstr ""
msgid "ID"
msgstr "ID"

#. module: contract_variable_quantity
#: model:ir.model.fields,help:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,help:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "If checked, contract lines with 0 qty don't create invoice line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula___last_update
msgid "Last Modified on"
Expand All @@ -144,22 +153,31 @@ msgid "Name"
msgstr "Naziv"

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract.py:66
#: code:addons/contract_variable_quantity/models/contract.py:83
#, python-format
msgid "No valid result returned."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_formula_id
msgid "Qty. formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_contract_line_qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_invoice_line_qty_type
msgid "Qty. type"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_account_analytic_account_skip_zero_qty
#: model:ir.model.fields,field_description:contract_variable_quantity.field_project_project_skip_zero_qty
msgid "Skip Zero Qty Lines"
msgstr ""

#. module: contract_variable_quantity
#: selection:account.analytic.contract.line,qty_type:0
#: selection:account.analytic.invoice.line,qty_type:0
msgid "Variable quantity"
msgstr ""
Expand Down
Loading

0 comments on commit a793ca5

Please sign in to comment.