mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
19 lines
664 B
Python
19 lines
664 B
Python
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class StockDeliveryPlanner(models.TransientModel):
|
|
_inherit = 'stock.delivery.planner'
|
|
|
|
def action_plan(self):
|
|
res = super().action_plan()
|
|
puro_package_options = self.plan_option_ids.filtered(
|
|
lambda o: (o.package_id
|
|
and o.selection == 'selected'
|
|
and o.carrier_id.delivery_type == 'purolator'
|
|
))
|
|
if puro_package_options:
|
|
self.picking_id.carrier_price = sum(puro_package_options.mapped('price'))
|
|
return res
|