* fixed bug on partial packing
* put date fileration on product_margin function on product_margin module bzr revid: hmo@tinyerp.com-20081014132355-z3tkd6n7bjvh9tgo
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#############################################################################
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
# Fabien Pinckaers <fp@tiny.Be>
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
|
||||
@@ -76,8 +76,8 @@ class product_product(osv.osv):
|
||||
from account_invoice_line l
|
||||
left join account_invoice i on (l.invoice_id = i.id)
|
||||
left join product_template product on (product.id=l.product_id)
|
||||
where l.product_id = %s and i.state in ('%s') and i.type in ('%s')
|
||||
"""%(val.id,"','".join(states),"','".join(invoice_types))
|
||||
where l.product_id = %s and i.state in ('%s') and i.type in ('%s') and i.date_invoice>='%s' and i.date_invoice<='%s'
|
||||
"""%(val.id,"','".join(states),"','".join(invoice_types),date_from,date_to)
|
||||
cr.execute(sql)
|
||||
result=cr.fetchall()[0]
|
||||
if 'sale_avg_price' in field_names or 'sale_num_invoiced' in field_names or 'turnover' in field_names or 'sale_expected' in field_names:
|
||||
|
||||
+13
-8
@@ -323,11 +323,14 @@ class stock_picking(osv.osv):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids=[ids]
|
||||
for pick in self.browse(cr, uid, ids, context):
|
||||
cr.execute("""update stock_move set
|
||||
date_planned=%s
|
||||
sql_str="""update stock_move set
|
||||
date_planned='%s'
|
||||
where
|
||||
picking_id=%d and
|
||||
(date_planned=%s or date_planned>%s)""", (value,pick.id,pick.max_date,value))
|
||||
picking_id=%d """ % (value,pick.id)
|
||||
|
||||
if pick.max_date:
|
||||
sql_str += " and (date_planned='"+pick.max_date+"' or date_planned>'"+value+"')"
|
||||
cr.execute(sql_str)
|
||||
return True
|
||||
|
||||
def _set_minimum_date(self, cr, uid, ids, name, value, arg, context):
|
||||
@@ -335,11 +338,13 @@ class stock_picking(osv.osv):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids=[ids]
|
||||
for pick in self.browse(cr, uid, ids, context):
|
||||
cr.execute("""update stock_move set
|
||||
date_planned=%s
|
||||
sql_str="""update stock_move set
|
||||
date_planned='%s'
|
||||
where
|
||||
picking_id=%d and
|
||||
(date_planned=%s or date_planned<%s)""", (value,pick.id,pick.min_date,value))
|
||||
picking_id=%d """ % (value,pick.id)
|
||||
if pick.min_date:
|
||||
sql_str += " and (date_planned='"+pick.min_date+"' or date_planned<'"+value+"')"
|
||||
cr.execute(sql_str)
|
||||
return True
|
||||
|
||||
def get_min_max_date(self, cr, uid, ids, field_name, arg, context={}):
|
||||
|
||||
Reference in New Issue
Block a user