Files
odoo_source/addons/website_sale_picking/models/website.py
T
Bastien Dosimont 5b5150dfa5 [ADD] website_sale_onsite : Asking to pay/ship at physical store
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>
2022-05-25 09:45:07 +02:00

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)])