[IMP] set default value of timesheet invoice ratio
bzr revid: fka@tinyerp.com-20130305065232-s5tjce9dj394yku4
This commit is contained in:
parent
548936166a
commit
ddb5904d6f
|
@ -63,6 +63,13 @@ class account_analytic_account(osv.osv):
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def _get_default_to_invoice(self, cr, uid, context=None):
|
||||||
|
try:
|
||||||
|
invoice_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'hr_timesheet_invoice', 'timesheet_invoice_factor1')[1]
|
||||||
|
except ValueError:
|
||||||
|
invoice_id = False
|
||||||
|
return invoice_id
|
||||||
|
|
||||||
_inherit = "account.analytic.account"
|
_inherit = "account.analytic.account"
|
||||||
_columns = {
|
_columns = {
|
||||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist',
|
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist',
|
||||||
|
@ -76,6 +83,7 @@ class account_analytic_account(osv.osv):
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'pricelist_id': lambda self, cr, uid, ctx: ctx.get('pricelist_id', False),
|
'pricelist_id': lambda self, cr, uid, ctx: ctx.get('pricelist_id', False),
|
||||||
|
'to_invoice': _get_default_to_invoice,
|
||||||
}
|
}
|
||||||
|
|
||||||
def on_change_partner_id(self, cr, uid, ids, partner_id, name, context=None):
|
def on_change_partner_id(self, cr, uid, ids, partner_id, name, context=None):
|
||||||
|
|
Loading…
Reference in New Issue