FB-026: Job Queue Fehler - TZA PROD

develop
Ahmed Aly 2018-11-12 16:06:48 +01:00
parent 73dd7ec7c3
commit ec2c82b3b2
1 changed files with 7 additions and 2 deletions

View File

@ -24,6 +24,7 @@ from odoo import fields, models, api, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
from odoo.addons.queue_job.job import job from odoo.addons.queue_job.job import job
class ProductXCategory(models.Model): class ProductXCategory(models.Model):
_name = 'product.xcategory' _name = 'product.xcategory'
_description = 'X-Kategorie' _description = 'X-Kategorie'
@ -174,8 +175,12 @@ class ProductPricelistItem(models.Model):
@api.multi @api.multi
@job @job
def job_mark_partner_for_export(self, pricelist_id): 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([('company_type', '=', 'company'), ('portal_id', '!=', False)])
todo_partner = self.env['res.partner']
for partner in partners: for partner in partners:
# Search ist auf die Preisliste nicht möglich, daher wird jeder Partner einzeln verglichen # 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:
partner.portal_export_pending = True todo_partner |= partner
todo_partner.write({
'portal_export_pending': True
})