Skip to content

Commit

Permalink
alterei a origem da conta bancária para puxar direto do cadastro do f…
Browse files Browse the repository at this point in the history
…uncionário relacionado
  • Loading branch information
Mackilem committed Jun 7, 2019
1 parent 42faad3 commit 1edcefc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions br_payment_cnab_expense/models/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ def get_order_line(self):
def _onchange_payment_mode_id(self):
self.payment_type = self.payment_mode_id.payment_type

@api.onchange('address_id')
@api.onchange('employee_id')
def _onchange_payment_cnab_employee_id(self):
bnk_account_id = self.env['res.partner.bank'].search(
[('partner_id', '=', self.address_id.id)], limit=1)
self.bank_account_id = bnk_account_id.id
if self.employee_id:
self.bank_account_id = self.employee_id.bank_account_id.id

def _prepare_payment_order_vals(self):
address_account_id = self.address_id.property_account_payable_id
Expand Down

0 comments on commit 1edcefc

Please sign in to comment.