Browse Source

[IMP] - Adapt contract_variable_quantity to contract new views

pull/238/head
sbejaoui 6 years ago
parent
commit
087ee2f681
  1. 1
      contract_variable_quantity/__manifest__.py
  2. 26
      contract_variable_quantity/views/contract_line_view.xml
  3. 13
      contract_variable_quantity/views/contract_view.xml

1
contract_variable_quantity/__manifest__.py

@ -17,6 +17,7 @@
'security/ir.model.access.csv',
'views/abstract_contract_view.xml',
'views/contract_line_formula.xml',
'views/contract_line_view.xml',
'views/contract_template_view.xml',
'views/contract_view.xml',
],

26
contract_variable_quantity/views/contract_line_view.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_analytic_invoice_line_view_tree"
model="ir.ui.view">
<field name="name">account.analytic.invoice.line.tree (in contract_variable_quantity)</field>
<field name="model">account.analytic.invoice.line</field>
<field name="inherit_id"
ref="contract.account_analytic_invoice_line_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='quantity']" position="before">
<field name="qty_type"/>
</xpath>
<xpath expr="//field[@name='quantity']" position="after">
<field name="qty_formula_id"
attrs="{'required': [('qty_type', '=', 'variable')], 'invisible': [('qty_type', '!=', 'variable')]}"
/>
</xpath>
<xpath expr="//field[@name='quantity']" position="attributes">
<attribute name="attrs">{'required': [('qty_type', '=', 'fixed')], 'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
</xpath>
</field>
</record>
</odoo>

13
contract_variable_quantity/views/contract_view.xml

@ -5,19 +5,8 @@
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="contract.account_analytic_account_recurring_form_form"/>
<field name="arch" type="xml">
<field name="recurring_next_date" position="after">
<xpath expr="//field[@name='code']" position="after">
<field name="skip_zero_qty"/>
</field>
<xpath expr="//field[@name='recurring_invoice_line_ids']//field[@name='quantity']" position="before">
<field name="qty_type"/>
</xpath>
<xpath expr="//field[@name='recurring_invoice_line_ids']//field[@name='quantity']" position="after">
<field name="qty_formula_id"
attrs="{'required': [('qty_type', '=', 'variable')], 'invisible': [('qty_type', '!=', 'variable')]}"
/>
</xpath>
<xpath expr="//field[@name='recurring_invoice_line_ids']//field[@name='quantity']" position="attributes">
<attribute name="attrs">{'required': [('qty_type', '=', 'fixed')], 'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
</xpath>
</field>
</record>

Loading…
Cancel
Save