Odoo Help

0

[POS] push the new variable in the cache with .js file

By
Gael Torrecillas
on 1/12/16, 8:40 AM 767 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)

            });

        }

    })

})

0
Mind And Go
On 1/31/16, 4:18 PM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/12/16, 8:40 AM
Seen: 767 times
Last updated: 1/31/16, 4:20 PM