| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <odoo> |
| 3 | |
| 4 | <template id="unavailable_products_warning"> |
| 5 | <div |
| 6 | name="unavailable_products_warning" |
| 7 | t-attf-class="alert alert-warning mt-3 mb-2 {{'' if is_selected else 'd-none'}}" |
| 8 | > |
| 9 | <div class="ms-1"> |
| 10 | Some of the products are not available at <strong><t t-out="wh_name"/></strong>. |
| 11 | </div> |
| 12 | <div |
| 13 | t-foreach="insufficient_stock_data.items()" |
| 14 | t-as="item" |
| 15 | t-attf-class="d-flex gap-3 mt-3 position-relative" |
| 16 | > |
| 17 | <t t-set="order_line" t-value="item[0]"/> |
| 18 | <t t-set="available_qty" t-value="int(item[1])"/> |
| 19 | <div class="d-flex align-items-top gap-2"> |
| 20 | <a t-att-href="order_line.product_id.website_url"> |
| 21 | <span |
| 22 | t-field="order_line.product_id.image_128" |
| 23 | t-options="{'widget': 'image', 'qweb_img_responsive': False, 'class': 'o_image_64_max rounded border border-warning-subtle'}" |
| 24 | /> |
| 25 | </a> |
| 26 | </div> |
| 27 | <div> |
| 28 | <t |
| 29 | t-set="attrib_names" |
| 30 | t-value="order_line.product_id.product_template_attribute_value_ids._get_combination_name()" |
| 31 | /> |
| 32 | <div class="fw-bold"> |
| 33 | <t t-out="order_line.product_id.name"/> |
| 34 | <t t-if="attrib_names" t-out="' - ' + attrib_names"/> |
| 35 | <t |
| 36 | t-if="order_line.product_id.product_tmpl_id._has_multiple_uoms()" |
| 37 | t-out="' (' + order_line.product_uom_id.name + ')'" |
| 38 | /> |
| 39 | </div> |
| 40 | <div t-out="order_line._get_shop_warning()"/> |
| 41 | <div name="o_wsale_unavailable_line_button_container" class="mt-2 mt-md-1"> |
| 42 | <a href='#' class="alert-link me-2 small"> |
| 43 | <i |
| 44 | t-attf-class="fa fa-fw {{'fa-refresh' if available_qty else 'fa-trash-o'}}" |
| 45 | role="presentation" |
| 46 | aria-label="Update cart quantities" |
| 47 | /> |
| 48 | <t t-set="update_cart_button_label">Update cart with available stock</t> |
| 49 | <t t-set="remove_from_cart_button_label">Remove</t> |
| 50 | <span |
| 51 | class="js_wsc_update_product_qty" |
| 52 | t-att-data-line-id="order_line.id" |
| 53 | t-att-data-product-id="order_line.product_id.id" |
| 54 | t-att-data-available-qty="available_qty" |
| 55 | t-out="update_cart_button_label if available_qty else remove_from_cart_button_label" |
| 56 | /> |
| 57 | </a> |
| 58 | </div> |
| 59 | </div> |
| 60 | </div> |
| 61 | </div> |
| 62 | </template> |
| 63 | |
| 64 | <template id="in_store_delivery_method" inherit_id="website_sale.delivery_method"> |
| 65 | <xpath expr="//t[@t-set='is_pickup_needed']" position="attributes"> |
| 66 | <attribute name="t-value" add="dm.delivery_type=='in_store'" separator=" or "/> |
| 67 | </xpath> |
| 68 | <t t-set="pickup_location_data" position="after"> |
| 69 | <t t-if="not pickup_location_data and default_pickup_locations.get(dm.id)"> |
| 70 | <t |
| 71 | t-set="pickup_location_data" |
| 72 | t-value="default_pickup_locations[dm.id].get('pickup_location_data', {})" |
| 73 | /> |
| 74 | <t |
| 75 | t-set="insufficient_stock_data" |
| 76 | t-value="default_pickup_locations[dm.id].get('insufficient_stock_data', {})" |
| 77 | /> |
| 78 | </t> |
| 79 | </t> |
| 80 | <span name="o_delivery_method_name" position="before"> |
| 81 | <i |
| 82 | t-if="request.website.sudo().in_store_dm_id" |
| 83 | t-attf-class="fa fa-fw {{'fa-map-marker' if dm.delivery_type == 'in_store' else 'fa-truck'}} me-1" |
| 84 | role="presentation" |
| 85 | aria-label="Delivery method" |
| 86 | /> |
| 87 | </span> |
| 88 | <div name="o_pickup_location" position="after"> |
| 89 | <t t-if="dm.delivery_type=='in_store' and pickup_location_data"> |
| 90 | <t |
| 91 | t-if="insufficient_stock_data" |
| 92 | t-call="website_sale_collect.unavailable_products_warning" |
| 93 | > |
| 94 | <t t-set="wh_name" t-value="pickup_location_data.get('name')"/> |
| 95 | </t> |
| 96 | </t> |
| 97 | </div> |
| 98 | </template> |
| 99 | |
| 100 | </odoo> |