Skip to Content
Menu
This question has been flagged
1 Reply
4065 Views

Hello


I develop addon for Point Of Sale (POS), but I have one problem.

for each product, my .js loads floor_sale_price_total. Defined in other addon, so it's in database.

With debug mode of my navigator, I see that my .js loads this attribute.

But my .xml says "undefined"(or hasn't number), if I change attribute 'floor_sale_price_total' by 'price' (attribute in the models.js of Point of Sale), I see the price of ech article.

So my problem is in my .js but I don't know where it's.



my .js

odoo.define('pos_min_price.PosModel', function(require){

"use strict";

    var models = require('point_of_sale.models');

    models.load_models({

        model: 'product.product',

fields: ['floor_sale_price_total'],

domain:[['sale_ok','=',true],['available_in_pos','=',true]],

context: function(self){ return {'floor_sale_price': self.floor_sale_price_total}},

loaded: function(self, products){

$.each(products, function(){

$.extend(self.db.get_product_by_id(this.id) || {}, this)

            });

        }

    })

})

Avatar
Discard
Best Answer

Hi Gael, apparently, in the pos_cache module, there is a set of values defined as the filed to be loaded in cache.

Maybe you could find the way to add new fields to this part.


regards

Avatar
Discard