folder rename
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FpRouteStop(models.Model):
|
||||
"""A single stop on a route.
|
||||
|
||||
A stop is one of: pickup, delivery, transfer (between facilities),
|
||||
fuel, or break. Pickup and delivery stops link back to the source
|
||||
records so the driver can open them from the route. Non-transactional
|
||||
stops (fuel, break) just carry an address and a planned time.
|
||||
"""
|
||||
_name = 'fusion.plating.route.stop'
|
||||
_description = 'Fusion Plating — Route Stop'
|
||||
_order = 'route_id, sequence, id'
|
||||
|
||||
route_id = fields.Many2one(
|
||||
'fusion.plating.route',
|
||||
string='Route',
|
||||
required=True,
|
||||
ondelete='cascade',
|
||||
)
|
||||
sequence = fields.Integer(
|
||||
string='Sequence',
|
||||
default=10,
|
||||
)
|
||||
stop_type = fields.Selection(
|
||||
[
|
||||
('pickup', 'Pickup'),
|
||||
('delivery', 'Delivery'),
|
||||
('transfer', 'Facility Transfer'),
|
||||
('fuel', 'Fuel'),
|
||||
('break', 'Break'),
|
||||
],
|
||||
string='Stop Type',
|
||||
default='pickup',
|
||||
required=True,
|
||||
)
|
||||
pickup_request_id = fields.Many2one(
|
||||
'fusion.plating.pickup.request',
|
||||
string='Pickup Request',
|
||||
)
|
||||
delivery_id = fields.Many2one(
|
||||
'fusion.plating.delivery',
|
||||
string='Delivery',
|
||||
)
|
||||
address_id = fields.Many2one(
|
||||
'res.partner',
|
||||
string='Address',
|
||||
)
|
||||
planned_time = fields.Datetime(
|
||||
string='Planned Time',
|
||||
)
|
||||
actual_time = fields.Datetime(
|
||||
string='Actual Time',
|
||||
)
|
||||
state = fields.Selection(
|
||||
[
|
||||
('pending', 'Pending'),
|
||||
('arrived', 'Arrived'),
|
||||
('completed', 'Completed'),
|
||||
('skipped', 'Skipped'),
|
||||
],
|
||||
string='Status',
|
||||
default='pending',
|
||||
required=True,
|
||||
)
|
||||
notes = fields.Text(
|
||||
string='Notes',
|
||||
)
|
||||
|
||||
def action_mark_arrived(self):
|
||||
self.write({
|
||||
'state': 'arrived',
|
||||
'actual_time': fields.Datetime.now(),
|
||||
})
|
||||
|
||||
def action_mark_completed(self):
|
||||
self.write({'state': 'completed'})
|
||||
|
||||
def action_mark_skipped(self):
|
||||
self.write({'state': 'skipped'})
|
||||
Reference in New Issue
Block a user