[FIX] hr: Bank account from employee not loaded on payment on expense
The bank account didn't appear when selecting SEPA credit transfer in ACCOUNTING>PURCHASE>PAYMENTS to refund an employee. The bank account is taken from partner set with the field home_address_id. So the account holder have to be set on the bank_account_id of the employee with the home_address_id. opw:702881
This commit is contained in:
@@ -198,6 +198,10 @@ class hr_employee(osv.osv):
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
if 'address_home_id' in vals:
|
||||
account_id = vals.get('bank_account_id') or self.bank_account_id.id
|
||||
if account_id:
|
||||
self.env['res.partner.bank'].browse(account_id).partner_id = vals['address_home_id']
|
||||
tools.image_resize_images(vals)
|
||||
return super(hr_employee, self).write(vals)
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<field name="country_id" options='{"no_open": True, "no_create": True}'/>
|
||||
<field name="identification_id" groups="base.group_hr_user"/>
|
||||
<field name="passport_id" groups="base.group_hr_user"/>
|
||||
<field name="bank_account_id"/>
|
||||
<field name="bank_account_id" context="{'default_partner_id': address_home_id}"/>
|
||||
</group>
|
||||
<group string="Contact Information">
|
||||
<field name="address_home_id"
|
||||
|
||||
Reference in New Issue
Block a user