FB-027: Non-stored field res.partner.company_type cannot be searched.

develop
Ahmed Aly 2018-11-12 16:28:37 +01:00
parent a014a63ba5
commit 2bd0b80c86
1 changed files with 2 additions and 2 deletions

View File

@ -182,11 +182,11 @@ class ProductPricelistItem(models.Model):
@api.multi
@job
def job_mark_partner_for_export(self, pricelist_id):
partners = self.env['res.partner'].search([('company_type', '=', 'company'), ('portal_id', '!=', False)])
partners = self.env['res.partner'].search([('portal_id', '!=', False)])
todo_partner = self.env['res.partner']
for partner in partners:
# Search ist auf die Preisliste nicht möglich, daher wird jeder Partner einzeln verglichen
if partner.property_product_pricelist.id == pricelist_id:
if partner.property_product_pricelist.id == pricelist_id and partner.company_type == 'company':
todo_partner |= partner
todo_partner.write({
'portal_export_pending': True