Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6713 Visualizzazioni

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
Abbandona

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.

Autore

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.

Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
apr 25
457
2
feb 18
9784
0
giu 17
3226
3
feb 25
11657
2
ago 23
3667