Merge pull request #5413 from expsa/feature/purchase-department-context-20251113-182713

feat: add department context for short display in purchase views
This commit is contained in:
Mohamed Eltayar 2025-11-13 18:36:34 +03:00 committed by GitHub
commit 7c6e3e6bce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View File

@ -364,7 +364,7 @@ msgstr "الرئيس التنفيذي للإدارة (اكبر من او يسا
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
#, python-format
msgid "Choose A Department For this Employee!"
msgstr "اختر إدارة لهذا الموظف!"
msgstr "اختر قسماً لهذا الموظف!"
#. module: purchase_requisition_custom
#: 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_requisition__purchase_cost__department
msgid "Department"
msgstr "الإدارة"
msgstr "القسم"
#. module: purchase_requisition_custom
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order_line__department_name
msgid "Department Name"
msgstr "اسم الادارة"
msgstr "اسم القسم"
#. module: purchase_requisition_custom
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_request_line__description

View File

@ -66,7 +66,7 @@
<field name="picking_type_id" invisible="1"/>
<field name="department_id" force_save="1"
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="employee_id" attrs="{'readonly':[('by_purchase' , '=' , False)]}" required="1"
options="{'no_create' : True , 'no_edit' : True ,'no_open' : True}"/>
@ -135,7 +135,7 @@
<field name="name"/>
<field name="date"/>
<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="product_category_ids" widget="many2many_tags"/>
<field name="state"/>
@ -152,7 +152,7 @@
<search string="Purchase Request">
<field name="name" string="Request Number"/>
<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="purchase_purpose" string="Purpose"/>
<field name="partner_id" string="Vendor"/>
@ -197,7 +197,7 @@
<group expand="0" string="Group By">
<filter string="State" name="group_state" context="{'group_by':'state'}"/>
<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="Vendor" name="group_vendor" context="{'group_by':'partner_id'}"/>
<filter string="Request Type" name="group_type" context="{'group_by':'type'}"/>

View File

@ -304,7 +304,7 @@
<field name="no_of_approve" readonly="1"/>
<!--here -->
<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="purchase_request_employee_id"/>
<field name="purpose" attrs="{'readonly': [('state','in',['done','cancel'])]}"/>
@ -412,7 +412,7 @@
</xpath>
<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')],
'readonly': ['|', ('parent.state', '=', 'accept'), ('parent.order_count', '>', 0)]}"/>
'readonly': ['|', ('parent.state', '=', 'accept'), ('parent.order_count', '>', 0)]}" context="{'show_department_short': True}"/>
</xpath>
<xpath expr="/form/header/button[@name='action_done']" position="replace">
@ -483,7 +483,7 @@
attrs="{'readonly':[('state','in',('cancel','checked','done','waiting'))]}"/>
<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"
attrs="{'readonly':['|',('state','in',('cancel','checked','done','waiting')),('check_request','=',True)]}"/>