[FIX] point_of_sale: prevent error with missing default pricelist

Prior to this commit, adding more than one pricelist to the available
pricelists and attempting to create a partner from the Point of Sale
would result in an error.

opw-3703269

closes odoo/odoo#153314

X-original-commit: 462ff7c657c22c29ffc2c522afdc9fd99068d6fb
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (pebr)
2024-02-09 11:57:29 +00:00
parent b499ab0540
commit df79efa9a4
@@ -66,7 +66,7 @@
<label class="form-label label" for="pricelist">Pricelist</label>
<select class="detail form-select" id="pricelist" name="property_product_pricelist" t-model="changes.property_product_pricelist" t-att="{'disabled': isFieldCommercialAndPartnerIsChild('property_product_pricelist')}" t-att-class="{'border-danger': missingFields.includes('property_product_pricelist')}">
<t t-foreach="pos.pricelists" t-as="pricelist" t-key="pricelist.id">
<option t-att-value="pricelist.id" t-att-selected="props.partner.property_product_pricelist ? (pricelist.id === props.partner.property_product_pricelist[0] ? true : undefined) : pricelist.id === pos.default_pricelist.id ? true : undefined">
<option t-att-value="pricelist.id" t-att-selected="props.partner.property_product_pricelist ? (pricelist.id === props.partner.property_product_pricelist[0] ? true : undefined) : pricelist.id === pos.default_pricelist?.id ? true : undefined">
<t t-esc="pricelist.display_name" />
</option>
</t>