Skip to content

Commit

Permalink
[MIG] contract_show_invoice: Migration to v10 (OCA#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkwelltwd authored and lk-eska committed Feb 17, 2018
1 parent 5436290 commit 58b5952
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 42 deletions.
1 change: 1 addition & 0 deletions contract_show_invoice/README.rst
Expand Up @@ -41,6 +41,7 @@ Contributors

* Ángel Moya <angel.moya@domatix.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>
* Dave Burkholder <dave@thinkwelldesigns.com>


Maintainer
Expand Down
4 changes: 2 additions & 2 deletions contract_show_invoice/__manifest__.py
Expand Up @@ -6,7 +6,7 @@
{
'name': 'Contract Show Invoice',
'summary': 'Button in contracts to show their invoices',
'version': '9.0.1.1.0',
'version': '10.0.1.0.0',
'author': 'Domatix,'
'Tecnativa,'
'Odoo Community Association (OCA)',
Expand All @@ -16,5 +16,5 @@
'data': [
'views/contract_view.xml',
],
'installable': False,
'installable': True,
}
2 changes: 1 addition & 1 deletion contract_show_invoice/models/invoice.py
Expand Up @@ -3,7 +3,7 @@
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import api, fields, models
from odoo import api, fields, models


class AccountInvoice(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion contract_show_invoice/test/test_contract_show_invoice.py
Expand Up @@ -2,7 +2,7 @@
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase


class TestContractShowInvoice(TransactionCase):
Expand Down
74 changes: 36 additions & 38 deletions contract_show_invoice/views/contract_view.xml
@@ -1,44 +1,42 @@
<?xml version="1.0"?>
<openerp>
<data>
<odoo>

<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="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_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"/>
</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"/>
</record>

<record id="account_analytic_account_button_invoice" model="ir.ui.view">
<field name="name">account.analytic.account.button.invoice
</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form" />
<field name="arch" type="xml">
<xpath expr='//div[@name="button_box"]' position='inside'>
<button class="oe_stat_button" type="action" icon="fa-edit"
name="%(contract_show_invoice.act_analytic_invoices)d"
string="Invoices" help="Invoices related with this contract">
</button>
</xpath>
</field>
</record>
<record id="account_analytic_account_button_invoice" model="ir.ui.view">
<field name="name">account.analytic.account.button.invoice
</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form" />
<field name="arch" type="xml">
<xpath expr='//div[@name="button_box"]' position='inside'>
<button class="oe_stat_button" type="action" icon="fa-edit"
name="%(contract_show_invoice.act_analytic_invoices)d"
string="Invoices" help="Invoices related with this contract">
</button>
</xpath>
</field>
</record>

</data>
</openerp>
</odoo>

0 comments on commit 58b5952

Please sign in to comment.