You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
747 B
23 lines
747 B
# © 2019 Le Filament (<http://www.le-filament.com>)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import fields, models, api
|
|
|
|
|
|
class VracoopWebsite(models.Model):
|
|
_inherit = 'website'
|
|
|
|
type_livraison = fields.Boolean(
|
|
"Est de type livraison",
|
|
compute='_compute_type_livraison')
|
|
|
|
@api.model
|
|
def _compute_type_livraison(self):
|
|
for website in self:
|
|
delivery_carriers = self.env['delivery.carrier'].sudo().search([
|
|
('website_published', '=', True),
|
|
('type_carrier', '=', 'livraison')])
|
|
if delivery_carriers:
|
|
website.type_livraison = True
|
|
else:
|
|
website.type_livraison = False
|