Skip to content

Commit

Permalink
Merge pull request odoo-brazil#16 from kmee/kmee/financial
Browse files Browse the repository at this point in the history
Kmee/financial
  • Loading branch information
Wagner Pereira authored Jul 25, 2017
2 parents cefbdc7 + 1616a0e commit edc8426
Show file tree
Hide file tree
Showing 81 changed files with 6,884 additions and 52 deletions.
14 changes: 10 additions & 4 deletions l10n_br_account_banking_payment_cnab/febraban/cnab_240/cnab_240.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def _prepare_header(self):
# 09.0
'cedente_agencia_dv': self.order.mode.bank_id.bra_number_dig,
# 10.0
'cedente_conta': int(self.order.mode.bank_id.acc_number),
'cedente_conta':
int(punctuation_rm(self.order.mode.bank_id.acc_number)),
# 11.0
'cedente_conta_dv': self.order.mode.bank_id.acc_number_dig[0],
# 12.0
Expand All @@ -123,7 +124,9 @@ def _prepare_header(self):
if len(self.order.mode.bank_id.acc_number_dig) > 1 else '',
# 13.0
'cedente_nome':
self.order.mode.bank_id.partner_id.legal_name[:30],
self.order.mode.bank_id.partner_id.legal_name[:30]
if self.order.mode.bank_id.partner_id.legal_name
else self.order.mode.bank_id.partner_id.name[:30],
# 14.0
'nome_banco': self.order.mode.bank_id.bank_name,
# 15.0
Expand Down Expand Up @@ -195,7 +198,8 @@ def _prepare_header_lote(self):
# 13.1
'cedente_agencia_dv': self.order.mode.bank_id.bra_number_dig,
# 14.1
'cedente_conta': int(self.order.mode.bank_id.acc_number),
'cedente_conta':
int(punctuation_rm(self.order.mode.bank_id.acc_number)),
# 15.1
'cedente_conta_dv': self.order.mode.bank_id.acc_number_dig[0],
# 16.1
Expand All @@ -204,7 +208,9 @@ def _prepare_header_lote(self):
if len(self.order.mode.bank_id.acc_number_dig) > 1 else '',
# 17.1
'cedente_nome':
self.order.mode.bank_id.partner_id.legal_name[:30],
self.order.mode.bank_id.partner_id.legal_name[:30]
if self.order.mode.bank_id.partner_id.legal_name
else self.order.mode.bank_id.partner_id.name[:30],
# 18.1
'mensagem1': '',

Expand Down
2 changes: 1 addition & 1 deletion l10n_br_account_banking_payment_cnab/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
from . import res_partner
from .. import constantes
from . import payment_line
from . import bank_payment_line
# from . import bank_payment_line
from . import l10n_br_cnab
32 changes: 20 additions & 12 deletions l10n_br_account_banking_payment_cnab/model/bank_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
from ..constantes import COMPLEMENTO_TIPO_SERVICO, CODIGO_FINALIDADE_TED, \
AVISO_FAVORECIDO

STATE = [
('draft', 'Draft'),
('wait', 'Waiting Paiment'),
('exception', 'Exception'),
('paid', 'Paid'),
]


class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
Expand Down Expand Up @@ -82,11 +75,6 @@ def default_get(self, fields_list):
help=u'Campo G048 do CNAB',
default=0.00
)
state2 = fields.Selection(
string="State",
selection=STATE,
default="draft",
)
evento_id = fields.One2many(
string="Eventos CNAB",
comodel_name="l10n.br.cnab.evento",
Expand All @@ -98,3 +86,23 @@ def default_get(self, fields_list):
string=u'Código de finalidade complementar',
help=u'Campo P013 do CNAB',
)

@api.model
def same_fields_payment_line_and_bank_payment_line(self):
"""
This list of fields is used both to compute the grouping
hashcode and to copy the values from payment line
to bank payment line
The fields must have the same name on the 2 objects
"""
same_fields = super(
BankPaymentLine, self
).same_fields_payment_line_and_bank_payment_line()

# TODO: Implementar campo brasileiros que permitem mesclar linhas

# same_fields = [
# 'currency', 'partner_id',
# 'bank_id', 'date', 'state']

return same_fields
12 changes: 0 additions & 12 deletions l10n_br_account_banking_payment_cnab/model/payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
from ..constantes import COMPLEMENTO_TIPO_SERVICO, CODIGO_FINALIDADE_TED, \
AVISO_FAVORECIDO

STATE = [
('draft', 'Draft'),
('wait', 'Waiting Paiment'),
('exception', 'Exception'),
('paid', 'Paid'),
]


class PaymentLine(models.Model):
_inherit = 'payment.line'
Expand Down Expand Up @@ -87,8 +80,3 @@ def default_get(self, fields_list):
help=u'Campo G048 do CNAB',
default=0.00
)
state2 = fields.Selection(
related="bank_line_id.state2",
selection=STATE,
default="draft",
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
<field name="model">bank.payment.line</field>
<field name="inherit_id" ref="account_banking_payment_export.bank_payment_line_form"/>
<field name="arch" type="xml">
<group name="main" position="before">
<header>
<field name="state2" widget="statusbar" nolabel="1" statusbar_visible="draft,wait,paid" clickable="True"/>
</header>
</group>
<group name="main" position="after">
<group>
<field name="codigo_finalidade_doc"/>
Expand Down
12 changes: 0 additions & 12 deletions l10n_br_account_banking_payment_cnab/view/payment_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,5 @@
</field>
</record>

<record id="view_payment_line_form" model="ir.ui.view">
<field name="name">payment.line.form</field>
<field name="model">payment.line</field>
<field name="inherit_id" ref="account_payment.view_payment_line_form" />
<field name="arch" type="xml">
<xpath expr="//notebook" position="before">
<header>
<field name="state2" widget="statusbar" nolabel="1" statusbar_visible="draft,wait,paid" />
</header>
</xpath>
</field>
</record>
</data>
</openerp>
19 changes: 13 additions & 6 deletions l10n_br_account_payment_boleto/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ class ResCompany(models.Model):
_inherit = 'res.company'

own_number_type = fields.Selection(
[('0', u'Sequêncial único por empresa'),
('1', u'Numero sequêncial da Fatura'),
('2', u'Sequêncial único por modo de pagamento'), ],
string=u'Tipo de nosso número', default='2')
own_number_sequence = fields.Many2one('ir.sequence',
string=u'Sequência do Nosso Número')
selection=[
('0', u'Sequêncial único por empresa'),
('1', u'Numero sequêncial da Fatura'),
('2', u'Sequêncial único por modo de pagamento'), ],
string=u'Tipo de nosso número',
default='2'
)

own_number_sequence = fields.Many2one(
comodel_name='ir.sequence',
string=u'Sequência do Nosso Número'
)

transaction_id_sequence = fields.Many2one('ir.sequence',
string=u'Sequência da fatura')
79 changes: 79 additions & 0 deletions l10n_br_financial_payment_order/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===============================
L10n Br Financial Payment Order
===============================

Integracao entre o modulo financeiro e a ordem de pagamento

Installation
============

To install this module, you need to:

#. Do this ...

Configuration
=============

To configure this module, you need to:

#. Go to ...

Usage
=====

To use this module, you need to:

#. Go to ...

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}

.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example
Known issues / Roadmap
======================

* ...

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Firstname Lastname <[email protected]>
* Second Person <[email protected]>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
3 changes: 3 additions & 0 deletions l10n_br_financial_payment_order/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizards
from . import reports
62 changes: 62 additions & 0 deletions l10n_br_financial_payment_order/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'L10n Br Financial Payment Order',
'summary': """
Integracao entre o modulo financeiro e a ordem de pagamento""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'KMEE,Odoo Community Association (OCA)',
'website': 'www.kmee.com.br',
'external_dependencies': {
'python': [
'pyboleto',
],
},
'depends': [
'account_banking_payment_export',
'l10n_br_account_product',
'financial',
],
'data': [
'wizards/ordem_pagamento_holerite_wizard.xml',
'wizards/l10n_br_payment_cnab.xml',
'views/payment_menu.xml',
'views/bank_payment_line.xml',
'views/financial_move.xml',

'views/inherited_financial_document_type_view.xml',
'views/inherited_financial_move_debt_2pay_view.xml',

'views/payment_mode/payment_mode_base_view.xml',
'views/payment_mode/payment_mode_pagamento_view.xml',
'views/payment_mode/payment_mode_cobranca_view.xml',

'views/payment_order/payment_order_base_view.xml',
'views/payment_order/payment_order_cobranca_view.xml',
'views/payment_order/payment_order_pagamento_view.xml',

'views/financial_retorno_bancario.xml',
'views/financial_move.xml',
'workflows/payment_order_workflow.xml',
'reports/report_boleto.xml',
# 'security/payment_mode.xml',
# 'security/payment_mode_type.xml',
# 'security/bank_payment_line.xml',
# 'security/payment_line.xml',
# 'security/payment_order.xml',

# 'views/payment_mode.xml',
# 'views/payment_mode_type.xml',
# 'views/bank_payment_line.xml',
# 'views/payment_line.xml',
],
'demo': [
# 'demo/payment_mode.xml',
# 'demo/payment_mode_type.xml',
# 'demo/bank_payment_line.xml',
# 'demo/payment_order.xml',
],
}
Loading

0 comments on commit edc8426

Please sign in to comment.