Fix UI/UX issues: standardize button classes, simplify group layout, add badge widget for state field

- Changed button classes to standard Odoo classes (btn-primary, btn-danger, btn-secondary)
- Simplified form layout from 4 groups to 3 groups to avoid overlapping
- Combined Vendor and Accounting groups for better space utilization
- Added badge widget to state field in tree view for better visual representation
- Updated Arabic translations for new group title
This commit is contained in:
maltayyar2 2025-11-20 16:37:16 +03:00
parent d9f5a250d4
commit 4010ab5d82
1 changed files with 12 additions and 15 deletions

View File

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