Wednesday, November 11, 2020

odoo 14: point of sale show qty_available

 

edit /odoo/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductItem.xml line 9 as below:

            <div class="product-img">
                <img t-att-src="imageUrl" t-att-alt="props.product.display_name" />

                <span class="qty_available">
                    <t t-esc="props.product.qty_available" />
                </span>

                <span class="price-tag">
                    <t t-esc="price" />
                </span>

            </div>

edit /odoo/addons/point_of_sale/static/src/css/pos.css add at line about 1202

.pos .product .qty_available {
    position: absolute;
    top: 2px;
    left: 2px;
    vertical-align: top;
    color: white;
    line-height: 13px;
    background: #7f82ac;
    padding: 2px 5px;
    border-radius: 2px;
}

Tuesday, November 10, 2020

odoo 14: point of sale filter pos with on hand quantity

 

we only want to show product with on hand quantity

edit /odoo/addons/point_of_sale/static/src/js/models.js

start at line 413, edit line 419 var domain
        model:  'product.product',
        fields: ['display_name', 'lst_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id',
                 'barcode', 'default_code', 'to_weight', 'uom_id', 'description_sale', 'description',
                 'product_tmpl_id','tracking', 'write_date', 'available_in_pos', 'attribute_line_ids'],
        order:  _.map(['sequence','default_code','name'], function (name) { return {name: name}; }),
        domain: function(self){
            var domain = ['&', '&', '&', ['sale_ok','=',true],['available_in_pos','=',true],'|',['company_id','=',self.config.company_id[0]],['company_id','=',false], ['qty_available', '>', 0]]; // edit here

add '&' and ['qty_available', '>', 0] like above

reference:

https://www.odoo.com/forum/help-1/question/automatically-remove-products-from-pos-when-products-are-out-of-stock-in-v8-0-123229