mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[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.
This commit is contained in:
committed by
Carlos Roca
parent
fa8bc80e53
commit
63cdbd67a9
24
contract_variable_quantity/views/contract_line_views.xml
Normal file
24
contract_variable_quantity/views/contract_line_views.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2019 Tecnativa - Pedro M. Baeza
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record id="contract_line_tree_view" model="ir.ui.view">
|
||||
<field name="name">contract.line tree view (in contract) - Add variable qty fields</field>
|
||||
<field name="model">contract.line</field>
|
||||
<field name="inherit_id" ref="contract.contract_line_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="quantity" position="before">
|
||||
<field name="qty_type"/>
|
||||
<field
|
||||
name="qty_formula_id"
|
||||
attrs="{'invisible': [('qty_type', '!=', 'variable')]}"
|
||||
/>
|
||||
</field>
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user