[FIX] purchase_product_matrix: avoid crash on product reorder

Open a purchase order with several lines
Switch to Edit mode
Use the movement arrow on the left of a line to move it upward/downward
At the end of the operation a traceback will popup

opw-2508480

closes odoo/odoo#69724

X-original-commit: 0d7c9db6d17e3268ae01a5b2d79b513c5b24a34f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2021-04-22 17:51:47 +00:00
parent 8cae451d58
commit b937c3fdfa
@@ -99,7 +99,7 @@ var MatrixConfiguratorWidget = relationalFields.FieldMany2One.extend({
*/
reset: async function (record, ev) {
await this._super(...arguments);
if (ev.data.changes && ev.data.changes.product_template_id && record.data.product_template_id.data.id) {
if (ev && ev.data.changes && ev.data.changes.product_template_id && record.data.product_template_id.data.id) {
this._onTemplateChange(record.data.product_template_id.data.id, ev.data.dataPointID);
}
},