Merge lp:~openerp-dev/openobject-addons/trunk-bug-977574-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-977574-ara
Merge into: lp:openobject-addons
Diff against target: 67 lines (+18/-12)
2 files modified
point_of_sale/point_of_sale.py (+12/-6)
point_of_sale/point_of_sale_view.xml (+6/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-977574-ara
Reviewer Review Type Date Requested Status
Amit Parik (community) Approve
Selami Demir (community) Disapprove
Review via email: mp+105031@code.launchpad.net

Description of the change

Hello

point_of_sale: [FIX] Point of Sale Not Using Pricelist.

Thank you,
ara

To post a comment you must log in.
Revision history for this message
Selami Demir (sdemir) wrote :

Hi,

after change code, I see a error that "No handler found."

thank you.

review: Disapprove
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Selami,

This code this working fine for pos backend , I have applied the code and pricelist working fine with the posorder(pos backend).

You have faced this error due to your end problem, please clear your browser's history (cache memory)then try it will works.

And yes if you want this for "POS touch-screen" then you have to post another bug repost because this bug consider only pos order's issue.

And please *don't disapprove* MP by your hand If you are not 100% sure for the MP becasue it will creates a problem and some good MP will not check/merge for trunk.

@Ashvin: Nice fix and it works for me.

Thanks for the fix!

review: Approve

Unmerged revisions

6779. By Ashvin Rathod (OpenERP)

[FIX] point_of_sale: Point of Sale Not Using Pricelist

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'point_of_sale/point_of_sale.py'
--- point_of_sale/point_of_sale.py 2012-03-30 08:27:51 +0000
+++ point_of_sale/point_of_sale.py 2012-05-08 06:22:19 +0000
@@ -657,11 +657,11 @@
657 price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],657 price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
658 product_id, qty or 1.0, partner_id)[pricelist]658 product_id, qty or 1.0, partner_id)[pricelist]
659659
660 result = self.onchange_qty(cr, uid, ids, product_id, 0.0, qty, price, context=context)660 result = self.onchange_qty(cr, uid, ids, product_id, 0.0, qty, price, pricelist, partner_id, context=context)
661 result['value']['price_unit'] = price661 result['value']['price_unit'] = price
662 return result662 return result
663663
664 def onchange_qty(self, cr, uid, ids, product, discount, qty, price_unit, context=None):664 def onchange_qty(self, cr, uid, ids, product, discount, qty, price_unit, pricelist, partner_id=False, context=None):
665 result = {}665 result = {}
666 if not product:666 if not product:
667 return result667 return result
@@ -669,11 +669,17 @@
669 cur_obj = self.pool.get('res.currency')669 cur_obj = self.pool.get('res.currency')
670670
671 prod = self.pool.get('product.product').browse(cr, uid, product, context=context)671 prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
672
673 taxes = prod.taxes_id672 taxes = prod.taxes_id
674 price = price_unit * (1 - (discount or 0.0) / 100.0)673
675 taxes = account_tax_obj.compute_all(cr, uid, prod.taxes_id, price, qty, product=prod, partner=False)674 price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
676675 product, qty or 1.0, partner_id)[pricelist]
676 if not price:
677 raise osv.except_osv(_('Configuration Error !'),_("No valid pricelist line found ! :Couldn't find a pricelist line matching this product and quantity.\nYou have to change either the product, the quantity or the pricelist."))
678
679 price_discount = price * (1 - (discount or 0.0) / 100.0)
680 taxes = account_tax_obj.compute_all(cr, uid, prod.taxes_id, price_discount, qty, product=prod, partner=False)
681
682 result['price_unit'] = price
677 result['price_subtotal'] = taxes['total']683 result['price_subtotal'] = taxes['total']
678 result['price_subtotal_incl'] = taxes['total_included']684 result['price_subtotal_incl'] = taxes['total_included']
679 return {'value': result}685 return {'value': result}
680686
=== modified file 'point_of_sale/point_of_sale_view.xml'
--- point_of_sale/point_of_sale_view.xml 2012-04-25 14:46:11 +0000
+++ point_of_sale/point_of_sale_view.xml 2012-05-08 06:22:19 +0000
@@ -28,17 +28,17 @@
28 <field name="lines" colspan="4" nolabel="1">28 <field name="lines" colspan="4" nolabel="1">
29 <tree string="Order lines" editable="bottom">29 <tree string="Order lines" editable="bottom">
30 <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>30 <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
31 <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>31 <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
32 <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>32 <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
33 <field name="discount" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>33 <field name="discount" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
34 <field name="price_subtotal"/>34 <field name="price_subtotal"/>
35 <field name="price_subtotal_incl"/>35 <field name="price_subtotal_incl"/>
36 </tree>36 </tree>
37 <form string="Order lines">37 <form string="Order lines">
38 <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>38 <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
39 <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>39 <field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
40 <field name="discount" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>40 <field name="discount" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
41 <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"/>41 <field name="price_unit" on_change="onchange_qty(product_id, discount, qty, price_unit, parent.pricelist_id,parent.partner_id,context)"/>
42 <field name="price_subtotal" invisible="1"/>42 <field name="price_subtotal" invisible="1"/>
43 <field name="price_subtotal_incl" invisible="1"/>43 <field name="price_subtotal_incl" invisible="1"/>
44 <field name="notice"/>44 <field name="notice"/>

Subscribers

People subscribed via source and target branches

to all changes: