Files
suite/sale_planner/models/sale.py
Jared Kipe 162546faee [REL] delivery_fedex_hibou,delivery_gso,delivery_hibou,delivery_ups_hibou,sale_planner,stock_delivery_planner: per-package tracking from 11.0
Additional changes/fixes applied due to testing, e.g. transit time calculations for UPS.
2022-02-07 17:30:25 -08:00

18 lines
557 B
Python

# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
def action_planorder(self):
plan_obj = self.env['sale.order.make.plan']
for order in self:
plan = plan_obj.create({
'order_id': order.id,
})
action = self.env.ref('sale_planner.action_plan_sale_order').read()[0]
action['res_id'] = plan.id
return action