Skip to content

Commit

Permalink
[10.0][IMP] Add variable qty to contract template view (OCA#66)
Browse files Browse the repository at this point in the history
* [IMP] Add variable qty to contract template view

* Bump minor version
  • Loading branch information
lasley authored and rafaelbn committed Jun 9, 2017
1 parent d633e93 commit c0bc0b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contract_variable_quantity/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
'name': 'Variable quantity in contract recurrent invoicing',
'version': '10.0.1.0.0',
'version': '10.0.1.1.0',
'category': 'Contract Management',
'license': 'AGPL-3',
'author': "Tecnativa,"
Expand Down
19 changes: 19 additions & 0 deletions contract_variable_quantity/views/contract_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="account_analytic_contract_view_form" model="ir.ui.view">
<field name="name">Contract Template Variable Qty</field>
<field name="model">account.analytic.contract</field>
<field name="inherit_id" ref="contract.account_analytic_contract_view_form"/>
<field name="arch" type="xml">
<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>

<record id="account_analytic_account_recurring_form_form" model="ir.ui.view">
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="contract.account_analytic_account_recurring_form_form"/>
Expand Down

0 comments on commit c0bc0b3

Please sign in to comment.