Skip to content

Commit

Permalink
Merge f83eba7 into 0371ab3
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Jul 19, 2019
2 parents 0371ab3 + f83eba7 commit 1fe1dc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion br_payment_invoice/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def prepare_payment_line_vals(self, move_line_id):
'date_maturity': move_line_id.date_maturity,
'invoice_date': move_line_id.date,
'invoice_id': self.id,
'linha_digitavel': self.l10n_br_linha_digitavel,
'barcode': self.l10n_br_barcode,
}

def get_order_line(self):
Expand All @@ -87,7 +89,11 @@ def check_create_payment_line(self):
if self.payment_mode_id.type != 'payable':
return
if self.l10n_br_payment_type in ('03'): # Boletos
return
if len(self.payable_move_line_ids) > 1 and self.l10n_br_barcode:
raise UserError(
'A fatura possui mais de uma parcela, preencha a \
linha digitável diretamente nos vencimentos após \
a validação')
elif self.l10n_br_payment_type in ('01', '02'): # Depósitos
if not self.l10n_br_bank_account_id:
raise UserError(
Expand Down

0 comments on commit 1fe1dc6

Please sign in to comment.