2
0

pre-commit update

This commit is contained in:
OCA-git-bot 2020-03-14 11:47:13 +01:00 committed by Luis J. Salvatierra
parent 2d0280cdc3
commit 98fd1e8c65
2 changed files with 268 additions and 214 deletions

View File

@ -1,31 +1,32 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> <!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<record id="res_config_settings_view_form" model="ir.ui.view"> <record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">Open Account Chart Update Wizard 2</field> <field name="name">Open Account Chart Update Wizard 2</field>
<field name="model">res.config.settings</field> <field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form"/> <field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<div data-key="account" position="inside"> <div data-key="account" position="inside">
<h2>Update Chart Template</h2> <h2>Update Chart Template</h2>
<div class="row mt16 o_settings_container"> <div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box"> <div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"/> <div class="o_setting_left_pane" />
<div class="o_setting_right_pane"> <div class="o_setting_right_pane">
<span class="o_form_label">Update Chart Template</span> <span class="o_form_label">Update Chart Template</span>
<div class="text-muted"> <div class="text-muted">
Update Taxes, fiscal positions or chart of accounts. Update Taxes, fiscal positions or chart of accounts.
</div> </div>
<div class="content-group"> <div class="content-group">
<div class="row mt16"/> <div class="row mt16" />
<div> <div>
<button string="Update chart template" <button
name="%(action_wizard_update_chart)d" string="Update chart template"
context="{'default_company_id': company_id}" name="%(action_wizard_update_chart)d"
type="action" context="{'default_company_id': company_id}"
icon="fa-arrow-right" type="action"
class="oe_link" icon="fa-arrow-right"
class="oe_link"
/> />
</div> </div>
</div> </div>

View File

@ -1,246 +1,299 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> <!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<record id="view_update_multi_chart" model="ir.ui.view">
<record id="view_update_multi_chart" model="ir.ui.view"> <field name="name">Update Chart of Accounts from a Chart Template</field>
<field name="name">Update Chart of Accounts from a Chart Template</field> <field name="model">wizard.update.charts.accounts</field>
<field name="model">wizard.update.charts.accounts</field> <field name="arch" type="xml">
<field name="arch" type="xml"> <form>
<form> <header>
<header> <field
<field name="state"
name="state" select="2"
select="2" widget="statusbar"
widget="statusbar" statusbar_visible="init,ready,done"
statusbar_visible="init,ready,done" statusbar_colors='{"ready":"blue","done":"blue"}'
statusbar_colors='{"ready":"blue","done":"blue"}' /> />
</header> </header>
<group attrs="{'invisible':[('state','!=','init')]}"> <group attrs="{'invisible':[('state','!=','init')]}">
<h3> <h3>
<p> <p>
<center> <center>
This wizard will update your accounts, taxes and This wizard will update your accounts, taxes and
fiscal positions according to the selected chart fiscal positions according to the selected chart
template template
</center> </center>
</p> </p>
</h3> </h3>
</group> </group>
<group string="Chart of Accounts" attrs="{'invisible':[('state','!=','init')]}"> <group
<field name="company_id" string="Chart of Accounts"
attrs="{'invisible':[('state','!=','init')]}" attrs="{'invisible':[('state','!=','init')]}"
/> >
<field name="code_digits" invisible="1" /> <field
<field name="chart_template_id" name="company_id"
domain="[('visible', '=', True)]" attrs="{'invisible':[('state','!=','init')]}"
attrs="{'invisible': [('state','!=','init')], 'required': True}" />
/> <field name="code_digits" invisible="1" />
<field name="lang" attrs="{'invisible':[('state','!=','init')]}" /> <field
</group> name="chart_template_id"
<notebook attrs="{'invisible':[('state','!=','init')]}"> domain="[('visible', '=', True)]"
<page string="General options" name="page_general_options"> attrs="{'invisible': [('state','!=','init')], 'required': True}"
<group> />
<group string="Update records?"> <field name="lang" attrs="{'invisible':[('state','!=','init')]}" />
<field name="update_tax" /> </group>
<field name="update_account" /> <notebook attrs="{'invisible':[('state','!=','init')]}">
<field name="update_fiscal_position" /> <page string="General options" name="page_general_options">
<group>
<group string="Update records?">
<field name="update_tax" />
<field name="update_account" />
<field name="update_fiscal_position" />
</group>
<group
string="Other options"
attrs="{'invisible':[('state','!=','init')]}"
>
<field name="continue_on_errors" />
<field name="recreate_xml_ids" />
</group>
</group> </group>
<group string="Other options" attrs="{'invisible':[('state','!=','init')]}"> <group>
<field name="continue_on_errors" /> <h5>
<field name="recreate_xml_ids" /> <p>
</group>
</group>
<group>
<h5>
<p>
If you leave these options set, the wizard will If you leave these options set, the wizard will
not just create new records, but also update not just create new records, but also update
records with changes (i.e. different tax amount) records with changes (i.e. different tax amount)
</p> </p>
<p> <p>
Note: Only the changed fields are updated. Note: Only the changed fields are updated.
</p> </p>
</h5> </h5>
</group> </group>
</page> </page>
<page string="Field options" <page
attrs="{'invisible': [ string="Field options"
attrs="{'invisible': [
('update_tax', '=', False), ('update_tax', '=', False),
('update_account', '=', False), ('update_account', '=', False),
('update_fiscal_position', '=', False), ('update_fiscal_position', '=', False),
]}" ]}"
> >
<h3> <h3>
<p> <p>
Here you can select the fields you want to check if Here you can select the fields you want to check if
they have been updated in the templates. they have been updated in the templates.
</p> </p>
</h3> </h3>
<notebook> <notebook>
<page string="Taxes" <page
name="page_fields_taxes" string="Taxes"
attrs="{'invisible': [('update_tax', '=', False)]}" name="page_fields_taxes"
> attrs="{'invisible': [('update_tax', '=', False)]}"
<field name="tax_field_ids" >
widget="many2many_checkboxes" <field
context="{'account_chart_update': True}" name="tax_field_ids"
/> widget="many2many_checkboxes"
</page> context="{'account_chart_update': True}"
<page string="Accounts" />
name="page_fields_accounts" </page>
attrs="{'invisible': [('update_account', '=', False)]}" <page
> string="Accounts"
<field name="account_field_ids" name="page_fields_accounts"
widget="many2many_checkboxes" attrs="{'invisible': [('update_account', '=', False)]}"
context="{'account_chart_update': True}" >
/> <field
</page> name="account_field_ids"
<page string="Fiscal positions" widget="many2many_checkboxes"
name="page_fields_fps" context="{'account_chart_update': True}"
attrs="{'invisible': [('update_fiscal_position', '=', False)]}" />
> </page>
<field name="fp_field_ids" <page
widget="many2many_checkboxes" string="Fiscal positions"
context="{'account_chart_update': True}" name="page_fields_fps"
/> attrs="{'invisible': [('update_fiscal_position', '=', False)]}"
</page> >
</notebook> <field
</page> name="fp_field_ids"
<page string="Matching" widget="many2many_checkboxes"
attrs="{'invisible': [ context="{'account_chart_update': True}"
/>
</page>
</notebook>
</page>
<page
string="Matching"
attrs="{'invisible': [
('update_tax', '=', False), ('update_tax', '=', False),
('update_account', '=', False), ('update_account', '=', False),
('update_fiscal_position', '=', False), ('update_fiscal_position', '=', False),
]}" ]}"
>
<h3>
<p>Here you can set the matching order.</p>
</h3>
<notebook>
<page
string="Taxes"
name="page_matching_taxes"
attrs="{'invisible': [('update_tax', '=', False)]}"
>
<field name="tax_matching_ids">
<tree
create="false"
edit="false"
default_order="sequence"
>
<field name="sequence" widget="handle" />
<field name="matching_value" />
</tree>
<form>
<field name="matching_value" readonly="1" />
</form>
</field>
</page>
<page
string="Accounts"
name="page_matching_accounts"
attrs="{'invisible': [('update_account', '=', False)]}"
>
<field name="account_matching_ids">
<tree
create="false"
edit="false"
default_order="sequence"
>
<field name="sequence" widget="handle" />
<field name="matching_value" />
</tree>
<form>
<field name="matching_value" readonly="1" />
</form>
</field>
</page>
<page
string="Fiscal positions"
name="page_matching_fps"
attrs="{'invisible': [('update_fiscal_position', '=', False)]}"
>
<field name="fp_matching_ids">
<tree
create="false"
edit="false"
default_order="sequence"
>
<field name="sequence" widget="handle" />
<field name="matching_value" />
</tree>
<form>
<field name="matching_value" readonly="1" />
</form>
</field>
</page>
</notebook>
</page>
</notebook>
<group
attrs="{'invisible':[('state','!=','ready'),]}"
string="Records to create/update"
> >
<h3> <notebook colspan="4">
<p>Here you can set the matching order.</p> <page
</h3> string="Taxes"
<notebook> attrs="{'invisible': [('update_tax', '=', False)]}"
<page string="Taxes"
name="page_matching_taxes"
attrs="{'invisible': [('update_tax', '=', False)]}"
> >
<field name="tax_matching_ids"> <field name="tax_ids" nolabel="1">
<tree create="false" edit="false" default_order="sequence"> <tree string="Taxes" colors="red:type=='updated'">
<field name="sequence" widget="handle"/> <field name="tax_id" />
<field name="matching_value"/> <field name="update_tax_id" />
<field name="type_tax_use" />
<field name="notes" />
<field name="type" />
</tree> </tree>
<form>
<field name="matching_value" readonly="1"/>
</form>
</field> </field>
</page> </page>
<page string="Accounts" <page
name="page_matching_accounts" string="Accounts"
attrs="{'invisible': [('update_account', '=', False)]}" attrs="{'invisible': [('update_account', '=', False)]}"
> >
<field name="account_matching_ids"> <field name="account_ids" nolabel="1">
<tree create="false" edit="false" default_order="sequence"> <tree string="Accounts" colors="red:type=='updated'">
<field name="sequence" widget="handle"/> <field name="account_id" />
<field name="matching_value"/> <field name="update_account_id" />
<field name="notes" />
<field name="type" />
</tree> </tree>
<form>
<field name="matching_value" readonly="1"/>
</form>
</field> </field>
</page> </page>
<page string="Fiscal positions" <page
name="page_matching_fps" string="Fiscal positions"
attrs="{'invisible': [('update_fiscal_position', '=', False)]}" attrs="{'invisible': [('update_fiscal_position', '=', False)]}"
> >
<field name="fp_matching_ids"> <field name="fiscal_position_ids" nolabel="1">
<tree create="false" edit="false" default_order="sequence"> <tree
<field name="sequence" widget="handle"/> string="Fiscal positions"
<field name="matching_value"/> colors="red:type=='updated'"
>
<field name="fiscal_position_id" />
<field name="update_fiscal_position_id" />
<field name="notes" />
<field name="type" />
</tree> </tree>
<form>
<field name="matching_value" readonly="1"/>
</form>
</field> </field>
</page> </page>
</notebook> </notebook>
</page>
</notebook>
<group attrs="{'invisible':[('state','!=','ready'),]}"
string="Records to create/update">
<notebook colspan="4">
<page string="Taxes" attrs="{'invisible': [('update_tax', '=', False)]}">
<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_tax_use"/>
<field name="notes"/>
<field name="type"/>
</tree>
</field>
</page>
<page string="Accounts" attrs="{'invisible': [('update_account', '=', False)]}">
<field name="account_ids" nolabel="1">
<tree string="Accounts" colors="red:type=='updated'">
<field name="account_id" />
<field name="update_account_id" />
<field name="notes"/>
<field name="type"/>
</tree>
</field>
</page>
<page string="Fiscal positions" attrs="{'invisible': [('update_fiscal_position', '=', False)]}">
<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="notes"/>
<field name="type"/>
</tree>
</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_taxes" />
<field name="new_accounts" />
<field name="new_fps" />
</group> </group>
<group colspan="4"> <group
<separator colspan="4" string="Summary of updated objects" /> col="4"
<field name="updated_taxes" /> colspan="4"
<field name="deleted_taxes" /> attrs="{'invisible':[('state','!=','done'),]}"
<field name="updated_accounts" /> >
<field name="updated_fps" /> <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_taxes" />
<field name="new_accounts" />
<field name="new_fps" />
</group>
<group colspan="4">
<separator colspan="4" string="Summary of updated objects" />
<field name="updated_taxes" />
<field name="deleted_taxes" />
<field name="updated_accounts" />
<field name="updated_fps" />
</group>
</group> </group>
</group> <footer>
<span states="init">
<footer> <button
<span states="init"> name="action_find_records"
<button name="action_find_records" string="Next" class="oe_highlight" type="object" /> string="Next"
</span> class="oe_highlight"
<span states="ready"> type="object"
<button name="action_init" string="Previous" type="object" /> />
<button name="action_update_records" string="Create/Update" type="object" class="oe_highlight" /> </span>
</span> <span states="ready">
<span states="init,ready"> or </span> <button name="action_init" string="Previous" type="object" />
<button special="cancel" string="Close" class="oe_link" /> <button
</footer> name="action_update_records"
</form> string="Create/Update"
</field> type="object"
</record> class="oe_highlight"
/>
<record id="action_wizard_update_chart" model="ir.actions.act_window"> </span>
<field name="name">Update chart of accounts</field> <span states="init,ready"> or </span>
<field name="type">ir.actions.act_window</field> <button special="cancel" string="Close" class="oe_link" />
<field name="res_model">wizard.update.charts.accounts</field> </footer>
<field name="view_mode">form</field> </form>
<field name="target">new</field> </field>
</record> </record>
<record id="action_wizard_update_chart" model="ir.actions.act_window">
<field name="name">Update chart of accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.update.charts.accounts</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo> </odoo>