[IMP] hr_luncheon_voucher: search of Luncheon Voucher
add search by employee and distrib_campaign_name, whatever the company
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from xml.dom.minicompat import EmptyNodeList
|
from xml.dom.minicompat import EmptyNodeList
|
||||||
from odoo import fields, models
|
from odoo import fields, models, api
|
||||||
|
|
||||||
|
|
||||||
class HrEmployeeBase(models.AbstractModel):
|
class HrEmployeeBase(models.AbstractModel):
|
||||||
@@ -72,3 +72,12 @@ class HrEmployeeBase(models.AbstractModel):
|
|||||||
ctx["active_ids"] = self.ids
|
ctx["active_ids"] = self.ids
|
||||||
action["context"] = ctx
|
action["context"] = ctx
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _name_search(self, name='', args=None, operator='ilike', limit=100, name_get_uid=None):
|
||||||
|
"""
|
||||||
|
On lv allocation, allow employee search on all companies
|
||||||
|
"""
|
||||||
|
if self.env.context.get('search_all_campanies'):
|
||||||
|
return super(HrEmployeeBase, self.sudo())._name_search(name, args, operator, limit, name_get_uid)
|
||||||
|
return super(HrEmployeeBase, self)._name_search(name, args, operator, limit, name_get_uid)
|
@@ -7,6 +7,8 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Luncheon vouchers allocations">
|
<search string="Luncheon vouchers allocations">
|
||||||
<field name="state" />
|
<field name="state" />
|
||||||
|
<field name="employee_id" context="{'search_all_campanies':True}" />
|
||||||
|
<field name="distrib_campaign_name" />
|
||||||
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
|
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
|
||||||
<filter name="confirmed" string="Confirmed" domain="[('state', '=', 'confirmed')]" />
|
<filter name="confirmed" string="Confirmed" domain="[('state', '=', 'confirmed')]" />
|
||||||
<filter name="distributed" string="Distributed"
|
<filter name="distributed" string="Distributed"
|
||||||
|
Reference in New Issue
Block a user