changer visiblity for action_budget action_skip_budget button in purchase order

This commit is contained in:
younes 2025-05-14 10:32:37 +01:00
parent 41dd19243d
commit 2f2d3edfd0
1 changed files with 31 additions and 35 deletions

View File

@ -109,7 +109,7 @@
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field eval="100" name="priority"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="get_attachments" type="object"
class="oe_stat_button"
icon="fa-file-text-o">
@ -117,8 +117,8 @@
</button>
</xpath>
<xpath expr="//field[@name='payment_term_id']" position="after">
<field invisible="1" readonly="1" name='res_model'/>
<field invisible="1" readonly="1" name='res_id'/>
<field invisible="1" readonly="1" name='res_model'/>
<field invisible="1" readonly="1" name='res_id'/>
</xpath>
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
@ -130,7 +130,9 @@
</xpath>
<field name="partner_id" position="attributes">
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
<attribute name="domain">['&amp;',('supplier_rank','>', 0),'|', ('company_id', '=', False), ('company_id', '=', company_id)]</attribute>
<attribute name="domain">['&amp;',('supplier_rank','>', 0),'|', ('company_id', '=', False),
('company_id', '=', company_id)]
</attribute>
</field>
<xpath expr="/form/header/button[@name='action_rfq_send']" position="after">
<field name="parent_state" invisible="1"/>
@ -163,30 +165,16 @@
<button type="object" name="budget_resend" string="Resend To Budget Check" class="oe_highlight"
states="budget_rejected"/>
<button type="object" name="action_budget" string="Send To Budget Check" class="oe_highlight"
attrs="{'invisible': ['|',
('state', '!=', 'sign'),
'&amp;',
'&amp;',
('state', '=', 'sign'),
('requisition_state', '=', 'purchase_manager'),
('requisition_type_exclusive', '=', 'exclusive')
]
}"/>
attrs="{'invisible':['|',('requisition_id','!=',False),'|',('state','not in',('wait','sent')),('is_purchase_budget','=',False)]}"/>
<button name="action_skip_budget" type="object" string="Skip Budget"
attrs="{'invisible': ['|',
('state', '!=', 'sign'),
'&amp;',
'&amp;',
('state', '=', 'sign'),
('requisition_state', '=', 'purchase_manager'),
('requisition_type_exclusive', '=', 'exclusive')
]
}"
attrs="{'invisible':['|',('requisition_id','!=',False),'|',('state','not in',('wait','sent')),('is_purchase_budget','=',False)]}"
groups="purchase_requisition_custom.group_skip_purchase_budget"/>
<!-- <button name="button_draft" states="cancel" string="Set to Draft" type="object"/>-->
</xpath>
<xpath expr="//button[@name='button_approve']" position="replace">
<button name="button_approve" type="object" attrs="{'invisible':['|',('requisition_id','!=',False),('state','not in',('to approve'))]}" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="button_approve" type="object"
attrs="{'invisible':['|',('requisition_id','!=',False),('state','not in',('to approve'))]}"
string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
</xpath>
<xpath expr="//button[@name='button_draft']" position="after">
@ -205,7 +193,8 @@
<attribute name="groups">purchase.group_purchase_manager</attribute>
<attribute name="states">""</attribute>
<attribute name="attrs">
{'invisible':[('state','in',('wait','wait_for_send','sign','sent','to approve','waiting','purchase','cancel'))]}
{'invisible':[('state','in',('wait','wait_for_send','sign','sent','to
approve','waiting','purchase','cancel'))]}
</attribute>
</xpath>
<xpath expr="/form/header/button[@id='bid_confirm']" position="attributes">
@ -319,7 +308,8 @@
</xpath>
<!-- i edit here readonly="1"-->
<xpath expr="//notebook//page[1]" position="after">
<page string="Committe Members" groups="purchase_requisition_custom.committe_member" attrs="{'invisible':[('requisition_id','=', False)]}">
<page string="Committe Members" groups="purchase_requisition_custom.committe_member"
attrs="{'invisible':[('requisition_id','=', False)]}">
<field name="committe_members">
<tree>
<field name="user_id"/>
@ -343,24 +333,25 @@
<xpath expr="//form" position="attributes">
<attribute name="delete">0</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="get_attachments" type="object"
class="oe_stat_button"
icon="fa-file-text-o">
<field name="attach_no" widget="statinfo" string="Documents"/>
</button>
</xpath>
</xpath>
<xpath expr="//div[@name='button_box']//button[@name='%(purchase_requisition.action_purchase_requisition_list)d']" position="replace">
<xpath expr="//div[@name='button_box']//button[@name='%(purchase_requisition.action_purchase_requisition_list)d']"
position="replace">
<button name="action_purchase_orders_view" type="object" class="oe_stat_button" icon="fa-list-alt"
attrs="{'invisible': [('state', '=', 'draft')]}">
attrs="{'invisible': [('state', '=', 'draft')]}">
<field name="order_count" widget="statinfo" string="RFQs/Orders"/>
</button>
</xpath>
<xpath expr="//field[@name='name']" position="after">
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field invisible="1" readonly="1" name='res_model'/>
<field invisible="1" readonly="1" name='res_id'/>
</xpath>
</xpath>
<!-- header modificaton -->
<xpath expr="/form/header/button[@name='action_open']" position="after">
<button type="object" groups="purchase_requisition_custom.group_accept_purchase_requisition"
@ -447,7 +438,8 @@
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="/form/header/field[@name='state']" position="replace">
<field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done" attrs="{'invisible': [('is_quantity_copy', '=', 'none')]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done"
attrs="{'invisible': [('is_quantity_copy', '=', 'none')]}"/>
</xpath>
<xpath expr="//field[@name='date_end']" position="before">
<!-- <field name="agreement_name" attrs="{'readonly': [('state','!=', 'draft')]}"/>-->
@ -481,7 +473,8 @@
<attribute name="attrs">{
'readonly': [('state','in',('cancel','checked','done','waiting'))],
'required': [('type_exclusive', '=', 'multiple')]
}</attribute>
}
</attribute>
</xpath>
<xpath expr="//field[@name='ordering_date']" position="attributes">
<attribute name="required">1</attribute>
@ -493,7 +486,10 @@
</xpath>
<xpath expr="//notebook/page[1]/field[@name='line_ids']/tree[1]/field[@name='account_analytic_id']"
position="replace">
<field name="account_analytic_id" attrs="{'column_invisible':[('parent.is_purchase_budget','=',False)]}" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
<field name="account_analytic_id"
attrs="{'column_invisible':[('parent.is_purchase_budget','=',False)]}"
domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
groups="analytic.group_analytic_accounting"/>
</xpath>
<xpath expr="//notebook/page[1]/field[@name='line_ids']/tree[1]/field[@name='account_analytic_id']"
position="after">