[IMP] account_chart_update: Fix calculated field when showing inactives + add field to view

This commit is contained in:
Pedro M. Baeza
2015-03-28 14:56:47 +01:00
parent 9c49cee9d8
commit e0d785c619
5 changed files with 37 additions and 16 deletions

View File

@@ -70,6 +70,7 @@ Any problem found while updating will be shown on the last step.
"demo": [],
"data": [
'wizard/wizard_chart_update_view.xml',
'views/account_tax_code_view.xml',
],
"active": False,
'installable': True

View File

@@ -749,3 +749,8 @@ msgstr ""
msgid "Tax code template"
msgstr ""
#. module: account_chart_update
#: field:account.tax.code,active:0
msgid "Active"
msgstr ""

View File

@@ -762,20 +762,8 @@ msgstr ""
msgid "Tax code template"
msgstr "Plantilla de código de impuesto"
#~ msgid "Fiscal position"
#~ msgstr "Posición fiscal"
#. module: account_chart_update
#: field:account.tax.code,active:0
msgid "Active"
msgstr "Activo"
#~ msgid "Account"
#~ msgstr "Cuenta"
#~ msgid "Tax"
#~ msgstr "Impuesto"
#~ msgid "Tax code"
#~ msgstr "Código de impuesto"
#, python-format
#~ msgid "Tax mapping not found on the fiscal position instance: %s -> None.\n"
#~ msgstr ""
#~ "Mapeo de cuentas no encontrado en la instancia de posición fiscal: %s -> "
#~ "Ninguno.\n"

View File

@@ -25,3 +25,13 @@ class AccountTaxCode(models.Model):
_inherit = 'account.tax.code'
active = fields.Boolean('Active', default=True)
def _sum(self, cr, uid, ids, name, args, context, where='',
where_params=()):
try:
return super(AccountTaxCode, self)._sum(
cr, uid, ids, name, args, context, where=where,
where_params=where_params)
except:
cr.rollback()
return dict.fromkeys(ids, 0.0)

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_tax_code_form_active" model="ir.ui.view">
<field name="name">account.tax.code.form.active</field>
<field name="model">account.tax.code</field>
<field name="inherit_id" ref="account.view_tax_code_form"/>
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="active"/>
</field>
</field>
</record>
</data>
</openerp>