50
50
<xpath expr="//field[@name='user_type']" position="replace">
51
51
<field name="user_type_code" invisible="1"/>
52
<field name="is_analytic_addicted" invisible="1"/>
53
<field name="user_type" on_change="onchange_user_type(user_type, code)"/>
52
<field name="user_type" on_change="onchange_user_type(user_type)"/>
55
54
<xpath expr="/form/notebook/page[@string='General Information']" position="after">
56
55
<page string="Analytical Destination">
57
56
<field name="default_destination_id" colspan="2"
58
attrs="{'required': [('is_analytic_addicted', '=', True)], 'readonly': [('is_analytic_addicted', '!=', True)]}"/>
57
attrs="{'required': [('user_type_code', '=', 'expense')], 'readonly': [('user_type_code', '!=', 'expense')]}"/>
59
58
<label string="" colspan="2"/>
60
59
<field name="destination_ids" nolabel="1" colspan="4" domain="[('type', '!=', 'view'), ('category', '=', 'DEST')]">
61
60
<tree string="Destinations">
80
79
<field name="arch" type="xml">
82
81
<xpath expr="/form/notebook" position="before">
83
<group colspan="4" col="8" attrs="{'invisible': ['|', ('analytic_distribution_id', '=', False), ('imported', '=', True)]}">
84
<button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
85
<button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4" attrs="{'invisible': ['|', ('status', '!=', 'manu'), ('state', '!=', 'draft')]}"/>
87
<group colspan="4" col="8" attrs="{'invisible': ['|', ('analytic_distribution_id', '!=', False), ('imported', '=', True)]}">
88
<button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
89
<button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4" attrs="{'invisible': ['|', ('status', '!=', 'manu'), ('state', '!=', 'draft')]}"/>
91
<field name="analytic_distribution_id" invisible="1"/>
82
<group colspan="6" col="3">
83
<button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="2" attrs="{'invisible': ['|', ('analytic_distribution_id', '=', False), ('status', '=', 'sys')]}"/>
84
<button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="2" attrs="{'invisible': ['|', ('analytic_distribution_id', '!=', False), ('status', '=', 'sys')]}"/>
85
<field name="analytic_distribution_id" invisible="1"/>
93
88
<xpath expr="/form//tree" position="attributes">
94
89
<attribute name="colors">blue:state in ('draft') and analytic_distribution_state in ('valid', 'none');black:state in ('valid') and analytic_distribution_state in ('valid', 'none');red:analytic_distribution_state in ('invalid') or state in ('draft')</attribute>