diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index 1f8f4e1b..6ac72718 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -24,6 +24,7 @@ from odoo import fields, models, api, _ from odoo.exceptions import ValidationError from odoo.addons.queue_job.job import job + class ProductXCategory(models.Model): _name = 'product.xcategory' _description = 'X-Kategorie' @@ -174,8 +175,12 @@ 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([('company_type', '=', 'company'), ('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: - partner.portal_export_pending = True \ No newline at end of file + todo_partner |= partner + todo_partner.write({ + 'portal_export_pending': True + })