From aac05b9fcf9f553944da1a0c5e3a2097a3b05a0c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 4 Nov 2019 11:07:38 +0100 Subject: [PATCH] [FIX] contract_variable_quantity: Allow to propagate variable qty fields from template **Steps to reproduce the problem** - Define a contract template with one line with variable quantity and formula. - Use that template in a new contract. - Variable quantity type and formula are not transferred from template to contract. This is due to the lack of that fields in the tree view that prevents web client to fetch and store them. We solve it adding those fields to the contract line tree view, also providing some visibility logic for not showing the corresponding fields according the type. No regression tests is provided, as this is only reproducible with web client, not through code. --- contract_variable_quantity/__manifest__.py | 5 ++-- contract_variable_quantity/i18n/pt_BR.po | 8 +++---- .../views/contract_line_views.xml | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 contract_variable_quantity/views/contract_line_views.xml diff --git a/contract_variable_quantity/__manifest__.py b/contract_variable_quantity/__manifest__.py index 5da66f310..885b4a77d 100644 --- a/contract_variable_quantity/__manifest__.py +++ b/contract_variable_quantity/__manifest__.py @@ -1,11 +1,11 @@ -# Copyright 2016-2018 Tecnativa - Pedro M. Baeza +# Copyright 2016-2019 Tecnativa - Pedro M. Baeza # Copyright 2018 Tecnativa - Carlos Dauden # Copyright 2019 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Variable quantity in contract recurrent invoicing', - 'version': '12.0.2.1.0', + 'version': '12.0.2.1.1', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "Tecnativa," @@ -16,6 +16,7 @@ 'security/ir.model.access.csv', 'views/abstract_contract_line.xml', 'views/contract_line_formula.xml', + 'views/contract_line_views.xml', 'views/contract_template.xml', 'views/contract.xml', ], diff --git a/contract_variable_quantity/i18n/pt_BR.po b/contract_variable_quantity/i18n/pt_BR.po index b656d418d..988ba8cef 100644 --- a/contract_variable_quantity/i18n/pt_BR.po +++ b/contract_variable_quantity/i18n/pt_BR.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-30 01:41+0000\n" -"PO-Revision-Date: 2019-10-10 20:36+0000\n" -"Last-Translator: Eder Brito \n" +"PO-Revision-Date: 2019-12-16 15:05+0000\n" +"Last-Translator: Augusto D. LisbĂ´a \n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" "23907/pt_BR/)\n" "Language: pt_BR\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.8\n" +"X-Generator: Weblate 3.9.1\n" #. module: contract_variable_quantity #: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form @@ -35,7 +35,7 @@ msgstr "" " " "env['product.product'].search_count([('sale_ok',\n" " '=', True)])\n" -" " +"" #. module: contract_variable_quantity #: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form diff --git a/contract_variable_quantity/views/contract_line_views.xml b/contract_variable_quantity/views/contract_line_views.xml new file mode 100644 index 000000000..f74106298 --- /dev/null +++ b/contract_variable_quantity/views/contract_line_views.xml @@ -0,0 +1,24 @@ + + + + + + contract.line tree view (in contract) - Add variable qty fields + contract.line + + + + + + + + {'invisible': [('qty_type', '!=', 'fixed')]} + + + + +