[IMP,FIX] point_of_sale: Improved field name. Fixed error in Invoice report.
bzr revid: uco@tinyerp.com-20100811082753-9nw9rdlz28dz67rz
This commit is contained in:
@@ -291,7 +291,7 @@ class pos_order(osv.osv):
|
||||
'sale_manager': fields.many2one('res.users', 'Salesman Manager'),
|
||||
'amount_tax': fields.function(_amount_all, method=True, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
|
||||
'amount_total': fields.function(_amount_total, method=True, string='Total'),
|
||||
'amount_paid': fields.function(_amount_all, 'Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
|
||||
'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
|
||||
'amount_return': fields.function(_amount_all, 'Returned', method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
|
||||
'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True),
|
||||
'price_type': fields.selection([
|
||||
|
||||
@@ -34,19 +34,19 @@ class pos_invoice(report_sxw.rml_parse):
|
||||
})
|
||||
|
||||
|
||||
def set_context(self, order, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(order, data, ids, report_type)
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(objects, data, ids, report_type)
|
||||
iids = []
|
||||
nids = []
|
||||
|
||||
for order in objects:
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
data['ids'] = nids
|
||||
self.datas = data
|
||||
self.ids = nids
|
||||
|
||||
Reference in New Issue
Block a user