Skip to content

Commit

Permalink
[IMP] account: automatic periodical VAT closure
Browse files Browse the repository at this point in the history
  • Loading branch information
csnauwaert authored and qdp-odoo committed Apr 17, 2019
1 parent d7f5707 commit 55d985c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
4 changes: 4 additions & 0 deletions addons/account/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion addons/account/models/chart_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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])
Expand Down
33 changes: 28 additions & 5 deletions addons/account/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions addons/l10n_be/data/account_pcmn_belgium_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 55d985c

Please sign in to comment.