Task-id : 2791237 PR : https://github.com/odoo/odoo/pull/87636 Allows customers to see a list of delivery carriers as shops in the website page; A delivery carrier may now be an onsite one, which means the client comes to the corresponding store to pickup the products. Also adds a payment acquirer based on wire transfer, for paying on site. The customer can only pay on site if he also comes to pick the product on site Notes : - If a warehouse is set on a delivery carrier, the sales order will take it's address. closes odoo/odoo#87636 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
17 lines
626 B
Python
17 lines
626 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class Website(models.Model):
|
|
_inherit = 'website'
|
|
|
|
picking_site_ids = fields.Many2many('delivery.carrier', string='Picking sites',
|
|
compute='_compute_picking_sites')
|
|
|
|
def _compute_picking_sites(self):
|
|
delivery_carriers = self.env['delivery.carrier'].search([('delivery_type', '=', 'onsite')])
|
|
for website in self:
|
|
website.picking_site_ids = delivery_carriers.filtered_domain([('website_id.id', '=', website.id)])
|