Browse Source

[FIX+IMP] account_tax_balance:

* Test
* README
* add extra parent menu. If not, with the web_responsive module is mixed
  between other menus
pull/736/head
eLBati 8 years ago
committed by Francisco Ivan Anton Prieto
parent
commit
956f30fbe0
  1. 2
      account_tax_balance/README.rst
  2. 5
      account_tax_balance/models/account_move.py
  3. 4
      account_tax_balance/tests/test_account_tax_balance.py
  4. 8
      account_tax_balance/wizard/open_tax_balances_view.xml

2
account_tax_balance/README.rst

@ -20,7 +20,7 @@ Select the company, the date range, the target moves and 'open taxes'
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/91/9.0
:target: https://runbot.odoo-community.org/runbot/91/10.0
Bug Tracker Bug Tracker
=========== ===========

5
account_tax_balance/models/account_move.py

@ -19,7 +19,10 @@ class AccountMove(models.Model):
], compute='_compute_move_type', store=True, readonly=True) ], compute='_compute_move_type', store=True, readonly=True)
@api.multi @api.multi
@api.depends('line_ids.account_id.internal_type', 'line_ids.balance')
@api.depends(
'line_ids.account_id.internal_type', 'line_ids.balance',
'line_ids.account_id.user_type_id.type'
)
def _compute_move_type(self): def _compute_move_type(self):
def _balance_get(line_ids, internal_type): def _balance_get(line_ids, internal_type):
return sum(line_ids.filtered( return sum(line_ids.filtered(

4
account_tax_balance/tests/test_account_tax_balance.py

@ -65,7 +65,7 @@ class TestAccountTaxBalance(TransactionCase):
self.assertEqual(invoice.state, 'draft') self.assertEqual(invoice.state, 'draft')
# change the state of invoice to open by clicking Validate button # change the state of invoice to open by clicking Validate button
invoice.signal_workflow('invoice_open')
invoice.action_invoice_open()
self.assertEquals(tax.base_balance, 100.) self.assertEquals(tax.base_balance, 100.)
self.assertEquals(tax.balance, 10.) self.assertEquals(tax.balance, 10.)
@ -135,7 +135,7 @@ class TestAccountTaxBalance(TransactionCase):
self.assertEqual(refund.state, 'draft') self.assertEqual(refund.state, 'draft')
# change the state of refund to open by clicking Validate button # change the state of refund to open by clicking Validate button
refund.signal_workflow('invoice_open')
refund.action_invoice_open()
self.assertEquals(tax.base_balance, 75.) self.assertEquals(tax.base_balance, 75.)
self.assertEquals(tax.balance, 7.5) self.assertEquals(tax.balance, 7.5)

8
account_tax_balance/wizard/open_tax_balances_view.xml

@ -33,10 +33,16 @@
<field name="target">new</field> <field name="target">new</field>
</record> </record>
<menuitem
id="menu_tax_balances"
name="Taxes Balance"
parent="account.menu_finance_reports"
groups="account.group_account_user,account.group_account_manager"/>
<menuitem <menuitem
action="action_open_tax_balances" action="action_open_tax_balances"
id="menu_action_open_tax_balances" id="menu_action_open_tax_balances"
parent="account.menu_finance_reports"
parent="menu_tax_balances"
groups="account.group_account_user,account.group_account_manager"/> groups="account.group_account_user,account.group_account_manager"/>
</odoo> </odoo>
Loading…
Cancel
Save