Browse Source
Consider normal and refund operations separately
Consider normal and refund operations separately
Allow to explore all move lines Spanish translation Bugfixes Show negative lines too Show move type in account.move views Tests include new fieldspull/619/head
Antonio Espinosa
8 years ago
committed by
Andrea
9 changed files with 605 additions and 104 deletions
-
4account_tax_balance/__openerp__.py
-
261account_tax_balance/i18n/es.po
-
1account_tax_balance/models/__init__.py
-
42account_tax_balance/models/account_move.py
-
128account_tax_balance/models/account_tax.py
-
41account_tax_balance/tests/test_account_tax_balance.py
-
40account_tax_balance/views/account_move_view.xml
-
38account_tax_balance/views/account_tax_view.xml
-
12account_tax_balance/wizard/open_tax_balances_view.xml
@ -0,0 +1,261 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_tax_balance |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-10-21 15:30+0000\n" |
|||
"PO-Revision-Date: 2016-10-21 15:30+0000\n" |
|||
"Last-Translator: <>\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: \n" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
msgid "Account" |
|||
msgstr "Cuenta" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model,name:account_tax_balance.model_account_move |
|||
msgid "Account Entry" |
|||
msgstr "Asiento contable" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "Account Tax" |
|||
msgstr "Cuenta de impuesto" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:wizard.open.tax.balances,target_move:0 |
|||
msgid "All Entries" |
|||
msgstr "Todos los asientos" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:wizard.open.tax.balances,target_move:0 |
|||
msgid "All Posted Entries" |
|||
msgstr "Todos los asientos asentados" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_balance_regular |
|||
msgid "Balance" |
|||
msgstr "Cuota" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_balance_refund |
|||
msgid "Balance Refund" |
|||
msgstr "Cuota devoluciones" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_base_balance_regular |
|||
msgid "Base Balance" |
|||
msgstr "Base imponible" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_base_balance_refund |
|||
msgid "Base Balance Refund" |
|||
msgstr "Base devoluciones" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "Base Total" |
|||
msgstr "Base total" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.wizard_open_tax_balances |
|||
msgid "Cancel" |
|||
msgstr "Cancelar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_company_id |
|||
msgid "Company" |
|||
msgstr "Compañía" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_create_uid |
|||
msgid "Created by" |
|||
msgstr "Creado por" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_create_date |
|||
msgid "Created on" |
|||
msgstr "Creado en" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_date_range_id |
|||
msgid "Date range" |
|||
msgstr "Periodo" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_display_name |
|||
msgid "Display Name" |
|||
msgstr "Nombre a mostrar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_from_date |
|||
msgid "From date" |
|||
msgstr "Desde" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
msgid "Group By" |
|||
msgstr "Agrupar por" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_id |
|||
msgid "ID" |
|||
msgstr "ID" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances___last_update |
|||
msgid "Last Modified on" |
|||
msgstr "Última modificación en" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_write_uid |
|||
msgid "Last Updated by" |
|||
msgstr "Última modificación por" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_write_date |
|||
msgid "Last Updated on" |
|||
msgstr "Última actualización en" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Liquidity" |
|||
msgstr "Liquidez" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_move_move_type |
|||
msgid "Move type" |
|||
msgstr "Tipo de operación" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.wizard_open_tax_balances |
|||
msgid "Open Taxes" |
|||
msgstr "Ver impuestos" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Other" |
|||
msgstr "Otro" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Payable" |
|||
msgstr "A pagar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Payable refund" |
|||
msgstr "Devoluciones a cobrar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Receivable" |
|||
msgstr "A cobrar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: selection:account.move,move_type:0 |
|||
msgid "Receivable refund" |
|||
msgstr "Devoluciones a pagar" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "Short Name" |
|||
msgstr "Nombre corto" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_target_move |
|||
msgid "Target Moves" |
|||
msgstr "Movimientos destino" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model,name:account_tax_balance.model_account_tax |
|||
msgid "Tax" |
|||
msgstr "Impuesto" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
msgid "Tax Group" |
|||
msgstr "Grupo del impuesto" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_search_balance |
|||
msgid "Tax Scope" |
|||
msgstr "Uso del impuesto" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.actions.act_window,name:account_tax_balance.action_open_tax_balances |
|||
#: model:ir.actions.act_window,name:account_tax_balance.action_tax_balances_tree |
|||
#: model:ir.ui.menu,name:account_tax_balance.menu_action_open_tax_balances |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.wizard_open_tax_balances |
|||
msgid "Taxes Balance" |
|||
msgstr "Tabla de impuestos" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_wizard_open_tax_balances_to_date |
|||
msgid "To date" |
|||
msgstr "Hasta" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "Total" |
|||
msgstr "Total" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_balance |
|||
msgid "Total Balance" |
|||
msgstr "Total cuota" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model.fields,field_description:account_tax_balance.field_account_tax_base_balance |
|||
msgid "Total Base Balance" |
|||
msgstr "Total base imponible" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View base lines" |
|||
msgstr "Ver líneas de base imponible" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View base refund lines" |
|||
msgstr "Ver líneas de base imponible de devoluciones" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View base regular lines" |
|||
msgstr "Ver líneas de base imponible de operaciones corrientes" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View tax lines" |
|||
msgstr "Ver líneas de cuota" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View tax refund lines" |
|||
msgstr "Ver líneas de cuota de devoluciones" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.view_tax_tree_balance |
|||
msgid "View tax regular lines" |
|||
msgstr "Ver líneas de cuota de operaciones corrientes" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.ui.view,arch_db:account_tax_balance.wizard_open_tax_balances |
|||
msgid "or" |
|||
msgstr "o" |
|||
|
|||
#. module: account_tax_balance |
|||
#: model:ir.model,name:account_tax_balance.model_wizard_open_tax_balances |
|||
msgid "wizard.open.tax.balances" |
|||
msgstr "wizard.open.tax.balances" |
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from openerp import models, fields, api |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
_inherit = 'account.move' |
|||
|
|||
move_type = fields.Selection( |
|||
string="Move type", selection=[ |
|||
('other', 'Other'), |
|||
('liquidity', 'Liquidity'), |
|||
('receivable', 'Receivable'), |
|||
('receivable_refund', 'Receivable refund'), |
|||
('payable', 'Payable'), |
|||
('payable_refund', 'Payable refund'), |
|||
], compute='_compute_move_type', store=True, readonly=True) |
|||
|
|||
@api.multi |
|||
@api.depends('line_ids.account_id.internal_type', 'line_ids.balance') |
|||
def _compute_move_type(self): |
|||
def _balance_get(line_ids, internal_type): |
|||
return sum(line_ids.filtered( |
|||
lambda x: x.account_id.internal_type == internal_type).mapped( |
|||
'balance')) |
|||
|
|||
for move in self: |
|||
internal_types = move.line_ids.mapped('account_id.internal_type') |
|||
if 'liquidity' in internal_types: |
|||
move.move_type = 'liquidity' |
|||
elif 'payable' in internal_types: |
|||
balance = _balance_get(move.line_ids, 'payable') |
|||
move.move_type = ( |
|||
'payable' if balance < 0 else 'payable_refund') |
|||
elif 'receivable' in internal_types: |
|||
balance = _balance_get(move.line_ids, 'receivable') |
|||
move.move_type = ( |
|||
'receivable' if balance > 0 else 'receivable_refund') |
|||
else: |
|||
move.move_type = 'other' |
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> |
|||
<odoo> |
|||
|
|||
|
|||
<record id="view_move_tree" model="ir.ui.view"> |
|||
<field name="name">Add move type column</field> |
|||
<field name="model">account.move</field> |
|||
<field name="inherit_id" ref="account.view_move_tree"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="state" position="after"> |
|||
<field name="move_type"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_move_form" model="ir.ui.view"> |
|||
<field name="name">Add move type field</field> |
|||
<field name="model">account.move</field> |
|||
<field name="inherit_id" ref="account.view_move_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="ref" position="after"> |
|||
<field name="move_type"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_account_move_filter" model="ir.ui.view"> |
|||
<field name="name">Add move type group by</field> |
|||
<field name="model">account.move</field> |
|||
<field name="inherit_id" ref="account.view_account_move_filter"/> |
|||
<field name="arch" type="xml"> |
|||
<group expand="0" position="inside"> |
|||
<filter string="Move type" domain="[]" context="{'group_by':'move_type'}"/> |
|||
</group> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue