Skip to content

Commit

Permalink
Merge branch '11.0' into 11.0-payment-receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Dec 4, 2018
2 parents bb2eaee + 0b55b10 commit f0a3ea2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 0 additions & 2 deletions br_payment_cnab/bancos/santander.py
Expand Up @@ -80,8 +80,6 @@ def _get_segmento(self, line, lot_sequency, num_lot):
segmento.get('valor_real_pagamento')),
'valor_abatimento': self._string_to_monetary(
segmento.get('valor_abatimento')),
'favorecido_conta_dv': self._string_to_num(
segmento.get('favorecido_conta_dv'), 0),
'favorecido_agencia': self._string_to_num(
segmento.get('favorecido_agencia'), 0),
'favorecido_nome':
Expand Down
13 changes: 11 additions & 2 deletions br_payment_cnab/wizard/payment_cnab_import.py
Expand Up @@ -63,11 +63,20 @@ def do_import(self, cnab_file):
self.journal_id.bank_id.bic,
event.ocorrencias_retorno.strip())
if not payment_line:
nome = ''
if hasattr(event, 'favorecido_nome'):
nome = event.favorecido_nome
elif hasattr(event, 'nome_concessionaria'):
nome = event.nome_concessionaria
elif hasattr(event, 'contribuinte_nome'):
nome = event.contribuinte_nome

self.env['l10n_br.payment.statement.line'].sudo().create({
'date': datetime.strptime(
"{:06}".format(event.data_pagamento), "%d%m%Y"),
'name': "%s - %s" % (event.numero_documento_cliente,
event.favorecido_nome),
'name': "%s - %s" % (
event.numero_documento_cliente,
nome),
'amount': event.valor_pagamento,
'cnab_code': cnab_code,
'cnab_message': message,
Expand Down
3 changes: 2 additions & 1 deletion br_payment_invoice/models/account_invoice.py
Expand Up @@ -9,7 +9,7 @@ class AccountInvoice(models.Model):
_inherit = 'account.invoice'

l10n_br_payment_type = fields.Selection(
related="payment_mode_id.payment_type")
related="payment_mode_id.payment_type", readonly=True)
l10n_br_bank_account_id = fields.Many2one(
'res.partner.bank', string="Conta p/ Transferência",
domain="[('partner_id', '=', partner_id)]", readonly=True,
Expand All @@ -20,6 +20,7 @@ def prepare_payment_line_vals(self, move_line_id):
'partner_id': self.partner_id.id,
'amount_total': abs(move_line_id.amount_residual),
'name': self.number,
'partner_ref': self.reference,
'bank_account_id': self.l10n_br_bank_account_id.id,
'partner_acc_number': self.l10n_br_bank_account_id.acc_number,
'partner_bra_number': self.l10n_br_bank_account_id.bra_number,
Expand Down
1 change: 1 addition & 0 deletions br_payment_invoice/models/payment_order.py
Expand Up @@ -9,3 +9,4 @@ class PaymentOrderLine(models.Model):

invoice_id = fields.Many2one(
'account.invoice', string="Fatura Origem")
partner_ref = fields.Char(string="Ref. Parceiro")
16 changes: 16 additions & 0 deletions br_payment_invoice/views/payment_order.xml
Expand Up @@ -8,7 +8,23 @@
<field name="arch" type="xml" >
<field name="move_line_id" position="after">
<field name="invoice_id" />
<field name="partner_ref" />
</field>
</field>
</record>

<record id="view_br_payment_invoice_order_line_tree" model="ir.ui.view">
<field name="name">view_br_payment_invoice_order_line_tree</field>
<field name="model">payment.order.line</field>
<field name="inherit_id" ref="br_account_payment.trustcode_payment_order_line_tree_view"/>
<field name="type">form</field>
<field name="arch" type="xml" >
<field name="name" position="after">
<field name="partner_ref" />
</field>
</field>
</record>



</odoo>

0 comments on commit f0a3ea2

Please sign in to comment.