This commit is contained in:
gsinghpal
2026-05-21 05:18:32 -04:00
parent d6d6249857
commit b395600a1c
9 changed files with 103 additions and 47 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from datetime import timedelta
from datetime import datetime, time, timedelta
from odoo import _, api, fields, models
from odoo.exceptions import UserError
@@ -530,7 +530,15 @@ class FpDirectOrderWizard(models.Model):
'x_fc_customer_job_number': self.customer_job_number or False,
'x_fc_planned_start_date': self.planned_start_date,
'x_fc_internal_deadline': self.internal_deadline,
'commitment_date': self.customer_deadline,
# commitment_date is a Datetime; customer_deadline is a Date.
# Assigning a bare Date stores midnight UTC, which renders as
# the PREVIOUS day in any negative-UTC timezone (Eastern shifts
# May 25 00:00 UTC → May 24 8pm). Combining with noon keeps
# the date stable across all reasonable user timezones.
'commitment_date': (
datetime.combine(self.customer_deadline, time(12, 0))
if self.customer_deadline else False
),
'x_fc_invoice_strategy': self.invoice_strategy,
'x_fc_deposit_percent': self.deposit_percent,
'x_fc_progress_initial_percent': self.progress_initial_percent,

View File

@@ -95,7 +95,13 @@
<group string="Scheduling">
<field name="planned_start_date"/>
<field name="internal_deadline"/>
<field name="customer_deadline"/>
<!-- Labelled "Delivery Date" here to match
the SO header field of the same name —
same field, same value, just consistent
wording end-to-end. Backing field is
still `customer_deadline` (wizard) →
`commitment_date` (SO). -->
<field name="customer_deadline" string="Delivery Date"/>
<field name="is_blanket_order"/>
<field name="block_partial_shipments"/>
</group>