Skip to content

Commit

Permalink
Merge branch 'develop' into feature/l10n_br_financial
Browse files Browse the repository at this point in the history
  • Loading branch information
mileo committed Mar 29, 2017
2 parents 28af08a + 197ce66 commit 851b973
Show file tree
Hide file tree
Showing 181 changed files with 518,227 additions and 10 deletions.
28 changes: 18 additions & 10 deletions l10n_br_account_payment/l10n_br_account_payment.py
Expand Up @@ -29,32 +29,40 @@ def _payment_mode_search(self, cr, uid, obj, name, args, context):
elif isinstance(value, list):
ids = value
else:
ids = self.pool.get('payment.mode').search(cr,uid,[('id','=',value)], context=context)
ids = self.pool.get('payment.mode')\
.search(cr, uid, [('id', '=', value)], context=context)
if ids:
cr.execute('SELECT l.move_line_id ' \
'FROM payment_line l ' \
cr.execute(
'SELECT l.move_line_id '
'FROM payment_line l '
'WHERE l.related_mode_id in (%s)' % (','.join(map(str, ids))))
res = cr.fetchall()
if len(res):
return [('id', 'in', [x[0] for x in res])]
return [('id','=','0')]
return [('id', '=', '0')]

def _payment_mode_get(self, cr, uid, ids, field_name, arg, context={}):
result = {}
line_obj = self.pool.get('payment.line')
for rec in self.browse(cr, uid, ids, context):
result[rec.id] = (0,0)
payment_line_id = line_obj.search(cr, uid, [('move_line_id', '=', rec.id)], context=context)
result[rec.id] = (0, 0)
payment_line_id = line_obj\
.search(cr, uid, [('move_line_id', '=', rec.id)],
context=context)
if payment_line_id:
line = line_obj.browse(cr, uid, payment_line_id[0], context)
if line.related_mode_id:
result[rec.id] = (line.related_mode_id.id, self.pool.get('payment.mode').browse(cr, uid, line.related_mode_id.id, context).name)
result[rec.id] = (
line.related_mode_id.id,
self.pool.get('payment.mode').browse(
cr, uid, line.related_mode_id.id, context).name)
else:
result[rec.id] = (0, 0)
return result

_columns = {
'related_mode_id': fields.function(_payment_mode_get, method=True,
fnct_search=_payment_mode_search, type="many2one",
relation="payment.mode", string="Payment Mode", readonly=True),
'related_mode_id': fields.function(
_payment_mode_get, method=True,
fnct_search=_payment_mode_search, type="many2one",
relation="payment.mode", string="Payment Mode", readonly=True),
}
86 changes: 86 additions & 0 deletions sped/README.rst
@@ -0,0 +1,86 @@
.. 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


SPED
====

This module extends the functionality of ... to support ...
and to allow you to ...

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

To install this module, you need to:

#. Do this ...

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

To configure this module, you need to:

#. Go to ...

.. figure:: path/to/local/image.png
:alt: alternative description
:width: 600 px

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
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
------------

* Aristides Caldeira <aristides.caldeira@tauga.com.br>

Funders
-------

The development of this module has been financially supported by:

* Taŭga Tecnologia

Maintainer
----------

.. image:: http://tauga.com.br/logo.png
:alt: Taŭga Tecnologia Ltda.
:target: http://tauga.com.br

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.

8 changes: 8 additions & 0 deletions sped/__init__.py
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#

from . import models
132 changes: 132 additions & 0 deletions sped/__manifest__.py
@@ -0,0 +1,132 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#

{
'name': u'SPED',
'version': '10.0.1.0.0',
'author': u'Odoo Community Association (OCA), Ari Caldeira',
'category': u'Base',
'license': 'AGPL-3',
'depends': [
'base',
'document',
'mail',
'decimal_precision',
'product',
],
'installable': True,
'application': True,
'data': [
#
# Valores padrão
#
'data/inherited_res_currency_data.xml',
'data/inherited_decimal_precision_data.xml',
'data/inherited_product_uom_category_data.xml',
# 'data/inherited_product_uom_data.xml',
'data/sped_pais_data.xml',
'data/sped_estado_data.xml',
'data/sped_municipio_data.xml',
'data/sped_municipio_exterior_data.xml',

'data/sped_aliquota_icms_proprio_data.xml',
'data/sped_aliquota_icms_st_data.xml',
'data/sped_aliquota_ipi_data.xml',
'data/sped_aliquota_pis_cofins_data.xml',
'data/sped_aliquota_simples_anexo_data.xml',
'data/sped_aliquota_simples_teto_data.xml',
'data/sped_aliquota_simples_aliquota_data.xml',

'data/sped_unidade_data.xml',
'data/sped_ncm_data.xml',
'data/sped_cest_data.xml',
'data/sped_cnae_data.xml',
'data/sped_cfop_data.xml',
'data/sped_cfop_equivalente_data.xml',
'data/sped_servico_data.xml',

#
# Menus principais
#
'views/cadastro_view.xml',
'views/sped_view.xml',

#
# Tabelas principais
#
'views/sped_protocolo_icms_proprio_view.xml',
'views/sped_aliquota_icms_proprio_view.xml',
'views/sped_protocolo_icms_st_view.xml',
'views/sped_aliquota_icms_st_view.xml',
'views/sped_aliquota_ipi_view.xml',
'views/sped_aliquota_pis_cofins_view.xml',
'views/sped_aliquota_simples_view.xml',

'views/sped_cfop_view.xml',
'views/sped_cest_view.xml',
'views/sped_nbs_view.xml',
'views/sped_ncm_view.xml',
'views/sped_servico_view.xml',
'views/sped_ibptax_view.xml',
'views/sped_cnae_view.xml',

'views/sped_pais_view.xml',
'views/sped_estado_view.xml',
'views/sped_municipio_view.xml',

#
# Módulo Cadastro: participantes, produtos etc.
#
'views/sped_empresa_view.xml',
'views/sped_empresa_vincula_company_view.xml',

'views/sped_participante_cliente_view.xml',
'views/sped_participante_fornecedor_view.xml',
'views/sped_participante_vincula_partner_view.xml',

'views/sped_produto_produto_view.xml',
'views/sped_unidade_produto_view.xml',

'views/sped_produto_servico_view.xml',
'views/sped_unidade_servico_view.xml',

#
# Parcelamentos e pagamentos
#
'views/sped_account_payment_term_line_view.xml',
'views/sped_account_payment_term_view.xml',

#
# Fiscal
#
'views/sped_natureza_operacao_view.xml',
'views/sped_veiculo_view.xml',

'views/sped_operacao_item_view.xml',

'views/sped_operacao_base_view.xml',

'views/sped_operacao_emissao_nfe_view.xml',
'views/sped_operacao_emissao_nfce_view.xml',
#'views/sped_operacao_recebimento_nfe_view.xml',

'views/sped_documento_item_declaracao_importacao_view.xml',
'views/sped_documento_item_emissao_view.xml',

'views/sped_documento_referenciado_view.xml',
'views/sped_documento_pagamento_view.xml',

'views/sped_documento_base_view.xml',

'views/sped_documento_emissao_nfe_view.xml',
'views/sped_documento_emissao_nfce_view.xml',
# 'views/sped_documento_recebimento_nfe_view.xml',
],
'external_dependencies': {
'python': ['pybrasil'],
}
}

0 comments on commit 851b973

Please sign in to comment.