Skip to content

Commit

Permalink
[11.0][FEAT]Adicionado filtros para contas (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
carcaroff authored and danimaribeiro committed Mar 22, 2018
1 parent af12809 commit 192563c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions br_product/__manifest__.py
Expand Up @@ -20,5 +20,7 @@
],
'data': [
'views/product_pricelist.xml',
'views/product_category.xml',
'views/product_template.xml',
],
}
24 changes: 24 additions & 0 deletions br_product/views/product_category.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_br_product_category_form" model="ir.ui.view">
<field name="name">view.br_product.category.form</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="account.view_category_property_form"/>
<field name="arch" type="xml">
<field name="property_account_income_categ_id" position="attributes">
<!-- Esse carinha apenas adiciona o filtro do
'account_type' nos fields da categoria -->
<attribute name="domain">[('account_type', '=', 'income'),
('internal_type','=','other'),
('deprecated', '=', False)]</attribute>
</field>
<field name="property_account_expense_categ_id" position="attributes">
<attribute name="domain">[('account_type', '=', 'expense'),
('internal_type','=','other'),
('deprecated', '=', False)]</attribute>
</field>
</field>
</record>
</data>
</odoo>
23 changes: 23 additions & 0 deletions br_product/views/product_template.xml
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_br_product_template_form" model="ir.ui.view">
<field name="name">view.br_product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<!-- Similar ao outro arquivo XML, ele apenas adiciona
o filtro do account_type aos fields do produto -->
<field name="property_account_income_id" position="attributes">
<attribute name="domain">[('account_type', '=', 'income'),
('internal_type','=','other'),
('deprecated', '=', False)]</attribute>
</field>
<field name="property_account_expense_id" position="attributes">
<attribute name="domain">[('account_type', '=', 'expense'),
('deprecated', '=', False)]</attribute>
</field>
</field>
</record>
</data>
</odoo>

0 comments on commit 192563c

Please sign in to comment.