Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3546 Представления

I have a customized sale's contract which define the product and the price. The price will be  different from the normal price which defined at the product itself. Besides, each customer will also have a different price per product based on the agreement (which define in contract) . If I using Point Of Sale UI, how can I generate the pos order along with the product's price which already define at the contract and not the price which define at the product itself?   

I already create onchange function and it works well only if I generate the order using the normal view but not from POS UI. Can anyone help me?

 

Аватар
Отменить
Лучший ответ

Hello,

can you give selection for customer in POS UI ?

Аватар
Отменить
Автор

Hi Nirav Jani, what do you mean by selection for customer? FYI, right now, I'm using POS enhanced module to choose customer from POS UI. I get it from here : http://thierry-godin.developpez.com/openerp/openerp-module-pos-enhanced-en/ .

Yes, If you want change the product price which right side in POS UI based on select customer,you need more change in JS file.

Автор

Right now, I can see that in JS file, the price for the product is from this code (correct me if i'm wrong): then(function(categories){ self.db.add_categories(categories); return self.fetch( 'product.product', ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description', 'is_pack'], [['sale_ok','=',true],['available_in_pos','=',true]], {pricelist: self.get('shop').pricelist_id[0]} // context for price ); and, module.Orderline = Backbone.Model.extend({ initialize: function(attr,options){ this.price = options.product.get('price'); Let say I need to get the new product price which define at account.analytic.account (contract), does it require a lot of changes or just a minor changes?

It is more change require because of when POS session start set single pricelist. In this case we set mutiple price for single product so that more changes require.

Автор

I tried to call on_change function in JS file. This function work fine if I create the order from the normal UI. But when I create the order through POS UI, I got this error: TypeError: onchange_partner() takes at least 5 arguments (4 given) Here is how I call the function: new instance.web.Model('sale.order').call('onchange_partner',[ids]).then(function(id){}); Do I call the function wrongly or I need to configure something else to make it work?

Автор

I forgot to mention that this onchange function use to get the product's price from the contract.