dépôts
/
burette
/
etudesetchantiersidf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fc40323
)
[PYTHON] ~fix no unit price when create a new pos order line with fixed price product
author
Ludovic CHEVALIER
<ludovic@beurresarrasin.net>
Fri, 7 Dec 2018 14:58:28 +0000
(15:58 +0100)
committer
Ludovic CHEVALIER
<ludovic@beurresarrasin.net>
Fri, 7 Dec 2018 14:58:28 +0000
(15:58 +0100)
point_of_sale.py
patch
|
blob
|
history
diff --git
a/point_of_sale.py
b/point_of_sale.py
index
2ea2f21
..
0457bbd
100644
(file)
--- a/
point_of_sale.py
+++ b/
point_of_sale.py
@@
-31,6
+31,15
@@
from openerp.osv import fields
class pos_order_line(orm.Model):
_inherit = 'pos.order.line'
class pos_order_line(orm.Model):
_inherit = 'pos.order.line'
+ def create(self, cr, uid, vals, context=None):
+ product_id = vals['product_id']
+ products_obj = self.pool.get('product.product')
+ product = products_obj.browse(cr, uid, product_id, context=context)
+ if product.is_fixed_price:
+ vals['price_unit'] = product.list_price
+ res = super(pos_order_line, self).create(cr, uid, vals, context=context)
+ return res
+
def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False, context=None):
res = super(pos_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product_id, qty, partner_id, context=context)
if product_id:
def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False, context=None):
res = super(pos_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product_id, qty, partner_id, context=context)
if product_id: