[MERGE][IMP] account/account_voucher: new filters and usability minor fixes

bzr revid: rim@openerp.com-20140428101311-quxvr6d3lfa842tl
This commit is contained in:
Richard Mathot (OpenERP) 2014-04-28 12:13:11 +02:00
commit 9f35c683e5
4 changed files with 16 additions and 2 deletions

View File

@ -384,6 +384,7 @@
<group expand="0" string="Group By...">
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_symbol-selection"/>
<filter string="Company" context="{'group_by':'company_id'}" icon="terp-go-home" groups="base.group_multi_company"/>
</group>
</search>
</field>
@ -881,6 +882,7 @@
<field name="price_include"/>
<field name="description"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="type_tax_use" invisible="1"/>
</tree>
</field>
</record>
@ -891,6 +893,12 @@
<search string="Search Taxes">
<field name="name" filter_domain="['|', ('name','ilike',self), ('description','ilike',self)]" string="Tax"/>
<field name="company_id" groups="base.group_multi_company"/>
<filter string="Sale" domain="[('type_tax_use','=','sale')]" />
<filter string="Purchase" domain="[('type_tax_use','=','purchase')]" />
<group string="Group By...">
<filter string="Company" domain="[]" context="{'group_by':'company_id'}"/>
<filter string="Tax Application" domain="[]" context="{'group_by':'type_tax_use'}"/>
</group>
</search>
</field>
</record>

View File

@ -259,6 +259,12 @@ class account_config_settings(osv.osv_memory):
def onchange_tax_rate(self, cr, uid, ids, rate, context=None):
return {'value': {'purchase_tax_rate': rate or False}}
def onchange_multi_currency(self, cr, uid, ids, group_multi_currency, context=None):
res = {}
if not group_multi_currency:
res['value'] = {'income_currency_exchange_account_id': False, 'expense_currency_exchange_account_id': False}
return res
def onchange_start_date(self, cr, uid, id, start_date):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")

View File

@ -122,7 +122,7 @@
<label for="id" string="Features"/>
<div>
<div name="group_multi_currency">
<field name="group_multi_currency" class="oe_inline"/>
<field name="group_multi_currency" class="oe_inline" on_change="onchange_multi_currency(group_multi_currency)"/>
<label for="group_multi_currency"/>
</div>
<div>

View File

@ -189,7 +189,7 @@ class account_voucher(osv.osv):
if not ids:
return []
if context is None: context = {}
return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
return [(r['id'], (r['number'] or _('Voucher'))) for r in self.read(cr, uid, ids, ['number'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')