[MIG]: account_char_update: Migration to version 7.0
[FIX]: Changed types to orm.Model, orm.TransientModel and orm.AbstractModel. [FIX]: Fix deletion method for some fields of objects. [FIX]: Contributions have been written in the standard format of the community. [FIX]: Changes in the form to work as a real wizard. [FIX]: Remove 'init_xml' keys, because it's no longer needed in v7. [FIX]: Rename 'demo_xml' key to the new standard 'demo'. [FIX]: Change imports calls. [FIX]: Remove __author__ variables in files, because authors are put on manifest file (__openerp__.py). [FIX]: Update view definitions to version 7.0 [FIX]: Rename variables to OpenERP standard. [FIX]: Increased compatibility with standard PEP8. [IMP]: User Invitu add the method call _reopen to keep open the wizard. [MRG]: User Invitu add frech language.
This commit is contained in:
parent
fe86277ea2
commit
e9da8fe0ea
25
account_chart_update/__init__.py
Normal file
25
account_chart_update/__init__.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Copyright (c) 2010 Zikzakmedia S.L. (http://www.zikzakmedia.com)
|
||||||
|
# Copyright (c) 2010 Pexego Sistemas Informáticos S.L. (http://www.pexego.es)
|
||||||
|
# @authors: Jordi Esteve (Zikzakmedia), Borja López Soilán (Pexego)
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
"""
|
||||||
|
Account Chart Update Wizard
|
||||||
|
"""
|
||||||
|
import wizard
|
69
account_chart_update/__openerp__.py
Normal file
69
account_chart_update/__openerp__.py
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# OpenERP, Open Source Management Solution
|
||||||
|
# Copyright (c) 2010 Zikzakmedia S.L. (http://www.zikzakmedia.com)
|
||||||
|
# Copyright (c) 2010 Pexego Sistemas Informáticos S.L. (http://www.pexego.es)
|
||||||
|
# Copyright (c) 2013 Joaquin Gutierrez (http://www.gutierrezweb.es)
|
||||||
|
# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
|
||||||
|
# $Id$
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# 2013/09/08 - Joaquín Gutierrez: Adaptación a la versión
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': "Detect changes and update the Account Chart from a template",
|
||||||
|
'version': "1.0",
|
||||||
|
'author': "Zikzakmedia SL",
|
||||||
|
'website': "www.zikzakmedia.com",
|
||||||
|
'depends': ["account"],
|
||||||
|
'category': "Generic Modules/Accounting",
|
||||||
|
'contributors': ['Joaquin Gutierrez', 'Pedro M. Baeza'],
|
||||||
|
'description': """
|
||||||
|
Adds a wizard to update a company account chart from a chart template.
|
||||||
|
======================================================================
|
||||||
|
|
||||||
|
This is a pretty useful tool to update OpenERP instalations after tax reforms
|
||||||
|
on the oficial charts of accounts, or to apply fixes performed on the chart
|
||||||
|
template.
|
||||||
|
|
||||||
|
The wizard:
|
||||||
|
- Allows the user to compare a chart and a template showing differences
|
||||||
|
on accounts, taxes, tax codes and fiscal positions.
|
||||||
|
- It may create the new account, taxes, tax codes and fiscal positions detected
|
||||||
|
on the template.
|
||||||
|
- It can also update (overwrite) the accounts, taxes, tax codes and fiscal
|
||||||
|
positions that got modified on the template.
|
||||||
|
|
||||||
|
The wizard lets the user select what kind of objects must be checked/updated,
|
||||||
|
and whether old records must be checked for changes and updated.
|
||||||
|
It will display all the accounts to be created / updated with some information
|
||||||
|
about the detected differences, and allow the user to exclude records
|
||||||
|
individually.
|
||||||
|
Any problem found while updating will be shown on the last step.
|
||||||
|
""",
|
||||||
|
'license': "AGPL-3",
|
||||||
|
"depends": [
|
||||||
|
"account",
|
||||||
|
"base",
|
||||||
|
],
|
||||||
|
"demo" : [],
|
||||||
|
"data": [
|
||||||
|
'wizard/wizard_chart_update_view.xml',
|
||||||
|
],
|
||||||
|
"active": False,
|
||||||
|
"installable": True
|
||||||
|
}
|
25
account_chart_update/wizard/__init__.py
Normal file
25
account_chart_update/wizard/__init__.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Copyright (c) 2010 Zikzakmedia S.L. (http://www.zikzakmedia.com)
|
||||||
|
# Copyright (c) 2010 Pexego Sistemas Informáticos S.L. (http://www.pexego.es)
|
||||||
|
# @authors: Jordi Esteve (Zikzakmedia), Borja López Soilán (Pexego)
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
"""
|
||||||
|
Account Chart Update Wizard
|
||||||
|
"""
|
||||||
|
import wizard_chart_update
|
1351
account_chart_update/wizard/wizard_chart_update.py
Normal file
1351
account_chart_update/wizard/wizard_chart_update.py
Normal file
File diff suppressed because it is too large
Load Diff
176
account_chart_update/wizard/wizard_chart_update_view.xml
Normal file
176
account_chart_update/wizard/wizard_chart_update_view.xml
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- Wizard for Multi Charts of Accounts -->
|
||||||
|
|
||||||
|
<record id="view_update_multi_chart" model="ir.ui.view">
|
||||||
|
<field name="name">Update Chart of Accounts from a Chart Template
|
||||||
|
</field>
|
||||||
|
<field name="model">wizard.update.charts.accounts</field>
|
||||||
|
<!-- <field name="type">form</field> -->
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Update Chart of Accounts from a Chart Template" version="7.0">
|
||||||
|
<header>
|
||||||
|
<field name="state" select="2" widget="statusbar"
|
||||||
|
statusbar_visible="init,ready,done" statusbar_colors='{"ready":"blue","done":"blue"}' />
|
||||||
|
</header>
|
||||||
|
<group attrs="{'invisible':[('state','!=','init')]}">
|
||||||
|
<h3>
|
||||||
|
<p><center>This wizard will update your accounts, taxes and fiscal positions according to the selected chart template</center></p>
|
||||||
|
|
||||||
|
</h3>
|
||||||
|
</group>
|
||||||
|
<group string="Chart of Accounts" attrs="{'invisible':[('state','!=','init')]}">
|
||||||
|
<field name="company_id" on_change="onchange_company_id(company_id)"
|
||||||
|
attrs="{'invisible':[('state','!=','init')]}" />
|
||||||
|
<field name="code_digits" attrs="{'invisible':[('state','!=','init')]}" />
|
||||||
|
<field name="chart_template_id" attrs="{'invisible':[('state','!=','init')]}" />
|
||||||
|
<field name="lang" attrs="{'invisible':[('state','!=','init')]}" />
|
||||||
|
</group>
|
||||||
|
<group attrs="{'invisible':[('state','!=','init')]}">
|
||||||
|
<group string="Update records?">
|
||||||
|
<field name="update_tax_code" />
|
||||||
|
<field name="update_tax" />
|
||||||
|
<field name="update_account" />
|
||||||
|
<field name="update_fiscal_position" />
|
||||||
|
</group>
|
||||||
|
<group string="Other options" attrs="{'invisible':[('state','!=','init')]}">
|
||||||
|
<field name="update_children_accounts_parent" />
|
||||||
|
<field name="continue_on_errors" />
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<group attrs="{'invisible':[('state','!=','init')]}">
|
||||||
|
<h5>
|
||||||
|
<p>If you leave these options set, the wizard will not just create new records, but also update records with changes (i.e. different tax amount)</p>
|
||||||
|
<p>Note:Not all the fields are tested for changes, just the main ones</p>
|
||||||
|
</h5>
|
||||||
|
</group>
|
||||||
|
<group attrs="{'invisible':[('state','!=','ready'),]}"
|
||||||
|
string="Records to create/update">
|
||||||
|
<notebook colspan="4">
|
||||||
|
<page string="Tax codes">
|
||||||
|
<field name="tax_code_ids">
|
||||||
|
<tree string="Tax codes" colors="red:type=='updated'">
|
||||||
|
<field name="tax_code_id" />
|
||||||
|
<field name="update_tax_code_id" />
|
||||||
|
<field name="type" invisible="1" />
|
||||||
|
</tree>
|
||||||
|
<form string="Tax code" version="7.0">
|
||||||
|
<group>
|
||||||
|
<field name="tax_code_id" />
|
||||||
|
<field name="type" />
|
||||||
|
<field name="update_tax_code_id" />
|
||||||
|
<field name="notes" readonly="1" class="oe_inline" />
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
<page string="Taxes">
|
||||||
|
<field name="tax_ids" nolabel="1">
|
||||||
|
<tree string="Taxes" colors="red:type=='updated'">
|
||||||
|
<field name="tax_id" />
|
||||||
|
<field name="update_tax_id" />
|
||||||
|
<field name="type" invisible="1" />
|
||||||
|
</tree>
|
||||||
|
<form string="Tax" version="7.0">
|
||||||
|
<group>
|
||||||
|
<field name="tax_id" />
|
||||||
|
<field name="type" />
|
||||||
|
<field name="update_tax_id" />
|
||||||
|
<field name="notes" readonly="1" class="oe_inline" />
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
<page string="Accounts">
|
||||||
|
<field name="account_ids" nolabel="1">
|
||||||
|
<tree string="Accounts" colors="red:type=='updated'">
|
||||||
|
<field name="account_id" />
|
||||||
|
<field name="update_account_id" />
|
||||||
|
<field name="type" invisible="1" />
|
||||||
|
</tree>
|
||||||
|
<form string="Account" version="7.0">
|
||||||
|
<group>
|
||||||
|
<field name="account_id" />
|
||||||
|
<field name="type" />
|
||||||
|
<field name="update_account_id" />
|
||||||
|
<field name="notes" readonly="1" class="oe_inline" />
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
<page string="Fiscal positions">
|
||||||
|
<field name="fiscal_position_ids" nolabel="1">
|
||||||
|
<tree string="Fiscal positions" colors="red:type=='updated'">
|
||||||
|
<field name="fiscal_position_id" />
|
||||||
|
<field name="update_fiscal_position_id" />
|
||||||
|
<field name="type" invisible="1" />
|
||||||
|
</tree>
|
||||||
|
<form string="Fiscal position" version="7.0">
|
||||||
|
<group>
|
||||||
|
<field name="fiscal_position_id" />
|
||||||
|
<field name="type" />
|
||||||
|
<field name="update_fiscal_position_id" />
|
||||||
|
<field name="notes" readonly="1" class="oe_inline" />
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
</notebook>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<group col="4" colspan="4"
|
||||||
|
attrs="{'invisible':[('state','!=','done'),]}">
|
||||||
|
<separator colspan="4" string="Log" />
|
||||||
|
<field name="log" colspan="4" nolabel="1" />
|
||||||
|
<group colspan="4">
|
||||||
|
<separator colspan="4" string="Summary of created objects" />
|
||||||
|
<field name="new_tax_codes" />
|
||||||
|
<field name="new_taxes" />
|
||||||
|
<field name="new_accounts" />
|
||||||
|
<field name="new_fps" />
|
||||||
|
</group>
|
||||||
|
<group colspan="4">
|
||||||
|
<separator colspan="4" string="Summary of updated objects" />
|
||||||
|
<field name="updated_tax_codes" />
|
||||||
|
<field name="updated_taxes" />
|
||||||
|
<field name="updated_accounts" />
|
||||||
|
<field name="updated_fps" />
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<div states="init">
|
||||||
|
<button name="action_find_records" string="Next" class="oe_highlight" type="object" />
|
||||||
|
o
|
||||||
|
<button special="cancel" string="Cancel" class="oe_link" />
|
||||||
|
</div>
|
||||||
|
<div states="ready">
|
||||||
|
<button name="action_init" string="Previous" type="object" />
|
||||||
|
<button name="action_update_records" string="Create/Update" type="object" class="oe_highlight" />
|
||||||
|
o
|
||||||
|
<button special="cancel" string="Cancel" class="oe_link" />
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_wizard_update_chart" model="ir.actions.act_window">
|
||||||
|
<field name="name">Update Chart of Accounts from a Chart Template
|
||||||
|
</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">wizard.update.charts.accounts</field>
|
||||||
|
<field name="view_type">form</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="target">new</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem parent="account.account_template_folder" action="action_wizard_update_chart" id="menu_wizard" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
Loading…
Reference in New Issue
Block a user