Browse Source

[9.0][FIX] contract_show_invoice: Error if create invoice with view context (#82)

pull/97/head
Carlos Dauden 7 years ago
committed by Pedro M. Baeza
parent
commit
762035390d
  1. 3
      contract_show_invoice/__openerp__.py
  2. 18
      contract_show_invoice/views/account_invoice_view.xml
  3. 23
      contract_show_invoice/views/contract_view.xml

3
contract_show_invoice/__openerp__.py

@ -6,7 +6,7 @@
{
'name': 'Contract Show Invoice',
'summary': 'Button in contracts to show their invoices',
'version': '9.0.1.1.0',
'version': '9.0.1.2.0',
'author': 'Domatix,'
'Tecnativa,'
'Odoo Community Association (OCA)',
@ -14,6 +14,7 @@
'depends': ['account', 'analytic'],
'category': 'Sales Management',
'data': [
'views/account_invoice_view.xml',
'views/contract_view.xml',
],
'installable': True,

18
contract_show_invoice/views/account_invoice_view.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_invoice_filter_contract" model="ir.ui.view">
<field name="name">account.invoice.select.analytic</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<field name="date" position="after">
<separator/>
<field name="analytic_account_ids"/>
</field>
</field>
</record>
</data>
</openerp>

23
contract_show_invoice/views/contract_view.xml

@ -3,26 +3,13 @@
<data>
<record id="act_analytic_invoices" model="ir.actions.act_window">
<field name="context">{'search_default_analytic_account_ids':
[active_id], 'default_analytic_account_ids': active_id}</field>
<field name="name">Invoices</field>
<field name="res_model">account.invoice</field>
<field name="domain">[('analytic_account_ids','=',active_id)]</field>
<field name="search_view_id" ref="account.view_account_invoice_filter" />
</record>
<record id="action_contract_show_invoice_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="account.invoice_tree"/>
<field name="act_window_id" ref="act_analytic_invoices"/>
</record>
<record id="action_contract_show_invoice_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="account.invoice_form"/>
<field name="act_window_id" ref="act_analytic_invoices"/>
<field name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('account.invoice_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('account.invoice_form')})]"/>
<field name="context">{'search_default_analytic_account_ids': [active_id]}</field>
</record>
<record id="account_analytic_account_button_invoice" model="ir.ui.view">

Loading…
Cancel
Save