Skip to content

Commit

Permalink
Campos analytic_tag_ids adicionados em views de faturamento
Browse files Browse the repository at this point in the history
  • Loading branch information
carcaroff committed Mar 13, 2018
1 parent b025ac7 commit 58d12d5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions br_account/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
<field name="fiscal_classification_id" />
<field domain="[('user_type_id', '&lt;&gt;', 'view')]" name="account_id" groups="account.group_account_user"/>
<field domain="[('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
<field name="invoice_line_tax_ids" invisible="1" />
<field name="tributos_estimados_federais" />
Expand Down
2 changes: 2 additions & 0 deletions br_account_voucher/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Danimar Ribeiro <danimaribeiro@gmail.com>, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
1 change: 1 addition & 0 deletions br_account_voucher/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
],
'data': [
'views/account_voucher.xml',
'views/account_voucher_line.xml',
],
}
1 change: 1 addition & 0 deletions br_account_voucher/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_voucher_line
8 changes: 8 additions & 0 deletions br_account_voucher/models/account_voucher_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import models, fields


class AccountVoucherLine(models.Model):
_inherit = 'account.voucher.line'

analytic_tag_ids = fields.Many2many('account.analytic.tag',
string='Etiquetas analíticas')
6 changes: 6 additions & 0 deletions br_account_voucher/views/account_voucher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<xpath expr="//field[@name='line_ids']/tree/field[@name='account_id']" position="attributes">
<attribute name="domain">[('account_type', '=', 'expense')]</attribute>
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='account_analytic_id']" position="after">
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
</xpath>
</field>
</record>

Expand All @@ -20,6 +23,9 @@
<xpath expr="//field[@name='line_ids']/tree/field[@name='account_id']" position="attributes">
<attribute name="domain">[('account_type', '=', 'income')]</attribute>
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='account_analytic_id']" position="after">
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
</xpath>
</field>
</record>
</odoo>
14 changes: 14 additions & 0 deletions br_account_voucher/views/account_voucher_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<odoo>

<record id="view_br_account_voucher_line" model="ir.ui.view">
<field name="name">view.br_account_voucher.account.voucher.line</field>
<field name="model">account.voucher.line</field>
<field name="inherit_id" ref="account_voucher.view_voucher_line_form"/>
<field name="arch" type="xml">
<field name='account_analytic_id' position="after">
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
</field>
</field>
</record>

</odoo>

0 comments on commit 58d12d5

Please sign in to comment.