'currency_id': _get_currency,
}
- def write(self, cr, uid, ids, vals, context=None):
- if vals.get('employee_id'):
- employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context)
- if employee_id.parent_id and employee_id.parent_id.user_id:
- vals['message_follower_ids'] = [(4, employee_id.parent_id.user_id.partner_id.id)]
- return super(hr_expense_expense, self).write(cr, uid, ids, vals, context=context)
-
def onchange_currency_id(self, cr, uid, ids, currency_id=False, company_id=False, context=None):
res = {'value': {'journal_id': False}}
journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase'), ('currency','=',currency_id), ('company_id', '=', company_id)], context=context)
class product_product(osv.osv):
_inherit = "product.product"
_columns = {
- 'hr_expense_ok': fields.boolean('Can Constitute an Expense', help="Determines if the product can be visible in the list of product within a selection from an HR expense sheet line."),
+ 'hr_expense_ok': fields.boolean('Can Constitute an Expense', help="Specify if the product can be selected in a HR expense line."),
}
def on_change_hr_expense_ok(self, cr, uid, id, hr_expense_ok):
data_obj = self.pool.get('ir.model.data')
cat_id = data_obj._get_id(cr, uid, 'hr_expense', 'cat_expense')
categ_id = data_obj.browse(cr, uid, cat_id).res_id
- res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }}
+ res = {'value' : {'type':'service','sale_ok' :False,'categ_id':categ_id }}
return res
product_product()