[FIX] pos_self_order: condition opening product window
Nothing will happen if you click on a product without image, sale comment and attributes in selfOder if no table was selected before. To reproduce the issue: 1. Create a product without image, sale comment and attributes (Fill in product name, price, availible in pos) 2. Open a new selfOrder page (without a table selected) 3. Click on the product Issue: nothing happens, the product cannot be ordered. If no product meets at least one of the three conditions (image, sale comment or attributes), it will not be possible to select the table, and thus self-ordering will be impossible. In fact the table selection only happens during the first order. closes odoo/odoo#130614 X-original-commit: 186d60e57da5a5b0182131a936838821a01a7a5f Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -24,21 +24,9 @@ export class ProductCard extends Component {
|
||||
|
||||
clickOnProduct() {
|
||||
const product = this.props.product;
|
||||
if (!this.canOpenProductMainView(product)) {
|
||||
return;
|
||||
}
|
||||
this.router.navigate("product", { id: product.id });
|
||||
}
|
||||
|
||||
canOpenProductMainView(product) {
|
||||
return (
|
||||
this.selfOrder.table ||
|
||||
product.has_image ||
|
||||
product.description_sale ||
|
||||
product.attributes.length
|
||||
);
|
||||
}
|
||||
|
||||
getQtyInCartString() {
|
||||
// FIXME need to implement price_extra
|
||||
const productId = this.props.line.product_id;
|
||||
|
||||
@@ -23,6 +23,9 @@ registry.category("web_tour.tours").add("self_order_after_meal_cart_tour", {
|
||||
...PosSelf.action.addProduct("Office Chair Black", 1),
|
||||
...PosSelf.action.addProduct("Office Chair Black", 2, "Description"),
|
||||
...PosSelf.action.addProduct("Large Cabinet", 2),
|
||||
// When clicking on basic product (without image, sale description and attributes) it
|
||||
// displays the product window.
|
||||
...PosSelf.action.addProduct("Virtual Home Staging", 1),
|
||||
PosSelf.action.clickPrimaryBtn("Review"),
|
||||
|
||||
// Here we're looking at whether when an orderline is clicked on from
|
||||
|
||||
Reference in New Issue
Block a user