@@ -31,8 +31,8 @@
pos.box.outformform
- new
+ new
-
+
-
+
diff --git a/addons/point_of_sale/wizard/pos_close_statement.py b/addons/point_of_sale/wizard/pos_close_statement.py
index ca07180974b..22c3e77ad63 100644
--- a/addons/point_of_sale/wizard/pos_close_statement.py
+++ b/addons/point_of_sale/wizard/pos_close_statement.py
@@ -22,7 +22,6 @@
from osv import osv
from tools.translate import _
-
class pos_close_statement(osv.osv_memory):
_name = 'pos.close.statement'
_description = 'Close Statements'
@@ -38,27 +37,55 @@ class pos_close_statement(osv.osv_memory):
"""
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
list_statement = []
+ mod_obj = self.pool.get('ir.model.data')
statement_obj = self.pool.get('account.bank.statement')
journal_obj = self.pool.get('account.journal')
- journal_lst = journal_obj.search(cr, uid, [('company_id', '=', company_id), ('auto_cash', '=', True), ('check_dtls', '=', False)])
- journal_ids = journal_obj.browse(cr, uid, journal_lst)
+ user_obj="""select DISTINCT journal_id from pos_journal_users where user_id=%d"""%(uid)
+ cr.execute(user_obj)
+ user_journals1= cr.fetchall()
+ lst1=map(lambda x1:x1[0],user_journals1)
+ journal_ids = journal_obj.browse(cr, uid, lst1)
+
for journal in journal_ids:
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
- list_statement = ids
- statement_obj.button_confirm(cr, uid, ids, context)
- if not list_statement:
- return {}
+ sql = """ select id from account_journal
+ where auto_cash = 'True'
+ and company_id =%d and id =%d"""%(company_id,journal.id)
+ cr.execute(sql)
+ user_journals= cr.fetchall()
+ lst=map(lambda x1:x1[0],user_journals)
+ journal_ids1 = journal_obj.browse(cr, uid, lst)
+ #list_statement=[]
+
+ for journal1 in journal_ids1:
+ ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
+ if not ids:
+ raise osv.except_osv(_('Message'), _('Journals are allready closed'))
+ else:
+ list_statement.append(ids[0])
+ if not journal.check_dtls:
+ statement_obj.button_confirm_bank(cr, uid, ids, context)
+ # if not list_statement:
+ # return {}
+ # model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_bank_statement_tree')], context=context)
+ # resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+
+ data_obj = self.pool.get('ir.model.data')
+ id2 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_tree')
+ id3 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_form2')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
return {
- 'domain': "[('id','in', list_statement)]",
+ 'domain': "[('id','in'," + str(list_statement) + ")]",
'name': 'Close Statements',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.bank.statement',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
-}
+ 'views': [(id2, 'tree'),(id3, 'form')],
+ 'type': 'ir.actions.act_window'}
pos_close_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_open_statement.py b/addons/point_of_sale/wizard/pos_open_statement.py
index 7fb33ba7f09..8db05d32f53 100644
--- a/addons/point_of_sale/wizard/pos_open_statement.py
+++ b/addons/point_of_sale/wizard/pos_open_statement.py
@@ -23,7 +23,6 @@ from osv import osv
from tools.translate import _
import time
-
class pos_open_statement(osv.osv_memory):
_name = 'pos.open.statement'
_description = 'Open Statements'
@@ -38,67 +37,91 @@ class pos_open_statement(osv.osv_memory):
@return : Blank Directory
"""
list_statement = []
+ mod_obj = self.pool.get('ir.model.data')
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
statement_obj = self.pool.get('account.bank.statement')
singer_obj = self.pool.get('singer.statement')
sequence_obj = self.pool.get('ir.sequence')
journal_obj = self.pool.get('account.journal')
- journal_lst = journal_obj.search(cr, uid, [('company_id', '=', company_id), ('auto_cash', '=', True)])
- journal_ids = journal_obj.browse(cr, uid, journal_lst)
+ user_obj="""select DISTINCT journal_id from pos_journal_users where user_id=%d"""%(uid)
+ cr.execute(user_obj)
+ user_journals1= cr.fetchall()
+ lst1=map(lambda x1:x1[0],user_journals1)
+ journal_ids = journal_obj.browse(cr, uid, lst1)
+
for journal in journal_ids:
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
- if len(ids):
- raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s". \n Please close the cashbox related to. ' % (journal.name)))
- sql = """ Select id from account_bank_statement
- where journal_id=%d
- and company_id =%d
- order by id desc limit 1""" % (journal.id, company_id)
+ sql = """ select id from account_journal
+ where auto_cash = 'True'
+ and company_id =%d and id =%d"""%(company_id,journal.id)
cr.execute(sql)
- st_id = cr.fetchone()
- number = ''
- if journal.statement_sequence_id:
- number = sequence_obj.get_id(cr, uid, journal.id)
- else:
- number = sequence_obj.get(cr, uid,
- 'account.bank.statement')
+ user_journals= cr.fetchall()
+ lst=map(lambda x1:x1[0],user_journals)
+ journal_ids1 = journal_obj.browse(cr, uid, lst)
- # statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
- # 'company_id':company_id,
- # 'user_id':uid,
- # 'state':'open',
- # 'name':number
- # })
- period = statement_obj._get_period(cr, uid, context) or None
- cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id, company_id, uid, number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
- cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id, company_id, uid, number))
- statement_id = cr.fetchone()[0]
- if st_id:
- statemt_id = statement_obj.browse(cr, uid, st_id[0])
- list_statement.append(statemt_id.id)
- if statemt_id and statemt_id.ending_details_ids:
- statement_obj.write(cr, uid, [statement_id], {
- 'balance_start': statemt_id.balance_end,
- 'state': 'open',
- })
- if statemt_id.ending_details_ids:
- for i in statemt_id.ending_details_ids:
- c = singer_obj.create(cr, uid, {
- 'pieces': i.pieces,
- 'number': i.number,
- 'starting_id': statement_id,
- })
- return {
- 'domain': "[('id','in', ["+','.join(map(str,list_statement))+"])]",
- 'name': 'Open Statement',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.bank.statement',
- 'view_id': False, # TODO: REFERENCE RIGHT VIEWS
- 'type': 'ir.actions.act_window'
-}
- return {}
+ for journal1 in journal_ids1:
+ ids1 = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
+ if len(ids):
+ raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s". \n Please close the cashbox related to. ' %(journal.name)))
+ sql = """ Select id from account_bank_statement
+ where journal_id =%d
+ and company_id =%d
+ order by id desc limit 1""" %(journal.id, company_id)
+ cr.execute(sql)
+ st_id = cr.fetchone()
+ number = ''
+ if journal.sequence_id:
+ number = sequence_obj.get_id(cr, uid, journal.id)
+ else:
+ number = sequence_obj.get(cr, uid,
+ 'account.bank.statement')
+ statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
+ 'company_id':company_id,
+ 'user_id':uid,
+ 'state':'open',
+ 'name':number
+ })
+ statement_obj.button_open(cr,uid,[statement_id],context)
+ # period = statement_obj._get_period(cr, uid, context) or None
+ # cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id, company_id, uid, number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
+ # cr.commit()
+ # cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id, company_id, uid, number))
+ # statement_id = cr.fetchone()[0]
+ # print "statement_id",statement_id
+ # if st_id:
+ # statemt_id = statement_obj.browse(cr, uid, st_id[0])
+ # list_statement.append(statemt_id.id)
+ # if statemt_id and statemt_id.ending_details_ids:
+ # statement_obj.write(cr, uid, [statement_id], {
+ # 'balance_start': statemt_id.balance_end,
+ # 'state': 'open',
+ # })
+ # if statemt_id.ending_details_ids:
+ # for i in statemt_id.ending_details_ids:
+ # c = statement_obj.create(cr, uid, {
+ # 'pieces': i.pieces,
+ # 'number': i.number,
+ # 'starting_id': statement_id,
+ # })
+ data_obj = self.pool.get('ir.model.data')
+ id2 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_tree')
+ id3 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_form2')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ return {
+# 'domain': "[('id','in', ["+','.join(map(str,list_statement))+"])]",
+ 'domain': "[('state','=','open')]",
+ 'name': 'Open Statement',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.bank.statement',
+ 'views': [(id2, 'tree'),(id3, 'form')],
+ 'type': 'ir.actions.act_window'
+}
pos_open_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index cd8a85ea8c2..403e92b11b8 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -31,31 +31,31 @@ import pos_receipt
class pos_make_payment(osv.osv_memory):
_name = 'pos.make.payment'
_description = 'Point of Sale Payment'
-
+
def default_get(self, cr, uid, fields, context):
- """
+ """
To get default values for the object.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
"""
res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context)
-
- active_id = context and context.get('active_id',False)
- if active_id:
+
+ active_id = context and context.get('active_id',False)
+ if active_id:
j_obj = self.pool.get('account.journal')
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
-
+
if journal:
journal = journal[0]
else:
journal = None
wf_service = netsvc.LocalService("workflow")
-
+
order_obj=self.pool.get('pos.order')
order = order_obj.browse(cr, uid, active_id, context)
#get amount to pay
@@ -66,50 +66,50 @@ class pos_make_payment(osv.osv_memory):
elif order.amount_paid > 0.0:
order_obj.write(cr, uid, [active_id], {'state': 'advance'})
invoice_wanted_checked = False
-
+
current_date = time.strftime('%Y-%m-%d')
-
+
if 'journal' in fields:
- res.update({'journal':journal})
+ res.update({'journal':journal})
if 'amount' in fields:
- res.update({'amount':amount})
+ res.update({'amount':amount})
if 'invoice_wanted' in fields:
- res.update({'invoice_wanted':invoice_wanted_checked})
+ res.update({'invoice_wanted':invoice_wanted_checked})
if 'payment_date' in fields:
res.update({'payment_date':current_date})
- if 'payment_name' in fields:
- res.update({'payment_name':'Payment'})
+ if 'payment_name' in fields:
+ res.update({'payment_name':'Payment'})
return res
-
+
def view_init(self, cr, uid, fields_list, context=None):
res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
- active_id = context and context.get('active_id', False) or False
+ active_id = context and context.get('active_id', False) or False
if active_id:
order = self.pool.get('pos.order').browse(cr, uid, active_id)
if not order.lines:
raise osv.except_osv('Error!','No order lines defined for this sale ')
return True
-
+
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- """
+ """
Changes the view dynamically
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param context: A standard dictionary
-
+ @param context: A standard dictionary
+
@return: New arch of view.
-
+
"""
-
-
+
+
result = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
active_model = context.get('active_model')
active_id = context.get('active_id', False)
if not active_id or (active_model and active_model != 'pos.order'):
- return result
-
+ return result
+
order = self.pool.get('pos.order').browse(cr, uid, active_id)
if order.amount_total == order.amount_paid:
result['arch'] = """
@@ -120,22 +120,23 @@ class pos_make_payment(osv.osv_memory):
- """
+ """
return result
def check(self, cr, uid, ids, context):
-
+
"""Check the order:
if the order is not paid: continue payment,
if the order is paid print invoice (if wanted) or ticket.
"""
- active_id = context and context.get('active_id',False)
+ active_id = context and context.get('active_id',False)
order_obj = self.pool.get('pos.order')
- jrnl_obj = self.pool.get('account.journal')
+ jrnl_obj = self.pool.get('account.journal')
order = order_obj.browse(cr, uid, active_id, context)
+ order_name = order.name
amount = order.amount_total - order.amount_paid
data = self.read(cr, uid, ids)[0]
-
+
# Todo need to check ...
if amount !=0.0:
invoice_wanted = data['invoice_wanted']
@@ -143,61 +144,140 @@ class pos_make_payment(osv.osv_memory):
if data.get('journal',False):
jrnl_used=jrnl_obj.browse(cr, uid, data['journal'])
order_obj.write(cr, uid, [active_id], {'invoice_wanted': invoice_wanted})
- order_obj.add_payment(cr, uid, active_id, data, context=context)
+ order_obj.add_payment(cr, uid, active_id, data, context=context)
+
+ res_obj = self.pool.get('res.company')
+ inv_ref = self.pool.get('account.invoice')
+ inv_line_ref = self.pool.get('account.invoice.line')
+ product_obj= self.pool.get('product.product')
+ inv_ids = []
+ for order in self.pool.get('pos.order').browse(cr, uid, ids, context):
+# curr_c = order.user_salesman_id.company_id
+ make_obj = self.pool.get('pos.make.payment').browse(cr, uid, uid)
+ if invoice_wanted:
+ if order.invoice_id:
+ inv_ids.append(order.invoice_id.id)
+# continue
+# if not make_obj.partner_id:
+# raise osv.except_osv(_('Error'), _('Please provide a partner for the sale.'))
+ acc= make_obj.partner_id.property_account_receivable.id
+ inv = {
+ 'name': 'Invoice from POS: '+order_name,
+ 'origin': order_name,
+ 'account_id':acc,
+ 'journal_id':order.sale_journal.id or None,
+ 'type': 'out_invoice',
+ 'reference': order.name,
+ 'partner_id': make_obj.partner_id.id,
+ 'comment': order.note or '',
+ }
+ inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'out_invoice', make_obj.partner_id.id)['value'])
+ if not inv.get('account_id', None):
+ inv['account_id'] = acc
+ inv_id = inv_ref.create(cr, uid, inv, context)
+ self.write(cr, uid, [order.id], {'invoice_id': inv_id, 'state': 'invoiced'})
+ inv_ids.append(inv_id)
+ for line in order.lines:
+ inv_line = {
+ 'invoice_id': inv_id,
+ 'product_id': line.product_id.id,
+ 'quantity': line.qty,
+ }
+ inv_name = product_obj.name_get(cr, uid, [line.product_id.id], context=context)[0][1]
+
+ inv_line.update(inv_line_ref.product_id_change(cr, uid, [],
+ line.product_id.id,
+ line.product_id.uom_id.id,
+ line.qty, partner_id = make_obj.partner_id.id, fposition_id=make_obj.partner_id.property_account_position.id)['value'])
+# inv_line['price_unit'] = line.price_unit
+# inv_line['discount'] = line.discount
+# inv_line['account_id'] = acc
+# inv_line['name'] = inv_name
+ inv_line['price_unit'] = amount
+ inv_line['discount'] = line.discount
+ inv_line['account_id'] = acc
+ inv_line['name'] = inv_name
+ inv_line['invoice_line_tax_id'] = ('invoice_line_tax_id' in inv_line)\
+ and [(6, 0, inv_line['invoice_line_tax_id'])] or []
+ inv_line_ref.create(cr, uid, inv_line, context)
+ for i in inv_ids:
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'account.invoice', i, 'invoice_open', cr)
+# return inv_ids
# Todo need to check
# if amount<=0.0:
# context.update({'flag':True})
# order_obj.action_paid(cr,uid,[active_id],context)
- if order_obj.test_paid(cr, uid, [active_id]):
- if order.partner_id and order.invoice_wanted:
- return self.create_invoice(cr, uid, ids, context)
- else:
- context.update({'flag': True})
- order_obj.action_paid(cr, uid, [active_id], context)
+
+# def test_paid(self, cr, uid, ids, context=None):
+# """ Test all amount is paid for this order
+# @return: True
+# """
+# for order in self.browse(cr, uid, ids, context):
+# if order.lines and not order.amount_total:
+# return True
+# if (not order.lines) or (not order.statement_ids) or \
+# Decimal(str(order.amount_total))!=Decimal(str(order.amount_paid)):
+# return False
+# return True
+# if order_obj.test_paid(cr, uid, [active_id]):
+ if order_obj.browse(cr, uid, [active_id]):
+ if make_obj.partner_id and make_obj.invoice_wanted:
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
if context.get('return'):
- order_obj.write(cr, uid, [active_id],{'state':'done'})
+ order_obj.write(cr, uid, [active_id],{'state':'done'})
else:
- order_obj.write(cr, uid, [active_id],{'state':'paid'})
- return self.print_report(cr, uid, ids, context)
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
+ return self.print_report(cr, uid, ids, context)
+# return self.create_invoice(cr, uid, ids, context)
+ else:
+ context.update({'flag': True})
+ order_obj.action_paid(cr, uid, [active_id], context)
+ if context.get('return'):
+ order_obj.write(cr, uid, [active_id],{'state':'done'})
+ else:
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
+ return self.print_report(cr, uid, ids, context)
if order.amount_paid > 0.0:
context.update({'flag': True})
# Todo need to check
- order_obj.action_paid(cr, uid, [active_id], context)
+ order_obj.action_paid(cr, uid, [active_id], context)
self.pool.get('pos.order').write(cr, uid, [active_id],{'state':'advance'})
- return self.print_report(cr, uid, ids, context)
- return {}
+ return self.print_report(cr, uid, ids, context)
+# return {}
+ return inv_ids
+
-
def create_invoice(self, cr, uid, ids, context):
-
+
+ """
+ Create a invoice
"""
- Create a invoice
- """
wf_service = netsvc.LocalService("workflow")
- active_ids = [context and context.get('active_id',False)]
+ active_ids = [context and context.get('active_id',False)]
for i in active_ids:
wf_service.trg_validate(uid, 'pos.order', i, 'invoice', cr)
- datas = {'ids' : context.get('active_id', [])}
- return {
+ datas = {'ids' : context.get('active_id', [])}
+ return {
'type' : 'ir.actions.report.xml',
'report_name':'pos.invoice',
- 'datas' : datas,
- }
-
+ 'datas' : datas,
+ }
+
def print_report(self, cr, uid, ids, context=None):
- """
- @summary: To get the date and print the report
+ """
+ @summary: To get the date and print the report
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param context: A standard dictionary
+ @param context: A standard dictionary
@return : retrun report
- """
+ """
if not context:
context={}
- active_id=context.get('active_id',[])
+ active_id=context.get('active_id',[])
datas = {'ids' : [active_id]}
- res = {}
+ res = {}
datas['form'] = res
return {
@@ -207,7 +287,7 @@ class pos_make_payment(osv.osv_memory):
}
_columns = {
- 'journal':fields.selection(pos_box_entries.get_journal, "Journal",required=True),
+ 'journal':fields.selection(pos_box_entries.get_journal, "Cash Register",required=True),
'product_id': fields.many2one('product.product', "Acompte"),
'amount':fields.float('Amount', digits=(16,2) ,required= True),
'payment_name': fields.char('Payment name', size=32, required=True),
@@ -215,8 +295,15 @@ class pos_make_payment(osv.osv_memory):
'is_acc': fields.boolean('Accompte'),
'invoice_wanted': fields.boolean('Invoice'),
'num_sale':fields.char('Num.File', size=32),
+ 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist'),
+ 'partner_id': fields.many2one('res.partner', 'Customer'),
+ 'invoice_id': fields.many2one('account.invoice', 'Invoice'),
+ 'state': fields.selection([('draft', 'Draft'), ('payment', 'Payment'),
+ ('advance','Advance'),
+ ('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
+ 'State', readonly=True, ),
}
-
+
pos_make_payment()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
index 6608f837a63..ad71d177357 100644
--- a/addons/point_of_sale/wizard/pos_payment.xml
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -12,11 +12,11 @@
form
-
-
+
+
-
+
@@ -24,6 +24,11 @@
+
+
+
+
+
@@ -42,4 +47,4 @@
-
\ No newline at end of file
+
diff --git a/addons/point_of_sale/wizard/pos_receipt.py b/addons/point_of_sale/wizard/pos_receipt.py
index daf63fd6674..33252f20606 100644
--- a/addons/point_of_sale/wizard/pos_receipt.py
+++ b/addons/point_of_sale/wizard/pos_receipt.py
@@ -41,10 +41,10 @@ class pos_receipt(osv.osv_memory):
@return: New arch of view with new columns.
"""
order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'])
- for order in order_lst:
- if order.state_2 in ('to_verify'):
- raise osv.except_osv(_('Error!', 'Can not print the receipt because of discount and/or payment '))
- True
+# for order in order_lst:
+# if order.state_2 in ('to_verify'):
+# raise osv.except_osv(_('Error!', 'Can not print the receipt because of discount and/or payment '))
+# True
def print_report(self, cr, uid, ids, context=None):
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index fff13e36330..dd8e260f56c 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -70,7 +70,7 @@
-
+
@@ -119,6 +119,7 @@
{'search_default_current':1}{'search_default_Current':1}
+ The procurement order will schedule a proposal for automatic procurement for the product concerned. This procurement will start a task, a purchase order form for the supplier or a production depending on the product configuration.
@@ -139,6 +140,7 @@
formtree,form[('state','=','exception')]
+ For each customer order line or raw materials in a manufacturing order, there is a procurement form . In normal system use, procurement orders are automatically generated by Open ERP. But if there are configuration problems, the system can remain blocked by a procurement without generating a corresponding document. It is a procurement exception. Some problems are link to timing and will be correct automatically by the system. If there is no procurement rule, the exception must be corrected manually.
@@ -261,12 +263,12 @@
res_model="stock.warehouse.orderpoint"
src_model="procurement.order"/>
-
+
+
+
+
+
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index dfdf85080fe..acb8280757f 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -305,13 +305,13 @@ class purchase_order(osv.osv):
def inv_line_create(self, cr, uid, a, ol):
return (0, False, {
'name': ol.name,
- 'account_id': a,
+ 'account_id': a.id,
'price_unit': ol.price_unit or 0.0,
'quantity': ol.product_qty,
'product_id': ol.product_id.id or False,
'uos_id': ol.product_uom.id or False,
'invoice_line_tax_id': [(6, 0, [x.id for x in ol.taxes_id])],
- 'account_analytic_id': ol.account_analytic_id.id,
+ 'account_analytic_id': ol.account_analytic_id.id or False,
})
def action_cancel_draft(self, cr, uid, ids, *args):
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index b726b05a19f..9b0f555fc80 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -561,13 +561,12 @@ class sale_order(osv.osv):
wf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_cancel', cr)
sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
{'state': 'cancel'})
+ message = _('Sale order') + " '" + sale.name + _(" is cancelled")
+ self.log(cr, uid, sale.id, message)
self.write(cr, uid, ids, {'state': 'cancel'})
- message = _('Sale order') + " '" + sale.name + "' "+ _("created on")+" '" +sale.create_date + _(" is cancelled")
- self.log(cr, uid, id, message)
return True
def action_wait(self, cr, uid, ids, *args):
- product=[]
product_obj = self.pool.get('product.product')
for o in self.browse(cr, uid, ids):
if (o.order_policy == 'manual'):
@@ -575,11 +574,8 @@ class sale_order(osv.osv):
else:
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')})
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
- for line in o.order_line:
- product.append(line.product_id.default_code)
- params = ', '.join(map(lambda x : str(x),product))
- message = _('Sale order ') + " '" + o.name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("is confirmed")
- self.log(cr, uid, id, message)
+ message = _('Quotation') + " '" + o.name + "' "+ _("is converted to Sale order")
+ self.log(cr, uid, o.id, message)
return True
def procurement_lines_get(self, cr, uid, ids, *args):
@@ -951,9 +947,6 @@ class sale_order_line(osv.osv):
def button_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
- for (id,name) in self.name_get(cr, uid, ids):
- message = _('Sale order line') + " '" + name + "' "+ _("is confirmed")
- self.log(cr, uid, id, message)
return self.write(cr, uid, ids, {'state': 'confirmed'})
def button_done(self, cr, uid, ids, context=None):
@@ -963,8 +956,6 @@ class sale_order_line(osv.osv):
res = self.write(cr, uid, ids, {'state': 'done'})
for line in self.browse(cr, uid, ids, context=context):
wf_service.trg_write(uid, 'sale.order', line.order_id.id, cr)
- message = _('Sale order line') + " '" + line.name + "' "+_("is done")
- self.log(cr, uid, id, message)
return res
def uos_change(self, cr, uid, ids, product_uos, product_uos_qty=0, product_id=None):
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index ee19895b58d..10b7606533f 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -62,9 +62,8 @@
-
-
-
+
+
diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml
index 677cdfbcfc0..96af61ca205 100644
--- a/addons/stock/report/picking.rml
+++ b/addons/stock/report/picking.rml
@@ -150,10 +150,10 @@
- [[ picking.sale_id and picking.sale_id.partner_shipping_id and 'Shipping Address :' or removeParentNode('para') ]]
- [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]
- [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.street) or '' ]]
- [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.zip) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]]
+ [[ picking.address_id and 'Shipping Address :' or removeParentNode('para') ]]
+ [[ ( picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]]
+ [[ (picking.address_id and picking.address_id.street) or '' ]]
+ [[ (picking.address_id and picking.address_id.zip) or '' ]] [[ (picking.address_id and picking.address_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] [[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]]
@@ -241,7 +241,7 @@
- [[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') ]]
+ [[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') or removeParentNode('section') ]]
@@ -267,10 +267,11 @@
-
- [[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]
+
+ [[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('s') ]]Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]][[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]
+
[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]