website.py 626 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import fields, models
  4. class Website(models.Model):
  5. _inherit = 'website'
  6. picking_site_ids = fields.Many2many('delivery.carrier', string='Picking sites',
  7. compute='_compute_picking_sites')
  8. def _compute_picking_sites(self):
  9. delivery_carriers = self.env['delivery.carrier'].search([('delivery_type', '=', 'onsite')])
  10. for website in self:
  11. website.picking_site_ids = delivery_carriers.filtered_domain([('website_id.id', '=', website.id)])