Files
Odoo-Modules/fusion_shipping/models/stock_picking.py
Nexa Admin 431052920e feat: separate fusion field service and LTC into standalone modules, update core modules
- fusion_claims: separated field service logic, updated controllers/views
- fusion_tasks: updated task views and map integration
- fusion_authorizer_portal: added page 11 signing, schedule booking, migrations
- fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator)
- fusion_ltc_management: new standalone LTC management module
2026-03-11 16:19:52 +00:00

35 lines
1.0 KiB
Python

from odoo import models, fields
class StockPicking(models.Model):
_inherit = 'stock.picking'
fusion_shipment_count = fields.Integer(
string='Shipments',
compute='_compute_fusion_shipment_count',
)
def _compute_fusion_shipment_count(self):
Shipment = self.env['fusion.shipment']
for picking in self:
picking.fusion_shipment_count = Shipment.search_count(
[('picking_id', '=', picking.id)]
)
def action_view_fusion_shipments(self):
self.ensure_one()
shipments = self.env['fusion.shipment'].search(
[('picking_id', '=', self.id)]
)
action = {
'type': 'ir.actions.act_window',
'name': 'Shipments',
'res_model': 'fusion.shipment',
'view_mode': 'list,form',
'domain': [('picking_id', '=', self.id)],
}
if len(shipments) == 1:
action['view_mode'] = 'form'
action['res_id'] = shipments.id
return action