Skip to content
Permalink
Browse files

[IMP] account: automatic periodical VAT closure

  • Loading branch information...
csnauwaert committed Apr 16, 2019
1 parent bbd402c commit 54e8a3c59e85329238eed73b88224ff1363fcba3
@@ -883,6 +883,10 @@ class AccountTaxGroup(models.Model):

name = fields.Char(required=True, translate=True)
sequence = fields.Integer(default=10)
property_tax_payable_account_id = fields.Many2one('account.account', company_dependent=True, string='Tax current account (payable)')
property_tax_receivable_account_id = fields.Many2one('account.account', company_dependent=True, string='Tax current account (receivable)')
property_advance_tax_payment_account_id = fields.Many2one('account.account', company_dependent=True, string='Advance Tax payment account')


class AccountTax(models.Model):
_name = 'account.tax'
@@ -124,6 +124,9 @@ class AccountChartTemplate(models.Model):
property_stock_account_input_categ_id = fields.Many2one('account.account.template', string="Input Account for Stock Valuation", oldname="property_stock_account_input_categ")
property_stock_account_output_categ_id = fields.Many2one('account.account.template', string="Output Account for Stock Valuation", oldname="property_stock_account_output_categ")
property_stock_valuation_account_id = fields.Many2one('account.account.template', string="Account Template for Stock Valuation")
property_tax_payable_account_id = fields.Many2one('account.account.template', string="Tax current account (payable)")
property_tax_receivable_account_id = fields.Many2one('account.account.template', string="Tax current account (receivable)")
property_advance_tax_payment_account_id = fields.Many2one('account.account.template', string="Advance tax payment account")

@api.model
def _prepare_transfer_account_template(self):
@@ -419,7 +422,7 @@ def _get_default_account(journal_vals, type='debit'):

journals = [{'name': _('Customer Invoices'), 'type': 'sale', 'code': _('INV'), 'favorite': True, 'color': 11, 'sequence': 5},
{'name': _('Vendor Bills'), 'type': 'purchase', 'code': _('BILL'), 'favorite': True, 'color': 11, 'sequence': 6},
{'name': _('Miscellaneous Operations'), 'type': 'general', 'code': _('MISC'), 'favorite': False, 'sequence': 7},
{'name': _('Miscellaneous Operations'), 'type': 'general', 'code': _('MISC'), 'favorite': True, 'sequence': 7},
{'name': _('Exchange Difference'), 'type': 'general', 'code': _('EXCH'), 'favorite': False, 'sequence': 9},
{'name': _('Cash Basis Taxes'), 'type': 'general', 'code': _('CABA'), 'favorite': False, 'sequence': 10}]
if journals_dict != None:
@@ -460,6 +463,9 @@ def generate_properties(self, acc_template_ref, company):
('property_account_income_categ_id', 'product.category', 'account.account'),
('property_account_expense_id', 'product.template', 'account.account'),
('property_account_income_id', 'product.template', 'account.account'),
('property_tax_payable_account_id', 'account.tax.group', 'account.account'),
('property_tax_receivable_account_id', 'account.tax.group', 'account.account'),
('property_advance_tax_payment_account_id', 'account.tax.group', 'account.account'),
]
for record in todo_list:
account = getattr(self, record[0])
@@ -306,11 +306,11 @@
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
@@ -1223,6 +1223,29 @@
</record>
<menuitem action="action_tax_form" id="menu_action_tax_form" parent="account_account_menu" sequence="2"/>

<!-- Tax group -->
<record id="view_tax_group_tree" model="ir.ui.view">
<field name="name">account.tax.group.tree</field>
<field name="model">account.tax.group</field>
<field name="arch" type="xml">
<tree string="Account Tax Group" editable="bottom" create="false">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="property_tax_payable_account_id"/>
<field name="property_tax_receivable_account_id"/>
<field name="property_advance_tax_payment_account_id"/>
</tree>
</field>
</record>
<record id="action_tax_group" model="ir.actions.act_window">
<field name="name">Tax Groups</field>
<field name="res_model">account.tax.group</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain" eval="False"/> <!-- Force empty -->
<field name="view_id" ref="view_tax_group_tree"/>
</record>

<!-- Full Reconcile -->
<record id="view_full_reconcile_form" model="ir.ui.view">
<field name="name">account.full.reconcile.form</field>
@@ -9,5 +9,7 @@
<field name="property_account_income_categ_id" ref="a7010"/>
<field name="expense_currency_exchange_account_id" ref="a654"/>
<field name="income_currency_exchange_account_id" ref="a754"/>
<field name="property_tax_payable_account_id" ref="a4512"/>
<field name="property_tax_receivable_account_id" ref="a4112"/>
</record>
</odoo>

0 comments on commit 54e8a3c

Please sign in to comment.
You can’t perform that action at this time.