@@ -10,23 +10,33 @@ class ProductProduct(models.Model):
10
10
_inherit = "product.product"
11
11
12
12
@api .model
13
- def _search (self , args , offset = 0 , limit = None , order = None , count = False ,
14
- access_rights_uid = None ):
15
- use_only_supplied_product = self .env .context .get (
16
- 'use_only_supplied_product' )
13
+ def _search (
14
+ self ,
15
+ args ,
16
+ offset = 0 ,
17
+ limit = None ,
18
+ order = None ,
19
+ count = False ,
20
+ access_rights_uid = None ,
21
+ ):
22
+ use_only_supplied_product = self .env .context .get ("use_only_supplied_product" )
17
23
if use_only_supplied_product :
18
- restrict_supplier_id = self .env .context .get (' restrict_supplier_id' )
19
- seller = self .env [' res.partner' ].browse (restrict_supplier_id )
24
+ restrict_supplier_id = self .env .context .get (" restrict_supplier_id" )
25
+ seller = self .env [" res.partner" ].browse (restrict_supplier_id )
20
26
seller = seller .commercial_partner_id
21
- supplierinfos = self .env ['product.supplierinfo' ].search (
22
- [('name' , '=' , seller .id )])
27
+ supplierinfos = self .env ["product.supplierinfo" ].search (
28
+ [("name" , "=" , seller .id )]
29
+ )
23
30
args += [
24
- '|' ,
25
- ('product_tmpl_id' , 'in' ,
26
- supplierinfos .mapped ('product_tmpl_id' ).ids ),
27
- ('id' , 'in' ,
28
- supplierinfos .mapped ('product_id' ).ids )
31
+ "|" ,
32
+ ("product_tmpl_id" , "in" , supplierinfos .mapped ("product_tmpl_id" ).ids ),
33
+ ("id" , "in" , supplierinfos .mapped ("product_id" ).ids ),
29
34
]
30
35
return super ()._search (
31
- args , offset = offset , limit = limit , order = order , count = count ,
32
- access_rights_uid = access_rights_uid )
36
+ args ,
37
+ offset = offset ,
38
+ limit = limit ,
39
+ order = order ,
40
+ count = count ,
41
+ access_rights_uid = access_rights_uid ,
42
+ )
0 commit comments