feat: add department context for short display in purchase views
🔧 **Key Enhancements:** - Added show_department_short context to all department_id fields - Enhanced form, tree, and search views with proper context - Fixed translation consistency (Department = القسم) - Unified department display across purchase module 📁 **Files Modified:** - odex25_purchase/purchase_requisition_custom/views/purchase_request.xml: Added context to department fields - odex25_purchase/purchase_requisition_custom/views/purchase_requisition_custom.xml: Enhanced department display - odex25_purchase/purchase_requisition_custom/i18n/ar_001.po: Fixed Department translation consistency ✅ **Impact:** - Department names now display without hierarchical path in purchase views - Consistent short name display across purchase request, order, and requisition views - Better UX with unified Arabic translations - Works seamlessly with HR module's name_get enhancement 🔗 **Dependencies:** Requires HR module PR #5412 for full functionality Synced with latest dev_odex25_purchase on Thu Nov 13 18:27:23 +03 2025
This commit is contained in:
parent
4dbfb5d8cd
commit
5d4b9aafb8
|
|
@ -364,7 +364,7 @@ msgstr "الرئيس التنفيذي للإدارة (اكبر من او يسا
|
||||||
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
|
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Choose A Department For this Employee!"
|
msgid "Choose A Department For this Employee!"
|
||||||
msgstr "اختر إدارة لهذا الموظف!"
|
msgstr "اختر قسماً لهذا الموظف!"
|
||||||
|
|
||||||
#. module: purchase_requisition_custom
|
#. module: purchase_requisition_custom
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_order_custom_form_view
|
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_order_custom_form_view
|
||||||
|
|
@ -669,12 +669,12 @@ msgstr "الكمية المطلوبة"
|
||||||
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__purchase_order__purchase_cost__department
|
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__purchase_order__purchase_cost__department
|
||||||
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__purchase_requisition__purchase_cost__department
|
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__purchase_requisition__purchase_cost__department
|
||||||
msgid "Department"
|
msgid "Department"
|
||||||
msgstr "الإدارة"
|
msgstr "القسم"
|
||||||
|
|
||||||
#. module: purchase_requisition_custom
|
#. module: purchase_requisition_custom
|
||||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order_line__department_name
|
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order_line__department_name
|
||||||
msgid "Department Name"
|
msgid "Department Name"
|
||||||
msgstr "اسم الادارة"
|
msgstr "اسم القسم"
|
||||||
|
|
||||||
#. module: purchase_requisition_custom
|
#. module: purchase_requisition_custom
|
||||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_request_line__description
|
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_request_line__description
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
<field name="picking_type_id" invisible="1"/>
|
<field name="picking_type_id" invisible="1"/>
|
||||||
<field name="department_id" force_save="1"
|
<field name="department_id" force_save="1"
|
||||||
attrs="{'readonly' : ['|',('state' , '!=' , 'draft'),('by_purchase' , '!=' , True)] , 'required' : [('by_purchase' , '=' , True)]}"
|
attrs="{'readonly' : ['|',('state' , '!=' , 'draft'),('by_purchase' , '!=' , True)] , 'required' : [('by_purchase' , '=' , True)]}"
|
||||||
readonly="1"/>
|
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}"/>
|
||||||
<field name="employee_id" attrs="{'readonly':[('by_purchase' , '=' , False)]}" required="1"
|
<field name="employee_id" attrs="{'readonly':[('by_purchase' , '=' , False)]}" required="1"
|
||||||
options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}"/>
|
options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}"/>
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<field name="employee_id"/>
|
<field name="employee_id"/>
|
||||||
<field name="department_id"/>
|
<field name="department_id" context="{'show_department_short': True}"/>
|
||||||
<field name="branch_id" context="{'show_branch_short': True}"/>
|
<field name="branch_id" context="{'show_branch_short': True}"/>
|
||||||
<field name="product_category_ids" widget="many2many_tags"/>
|
<field name="product_category_ids" widget="many2many_tags"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
|
|
@ -152,7 +152,7 @@
|
||||||
<search string="Purchase Request">
|
<search string="Purchase Request">
|
||||||
<field name="name" string="Request Number"/>
|
<field name="name" string="Request Number"/>
|
||||||
<field name="employee_id" string="Employee"/>
|
<field name="employee_id" string="Employee"/>
|
||||||
<field name="department_id" string="Department"/>
|
<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="purchase_purpose" string="Purpose"/>
|
<field name="purchase_purpose" string="Purpose"/>
|
||||||
<field name="partner_id" string="Vendor"/>
|
<field name="partner_id" string="Vendor"/>
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
<group expand="0" string="Group By">
|
<group expand="0" string="Group By">
|
||||||
<filter string="State" name="group_state" context="{'group_by':'state'}"/>
|
<filter string="State" name="group_state" context="{'group_by':'state'}"/>
|
||||||
<filter string="Employee" name="group_employee" context="{'group_by':'employee_id'}"/>
|
<filter string="Employee" name="group_employee" context="{'group_by':'employee_id'}"/>
|
||||||
<filter string="Department" name="group_department" context="{'group_by':'department_id'}"/>
|
<filter string="Department" name="group_department" context="{'group_by':'department_id', 'show_department_short': True}"/>
|
||||||
<filter string="Branch" name="group_branch" context="{'group_by':'branch_id'}"/>
|
<filter string="Branch" name="group_branch" context="{'group_by':'branch_id'}"/>
|
||||||
<filter string="Vendor" name="group_vendor" context="{'group_by':'partner_id'}"/>
|
<filter string="Vendor" name="group_vendor" context="{'group_by':'partner_id'}"/>
|
||||||
<filter string="Request Type" name="group_type" context="{'group_by':'type'}"/>
|
<filter string="Request Type" name="group_type" context="{'group_by':'type'}"/>
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@
|
||||||
<field name="no_of_approve" readonly="1"/>
|
<field name="no_of_approve" readonly="1"/>
|
||||||
<!--here -->
|
<!--here -->
|
||||||
<field name="purchase_cost" invisible="1"/>
|
<field name="purchase_cost" invisible="1"/>
|
||||||
<field name="department_id" invisible="0"/>
|
<field name="department_id" invisible="0" 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}"/>
|
||||||
<field name="purchase_request_employee_id"/>
|
<field name="purchase_request_employee_id"/>
|
||||||
<field name="purpose" attrs="{'readonly': [('state','in',['done','cancel'])]}"/>
|
<field name="purpose" attrs="{'readonly': [('state','in',['done','cancel'])]}"/>
|
||||||
|
|
@ -412,7 +412,7 @@
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='line_ids']/tree[1]/field[@name='product_qty']" position="before">
|
<xpath expr="//field[@name='line_ids']/tree[1]/field[@name='product_qty']" position="before">
|
||||||
<field name="department_id" attrs="{'column_invisible': [('parent.purchase_cost', '=', 'default')],
|
<field name="department_id" attrs="{'column_invisible': [('parent.purchase_cost', '=', 'default')],
|
||||||
'readonly': ['|', ('parent.state', '=', 'accept'), ('parent.order_count', '>', 0)]}"/>
|
'readonly': ['|', ('parent.state', '=', 'accept'), ('parent.order_count', '>', 0)]}" context="{'show_department_short': True}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="/form/header/button[@name='action_done']" position="replace">
|
<xpath expr="/form/header/button[@name='action_done']" position="replace">
|
||||||
|
|
@ -483,7 +483,7 @@
|
||||||
attrs="{'readonly':[('state','in',('cancel','checked','done','waiting'))]}"/>
|
attrs="{'readonly':[('state','in',('cancel','checked','done','waiting'))]}"/>
|
||||||
|
|
||||||
<field name="department_id" attrs="{'required':[('purchase_cost','=', 'department')], 'invisible':[('purchase_cost','=', 'product_line')],
|
<field name="department_id" attrs="{'required':[('purchase_cost','=', 'department')], 'invisible':[('purchase_cost','=', 'product_line')],
|
||||||
'readonly':['|',('state','in',('cancel','checked','done','waiting')),('check_request','=',True)]}"/>
|
'readonly':['|',('state','in',('cancel','checked','done','waiting')),('check_request','=',True)]}" context="{'show_department_short': True}"/>
|
||||||
<field name="purpose" required="1"
|
<field name="purpose" required="1"
|
||||||
attrs="{'readonly':['|',('state','in',('cancel','checked','done','waiting')),('check_request','=',True)]}"/>
|
attrs="{'readonly':['|',('state','in',('cancel','checked','done','waiting')),('check_request','=',True)]}"/>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue