(1-(line.discount or 0.0)/100.0), line.qty),
res[order.id]['amount_tax'])
elif line.qty != 0.0:
- for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']:
+ for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, \
+ line.price_unit * (1-(line.discount or 0.0)/100.0), \
+ line.qty, line.product_id, line.order_id.partner_id)['taxes']:
val += c.get('amount', 0.0)
- res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
+ res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
+ res[order.id]['amount_total'] = res[order.id]['amount_tax'] + cur_obj.round(cr, uid, cur, val1)
return res
def _sale_journal_get(self, cr, uid, context=None):
'journal_entry': fields.boolean('Journal Entry'),
}
-
def _select_pricelist(self, cr, uid, context=None):
- """ To get default pricelist for the order"
+ """ To get default pricelist for the order
@param name: Names of fields.
@return: pricelist ID
"""
class pos_scan_product(osv.osv_memory):
_name = 'pos.scan.product'
_description = 'Scan product'
+
_columns = {
- 'gencod': fields.char('Barcode',size=13,required= True)
+ 'gencod': fields.char('Barcode', size=13, required=True)
}
+
- def scan(self, cr, uid, ids, context):
+ def scan(self, cr, uid, ids, context=None):
"""
To get the gencod and scan product
@param self: The object pointer.
@param context: A standard dictionary
@return : retrun gencod
"""
-
- data = self.read(cr, uid, ids)[0]
+ if context is None:
+ context = {}
+ data=self.read(cr, uid, ids)[0]
- record_id = context and context.get('active_id',False)
+ record_id = context and context.get('active_id', False)
result =self. pool.get('pos.order.line')._scan_product(cr, uid, data['gencod'], 1, record_id)
return {'gencod': False}
+
pos_scan_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: