This question has been flagged
1 Reply
5397 Views

Hello everybody,

I want to modify the method which display the product's price in list price. To do that i followed the answer posted in another question (not enough karma to post link sorry) but it's not work with my code:

openerp.openerp_pos_models_ttc = function(instance) {
    instance.openerp_pos_models_ttc = {};
    var module = instance.point_of_sale;
    var _super_ = module.Orderline.prototype.get_display_price;
    module.Orderline.prototype.get_display_price = function(){
        console.log('display price');
        _super_.call(this);
        return 1000;
    };

};

What am i doing wrong?

There is my __openerp__.py :

{
'name': 'pos_ttc',
    'version': '1.0',
    'category': 'Sales Management',
    'description': """
        """,
    'depends': ['point_of_sale'],
    'data': [
    ],
    'demo':
        [
    ],
    'test':
        [
    ],
    'js': [
    'static/src/js/models_ttc.js',
    #'static/src/js/main.js',
    ],
    'installable':
        True,
    'auto_install':
        False,
}

I work on OpenERP 7.

Thanks.

Avatar
Discard

What are you trying to do? What error you get? Because your code work for me, when I push an article I got in the order list that article with price 1000. Be aware that this method don't modify the price value in the item box, but in the buy item list.

Author

I just want to include the product tax in the price in order list (the calculation will do in second step when i have inherit a javascript method with success) . I don't have any error, it just do nothing. When put a breakpoint in openerp_pos_models_ttc function he never stop on it, like he never pass into this function, and when i try step by step he just jump at the end of the function.

Author Best Answer

Finally i found why it won't work: I have created a main.js and his line in __openerp__.py but I commented it with my last sample of code which don't need it. Unfortunally this file is still active or something that because when i just delete it, my module work perfectly as I expected.

Sorry for the inconvenience.

Avatar
Discard