changes
This commit is contained in:
@@ -4626,11 +4626,13 @@ class SaleOrder(models.Model):
|
||||
f'Product price ${pm["product_price"]:.2f} vs Database ${pm["db_price"]:.2f}</li>'
|
||||
)
|
||||
mismatch_msg += '</ul><p>Database prices were used. Consider updating product prices.</p>'
|
||||
self.message_post(body=mismatch_msg, message_type='notification', subtype_xmlid='mail.mt_note')
|
||||
self.message_post(body=Markup(mismatch_msg), message_type='notification', subtype_xmlid='mail.mt_note')
|
||||
|
||||
# Auto-update product prices from database
|
||||
# Auto-update product prices from database (skip if managed via Many2one link)
|
||||
for pm in price_mismatches:
|
||||
product_tmpl = pm['product'].product_tmpl_id
|
||||
if product_tmpl.x_fc_adp_device_code_id:
|
||||
continue
|
||||
if hasattr(product_tmpl, 'x_fc_adp_price'):
|
||||
product_tmpl.sudo().write({'x_fc_adp_price': pm['db_price']})
|
||||
|
||||
@@ -6905,9 +6907,11 @@ class SaleOrder(models.Model):
|
||||
# Post to chatter
|
||||
days_since_billed = (today - order.x_fc_billing_date).days
|
||||
order.message_post(
|
||||
body=f'<p><strong><i class="fa fa-check-circle text-success"/> Case Automatically Closed</strong></p>'
|
||||
f'<p>This case has been automatically closed after {days_since_billed} days since billing.</p>'
|
||||
f'<p>Billing Date: {order.x_fc_billing_date}</p>',
|
||||
body=Markup(
|
||||
'<p><strong><i class="fa fa-check-circle text-success"/> Case Automatically Closed</strong></p>'
|
||||
'<p>This case has been automatically closed after %s days since billing.</p>'
|
||||
'<p>Billing Date: %s</p>'
|
||||
) % (days_since_billed, order.x_fc_billing_date),
|
||||
message_type='notification',
|
||||
subtype_xmlid='mail.mt_note',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user