Skip to content

Commit

Permalink
Merge branch 'kmee-oca/internal-number-in-tree-view' into 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonlima committed Jul 26, 2016
2 parents d19b506 + 2710497 commit 403e092
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions l10n_br_account/models/account_invoice.py
Expand Up @@ -43,6 +43,7 @@

class AccountInvoice(models.Model):
_inherit = 'account.invoice'
_order = 'date_invoice DESC, internal_number DESC'

@api.one
@api.depends(
Expand Down Expand Up @@ -123,8 +124,6 @@ def _default_fiscal_document_serie(self):
related='partner_id.inscr_est',
)

_order = 'internal_number desc'

@api.one
@api.constrains('number')
def _check_invoice_number(self):
Expand Down
16 changes: 16 additions & 0 deletions l10n_br_account/views/account_invoice_view.xml
Expand Up @@ -14,6 +14,22 @@
</field>
</field>
</record>

<record model="ir.ui.view" id="view_l10n_br_account_account_invoice_tree">
<field name="name">l10n_br_account.account.invoice.tree</field>
<field name="model">account.invoice</field>
<field name="priority">32</field>
<field name="inherit_id" ref="account.invoice_tree"/>
<field name="arch" type="xml">
<field name="number" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="number" position="after">
<field name="internal_number" />
</field>
</field>
</record>

<!-- Customer Invoice views -->
<record id="view_l10n_br_account_invoice_form" model="ir.ui.view">
<field name="name">l10n_br_account.invoice.form</field>
Expand Down
1 change: 1 addition & 0 deletions l10n_br_account_product/models/account_invoice.py
Expand Up @@ -37,6 +37,7 @@

class AccountInvoice(models.Model):
_inherit = 'account.invoice'
_order = 'date_hour_invoice DESC, internal_number DESC'

@api.one
@api.depends('invoice_line', 'tax_line.amount')
Expand Down

0 comments on commit 403e092

Please sign in to comment.