fix: remove readonly from variant line model — use force_save in view

Odoo web client strips readonly field values during record creation,
so already_synced/wc_variation_id/map_id were always NULL. Removed
readonly from Python model, added force_save="1" in XML view to ensure
these tracking fields are persisted through the wizard lifecycle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-01 18:39:13 -04:00
parent 842832cc41
commit 71dea1f91b
2 changed files with 12 additions and 11 deletions

View File

@@ -340,15 +340,15 @@ class WooVariantPushLine(models.TransientModel):
_description = 'Variant Push Line'
wizard_id = fields.Many2one('woo.variant.push.wizard', ondelete='cascade')
product_id = fields.Many2one('product.product', string='Variant', readonly=True)
variant_name = fields.Char(string='Variant', readonly=True)
attribute_values = fields.Char(string='Attributes', readonly=True)
product_id = fields.Many2one('product.product', string='Variant')
variant_name = fields.Char(string='Variant')
attribute_values = fields.Char(string='Attributes')
sku = fields.Char(string='SKU')
regular_price = fields.Float(string='Standard Price', digits='Product Price')
sale_price = fields.Float(string='Sale Price', digits='Product Price')
cost_price = fields.Float(string='Cost', digits='Product Price')
image = fields.Binary(string='Image')
include = fields.Boolean(string='Include', default=True)
already_synced = fields.Boolean(string='Already Synced', readonly=True)
wc_variation_id = fields.Integer(string='WC Variation ID', readonly=True)
already_synced = fields.Boolean(string='Already Synced')
wc_variation_id = fields.Integer(string='WC Variation ID')
map_id = fields.Integer(string='Map Record ID')