Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate contract_show_invoice to v10 #54

Merged
merged 6 commits into from Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions contract_show_invoice/__manifest__.py
@@ -1,20 +1,22 @@
# -*- coding: utf-8 -*-
# © 2015 Angel Moya <angel.moya@domatix.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# © 2017 Dave Burkholder <dave@thinkwelldesigns.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'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,'
'Thinkwell Designs,'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authorship and copyright is a bit of an overreach for the work that was performed here. Please limit the attribution to the ReadMe in this instance

Copy link
Contributor

@lasley lasley Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I commented on an outdated diff, so it was collapsed. Commenting on current:

Authorship and copyright is a bit of an overreach for the work that was performed here. Please limit the attribution to the ReadMe in this instance

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. When I put that there, I wasn't aware of the README location; should have read Daniel Reis's comment better. Found it in relation to another module, so I added it there as well. But now will yank it from the manifest file.

'Odoo Community Association (OCA)',
'website': 'http://www.domatix.com',
'depends': ['account', 'analytic'],
'category': 'Sales Management',
'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>