Merge pull request #5467 from expsa/feature/purchase-request-visual-enhancements-20251120-155413

Fix Purchase Request UI/UX Issues - Button Classes, Layout, State Widget
This commit is contained in:
Mohamed Eltayar 2025-11-20 16:39:23 +03:00 committed by GitHub
commit a293af1597
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -2976,6 +2976,9 @@ msgstr "أدخل مبررات طلب الشراء..."
msgid "Enter additional notes..." msgid "Enter additional notes..."
msgstr "أدخل ملاحظات إضافية..." msgstr "أدخل ملاحظات إضافية..."
msgid "Vendor and Accounting"
msgstr "المورد والمحاسبة"
#. module: purchase_requisition_custom #. module: purchase_requisition_custom
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_request_form #: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_request_form
msgid "Suggested vendor for this purchase request" msgid "Suggested vendor for this purchase request"

View File

@ -12,28 +12,28 @@
<button name="action_submit" groups="purchase_requisition_custom.create_purchase_request" <button name="action_submit" groups="purchase_requisition_custom.create_purchase_request"
type="object" type="object"
string="Submit" string="Submit"
class="oe_highlight" class="btn-primary"
icon="fa-paper-plane" icon="fa-paper-plane"
attrs="{'invisible': ['|',('is_creator', '=', False),('state','!=','draft')]}"/> attrs="{'invisible': ['|',('is_creator', '=', False),('state','!=','draft')]}"/>
<button name="action_confirm" groups="purchase_requisition_custom.group_direct_manger" <button name="action_confirm" groups="purchase_requisition_custom.group_direct_manger"
type="object" string="Approve" states="direct_manager" type="object" string="Approve" states="direct_manager"
class="oe_highlight" icon="fa-check-circle"/> class="btn-primary" icon="fa-check-circle"/>
<button name="create_requisition" <button name="create_requisition"
groups="purchase.group_purchase_user,purchase.group_purchase_manager" type="object" groups="purchase.group_purchase_user,purchase.group_purchase_manager" type="object"
string="Create Requisition" string="Create Requisition"
class="oe_highlight" class="btn-primary"
icon="fa-file-text-o" icon="fa-file-text-o"
attrs="{'invisible' : ['|',('state' , '!=' , 'waiting'),('purchase_create' , '=' , True)]}"/> attrs="{'invisible' : ['|',('state' , '!=' , 'waiting'),('purchase_create' , '=' , True)]}"/>
<button name="create_purchase_order2" type="object" string="Create Purchase Order" <button name="create_purchase_order2" type="object" string="Create Purchase Order"
class="oe_highlight" groups="purchase.group_purchase_user" class="btn-primary" groups="purchase.group_purchase_user"
icon="fa-shopping-cart" icon="fa-shopping-cart"
attrs="{'invisible' : ['|',('state' , '!=' , 'waiting'),('purchase_create' , '=' , True)]}"/> attrs="{'invisible' : ['|',('state' , '!=' , 'waiting'),('purchase_create' , '=' , True)]}"/>
<button name="action_refuse" type="object" string="Refuse" id="prc_request_refuse" <button name="action_refuse" type="object" string="Refuse" id="prc_request_refuse"
groups="purchase_requisition_custom.group_refuse_purchase" groups="purchase_requisition_custom.group_refuse_purchase"
class="btn-secondary" class="btn-danger"
icon="fa-times-circle" icon="fa-times-circle"
attrs="{'invisible' : [('state' , 'not in' , ('direct_manager','waiting'))]}"/> attrs="{'invisible' : [('state' , 'not in' , ('direct_manager','waiting'))]}"/>
@ -41,7 +41,7 @@
groups="purchase.group_purchase_manager" states="waiting" groups="purchase.group_purchase_manager" states="waiting"
icon="fa-check-circle"/> icon="fa-check-circle"/>
<button name="action_draft" type="object" string="Reset To Draft" class="oe_highlight" <button name="action_draft" type="object" string="Reset To Draft" class="btn-secondary"
states="refuse" groups="purchase_requisition_custom.group_purchase_set_to_draft" states="refuse" groups="purchase_requisition_custom.group_purchase_set_to_draft"
icon="fa-undo"/> icon="fa-undo"/>
@ -67,8 +67,8 @@
<field name="name" required="1" readonly="1" class="oe_inline"/> <field name="name" required="1" readonly="1" class="oe_inline"/>
</h1> </h1>
</div> </div>
<group col="4" colspan="3"> <group>
<group string="Request Information" col="4"> <group string="Request Information">
<field name="date" readonly="1" widget="date"/> <field name="date" readonly="1" widget="date"/>
<field name="by_purchase" groups="purchase.group_purchase_user"/> <field name="by_purchase" groups="purchase.group_purchase_user"/>
<field name="employee_id" attrs="{'readonly':[('by_purchase' , '=' , False)]}" required="1" <field name="employee_id" attrs="{'readonly':[('by_purchase' , '=' , False)]}" required="1"
@ -78,20 +78,18 @@
readonly="1" context="{'show_department_short': True}"/> readonly="1" context="{'show_department_short': True}"/>
<field name="branch_id" readonly="1" context="{'show_branch_short': True}"/> <field name="branch_id" readonly="1" context="{'show_branch_short': True}"/>
</group> </group>
<group string="Request Details" col="4"> <group string="Request Details">
<field name="product_category_ids" widget="many2many_tags"/> <field name="product_category_ids" widget="many2many_tags"/>
<field name="purchase_purpose" required="1" <field name="purchase_purpose" required="1"
attrs="{'readonly':[('state' , '!=' , 'draft')]}" attrs="{'readonly':[('state' , '!=' , 'draft')]}"
placeholder="Enter purchase request justifications..."/> placeholder="Enter purchase request justifications..."/>
</group> </group>
<group string="Vendor" col="4"> <group string="Vendor and Accounting">
<field name="partner_id" <field name="partner_id"
domain="[('supplier_rank','>', 0)]" domain="[('supplier_rank','>', 0)]"
options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}" options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}"
attrs="{'readonly':['|',('edit_partner_id' , '=' , False),('state' , '!=' , 'waiting')]}" attrs="{'readonly':['|',('edit_partner_id' , '=' , False),('state' , '!=' , 'waiting')]}"
help="Suggested vendor for this purchase request"/> help="Suggested vendor for this purchase request"/>
</group>
<group string="Accounting" col="4">
<field name="use_analytic"/> <field name="use_analytic"/>
<field name="account_analytic_id" <field name="account_analytic_id"
options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}" options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}"
@ -150,13 +148,12 @@
<field name="department_id" string="Department" context="{'show_department_short': True}"/> <field name="department_id" string="Department" context="{'show_department_short': True}"/>
<field name="branch_id" string="Branch" context="{'show_branch_short': True}"/> <field name="branch_id" string="Branch" context="{'show_branch_short': True}"/>
<field name="product_category_ids" widget="many2many_tags" string="Categories"/> <field name="product_category_ids" widget="many2many_tags" string="Categories"/>
<field name="state" string="State" <field name="state" string="State" widget="badge"
decoration-muted="state == 'draft'" decoration-muted="state == 'draft'"
decoration-warning="state in ['direct_manager', 'wait_for_send']" decoration-warning="state in ['direct_manager', 'wait_for_send']"
decoration-info="state in ['waiting', 'warehouse', 'initial', 'employee']" decoration-info="state in ['waiting', 'warehouse', 'initial', 'employee']"
decoration-success="state == 'done'" decoration-success="state == 'done'"
decoration-danger="state in ['cancel', 'refuse']" decoration-danger="state in ['cancel', 'refuse']"/>
decoration-bf="state in ['direct_manager', 'waiting', 'done']"/>
<field name="purchase_state_summary" optional="show" widget="badge" string="Purchase State"/> <field name="purchase_state_summary" optional="show" widget="badge" string="Purchase State"/>
</tree> </tree>
</field> </field>