if data.get('payment_name', False):
args['name'] = args['name'] + ': ' + data['payment_name']
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
- args['account_id'] = order.partner_id and order.partner_id.property_account_receivable \
- and order.partner_id.property_account_receivable.id or account_def and account_def.id
+ args['account_id'] = (order.partner_id and order.partner_id.property_account_receivable \
+ and order.partner_id.property_account_receivable.id) or (account_def and account_def.id) or False
args['partner_id'] = order.partner_id and order.partner_id.id or None
if not args['account_id']:
- msg = 'There is no receivable account defined'
- if args['partner_id']:
- msg += ' for this partner: "%s" (id:%d)' % \
- (order.partner_id.name, order.partner_id.id,)
- raise osv.except_osv(_('Error !'), _('%s' %msg))
-
+ if not args['partner_id']:
+ msg = _('There is no receivable account defined to make payment')
+ else:
+ msg = _('There is no receivable account defined to make payment for the partner: "%s" (id:%d)') % (order.partner_id.name, order.partner_id.id,)
+ raise osv.except_osv(_('Configuration Error !'), msg)
+
statement_id = statement_obj.search(cr,uid, [
('journal_id', '=', int(data['journal'])),
('company_id', '=', curr_company),
pos_order_line()
+class pos_category(osv.osv):
+ _name = 'pos.category'
+ _inherit = 'product.category'
+ _columns = {
+ 'parent_id': fields.many2one('pos.category','Parent Category', select=True),
+ 'child_id': fields.one2many('pos.category', 'parent_id', string='Child Categories'),
+ }
+pos_category()
+
class product_product(osv.osv):
_inherit = 'product.product'
_columns = {
'income_pdt': fields.boolean('Product for Input'),
'expense_pdt': fields.boolean('Product for Output'),
+ 'img': fields.binary('Pos Image, must be 50x50'),
+ 'pos_categ_id': fields.many2one('pos.category','POS Category', change_default=True, domain="[('type','=','normal')]" ,help="Select a pos category for the current product")
}
product_product()