[IMP] stock: remove one of the date field on stock move and use current_date

rename the current date_planned to date

bzr revid: sbh@tinyerp.com-20100921120855-9jmg0dctpytlhnlq
This commit is contained in:
sbh (Open ERP) 2010-09-21 17:38:55 +05:30
parent be9b937035
commit 4897b891bc
8 changed files with 81 additions and 83 deletions

View File

@ -233,13 +233,13 @@ class product_product(osv.osv):
date_str = False
date_values = False
if from_date and to_date:
date_str = "date_planned>=%s and date_planned<=%s"
date_str = "date>=%s and date<=%s"
date_values = [from_date, to_date]
elif from_date:
date_str = "date_planned>=%s"
date_str = "date>=%s"
date_values = [from_date]
elif to_date:
date_str = "date_planned<=%s"
date_str = "date<=%s"
date_values = [to_date]
where = [tuple(location_ids),tuple(location_ids),tuple(ids),tuple(states)]

View File

@ -69,12 +69,12 @@ class report_stock(report_int):
if not loc_ids or not product_ids:
return (False, 'pdf')
cr.execute("select sum(r.product_qty * u.factor), r.date_planned, r.product_id "
cr.execute("select sum(r.product_qty * u.factor), r.date, r.product_id "
"from stock_move r left join product_uom u on (r.product_uom=u.id) "
"where state IN %s"
"and location_id IN %s"
"and product_id IN %s"
"group by date_planned,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
"group by date,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
for (qty, dt, prod_id) in cr.fetchall():
if dt<=dt_from:
dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d')
@ -83,12 +83,12 @@ class report_stock(report_int):
products.setdefault(prod_id, [])
products[prod_id].append((dt,-qty))
cr.execute("select sum(r.product_qty * u.factor), r.date_planned, r.product_id "
cr.execute("select sum(r.product_qty * u.factor), r.date, r.product_id "
"from stock_move r left join product_uom u on (r.product_uom=u.id) "
"where state IN %s"
"and location_dest_id IN %s"
"and product_id IN %s"
"group by date_planned,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
"group by date,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
for (qty, dt, prod_id) in cr.fetchall():
if dt<=dt_from:

View File

@ -28,7 +28,7 @@ class report_stock_move(osv.osv):
_description = "Moves Statistics"
_auto = False
_columns = {
'date_planned': fields.date('Date', readonly=True),
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
@ -57,7 +57,7 @@ class report_stock_move(osv.osv):
select
min(sm_id) as id,
sum(value) as value,
al.dp as date_planned,
al.dp as date,
al.curr_year as year,
al.curr_month as month,
al.curr_day as day,
@ -82,13 +82,13 @@ class report_stock_move(osv.osv):
CASE WHEN sp.type in ('in') THEN
sum(sm.product_qty) END AS in_qty,
min(sm.id) as sm_id,
sm.date_planned as dp,
to_char(date_trunc('day',sm.date_planned), 'YYYY') as curr_year,
to_char(date_trunc('day',sm.date_planned), 'MM') as curr_month,
to_char(date_trunc('day',sm.date_planned), 'YYYY-MM-DD') as curr_day,
avg(date(sm.date_planned)-date(sm.create_date)) as curr_day_diff,
sm.date as dp,
to_char(date_trunc('day',sm.date), 'YYYY') as curr_year,
to_char(date_trunc('day',sm.date), 'MM') as curr_month,
to_char(date_trunc('day',sm.date), 'YYYY-MM-DD') as curr_day,
avg(date(sm.date)-date(sm.create_date)) as curr_day_diff,
avg(date(sm.date_expected)-date(sm.create_date)) as curr_day_diff1,
avg(date(sm.date_planned)-date(sm.date_expected)) as curr_day_diff2,
avg(date(sm.date)-date(sm.date_expected)) as curr_day_diff2,
sm.location_id as location_id,
sm.location_dest_id as location_dest_id,
pt.standard_price * sum(sm.product_qty) as value,
@ -107,7 +107,7 @@ class report_stock_move(osv.osv):
left join stock_location sl on (sm.location_id = sl.id)
group by
sm.id,sp.type, sm.date_planned,sm.address_id,
sm.id,sp.type, sm.date,sm.address_id,
sm.product_id,sm.state,sm.product_uom,sm.date_expected,
sm.product_id,pt.standard_price, sm.picking_id,
sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id)
@ -129,7 +129,7 @@ class report_stock_inventory(osv.osv):
_description = "Stock Statistics"
_auto = False
_columns = {
'date_planned': fields.datetime('Date', readonly=True),
'date': fields.datetime('Date', readonly=True),
'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True),
@ -147,7 +147,7 @@ class report_stock_inventory(osv.osv):
cr.execute("""
create or replace view report_stock_inventory as (
(select
min(m.id) as id, m.date_planned as date_planned,
min(m.id) as id, m.date as date,
m.address_id as partner_id, m.location_id as location_id,
m.product_id as product_id, l.usage as location_type,
m.company_id,
@ -163,10 +163,10 @@ create or replace view report_stock_inventory as (
left join stock_location l on (m.location_id=l.id)
group by
m.id, m.product_id, m.address_id, m.location_id, m.prodlot_id,
m.date_planned, m.state, l.usage, m.company_id
m.date, m.state, l.usage, m.company_id
) union all (
select
-m.id as id, m.date_planned as date_planned,
-m.id as id, m.date as date,
m.address_id as partner_id, m.location_dest_id as location_id,
m.product_id as product_id, l.usage as location_type,
m.company_id,
@ -182,7 +182,7 @@ create or replace view report_stock_inventory as (
left join stock_location l on (m.location_dest_id=l.id)
group by
m.id, m.product_id, m.address_id, m.location_id, m.location_dest_id,
m.prodlot_id, m.date_planned, m.state, l.usage, m.company_id
m.prodlot_id, m.date, m.state, l.usage, m.company_id
)
);
""")

View File

@ -13,7 +13,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Moves Analysis">
<field name="date_planned" invisible="1"/>
<field name="date" invisible="1"/>
<field name="year" invisible="1" />
<field name="month" invisible="1"/>
<field name="day" invisible="1"/>
@ -62,7 +62,7 @@
<filter icon="terp-go-today"
string="Today"
separator="1"
domain="[('date_planned','=', time.strftime('%%Y-%%m-%%d'))]"
domain="[('date','=', time.strftime('%%Y-%%m-%%d'))]"
help="Stock Moves of today"/>
<separator orientation="vertical"/>
@ -99,7 +99,7 @@
<filter string="Company" name="group_state" icon="terp-stock_effects-object-colorize" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'date_planned'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
@ -109,7 +109,7 @@
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_planned"/>
<field name="date"/>
</group>
</search>
@ -134,7 +134,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Inventory Analysis">
<field name="date_planned" invisible="1"/>
<field name="date" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="location_type" invisible="1"/>
<field name="location_id" invisible="1"/>
@ -182,7 +182,7 @@
<filter icon="terp-go-home" name="location_type_internal" string="Internal" domain="[('location_type','=','internal')]"/>
<filter icon="terp-go-home" name="location_type_scrap" string="Scrap" domain="[('location_type','=','scrap')]"/>
<separator orientation="vertical"/>
<field name="date_planned"/>
<field name="date"/>
<field name="product_id"/>
<field name="location_id"/>
<field name="company_id" groups="base.group_multi_company"/>
@ -197,7 +197,7 @@
<filter name="group_location" string="Location" context="{'group_by':'location_id'}"/>
<filter name="group_lot" string="Lot" context="{'group_by':'prodlot_id'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" context="{'group_by':'date_planned'}"/>
<filter string="Date" icon="terp-go-month" context="{'group_by':'date'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
</group>
<newline/>

View File

@ -554,12 +554,12 @@ class stock_picking(osv.osv):
ids = [ids]
for pick in self.browse(cr, uid, ids, context):
sql_str = """update stock_move set
date_planned='%s'
date='%s'
where
picking_id=%d """ % (value, pick.id)
if pick.max_date:
sql_str += " and (date_planned='" + pick.max_date + "' or date_planned>'" + value + "')"
sql_str += " and (date='" + pick.max_date + "' or date>'" + value + "')"
cr.execute(sql_str)
return True
@ -576,11 +576,11 @@ class stock_picking(osv.osv):
ids = [ids]
for pick in self.browse(cr, uid, ids, context=context):
sql_str = """update stock_move set
date_planned='%s'
date='%s'
where
picking_id=%s """ % (value, pick.id)
if pick.min_date:
sql_str += " and (date_planned='" + pick.min_date + "' or date_planned<'" + value + "')"
sql_str += " and (date='" + pick.min_date + "' or date<'" + value + "')"
cr.execute(sql_str)
return True
@ -595,8 +595,8 @@ class stock_picking(osv.osv):
return res
cr.execute("""select
picking_id,
min(date_planned),
max(date_planned)
min(date),
max(date)
from
stock_move
where
@ -1457,9 +1457,8 @@ class stock_move(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True, select=True),
'priority': fields.selection([('0', 'Not urgent'), ('1', 'Urgent')], 'Priority'),
'date': fields.datetime('Creation Date', select=True),
'date_planned': fields.datetime('Date', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
'create_date': fields.datetime('Creation Date', readonly=True),
'date': fields.datetime('Date Planned', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
'date_expected': fields.datetime('Date Expected', readonly=True,required=True, help="Scheduled date for the movement of the products"),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
@ -1540,7 +1539,6 @@ class stock_move(osv.osv):
'priority': '1',
'product_qty': 1.0,
'scrapped' : False,
'date_planned': time.strftime('%Y-%m-%d %H:%M:%S'),
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.move', context=c),
'date_expected': time.strftime('%Y-%m-%d %H:%M:%S'),
@ -1673,7 +1671,7 @@ class stock_move(osv.osv):
if dest:
if dest[1] == 'transparent':
self.write(cr, uid, [m.id], {
'date_planned': (datetime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \
'date': (datetime.strptime(m.date, '%Y-%m-%d %H:%M:%S') + \
relativedelta(days=dest[2] or 0)).strftime('%Y-%m-%d'),
'location_dest_id': dest[0].id})
else:
@ -1734,7 +1732,7 @@ class stock_move(osv.osv):
'state': 'waiting',
'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
'move_history_ids': [],
'date_planned': (datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
'date': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
'move_history_ids2': []}
)
move_obj.write(cr, uid, [move.id], {
@ -1996,7 +1994,7 @@ class stock_move(osv.osv):
self._create_product_valuation_moves(cr, uid, move, context=context)
self.write(cr, uid, ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')})
self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_trigger(uid, 'stock.move', id, cr)
@ -2426,7 +2424,7 @@ class stock_inventory(osv.osv):
'product_uom': line.product_uom.id,
'prodlot_id': lot_id,
'date': inv.date,
'date_planned': inv.date,
'date': inv.date,
'state': 'done'
}
if change > 0:
@ -2591,21 +2589,21 @@ class report_products_to_received_planned(osv.osv):
tools.drop_view_if_exists(cr, 'report_products_to_received_planned')
cr.execute("""
create or replace view report_products_to_received_planned as (
select stock.date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
from stock_picking picking
inner join stock_move stock
on picking.id = stock.picking_id and picking.type = 'in'
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date
where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.create_date
union
select stock.date_planned, min(stock.id) as id, 0 as actual_qty, sum(stock.product_qty) as planned_qty
select stock.date, min(stock.id) as id, 0 as actual_qty, sum(stock.product_qty) as planned_qty
from stock_picking picking
inner join stock_move stock
on picking.id = stock.picking_id and picking.type = 'in'
where stock.date_planned between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date_planned
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date
)
""")
@ -2626,21 +2624,21 @@ class report_delivery_products_planned(osv.osv):
tools.drop_view_if_exists(cr, 'report_delivery_products_planned')
cr.execute("""
create or replace view report_delivery_products_planned as (
select stock.date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
from stock_picking picking
inner join stock_move stock
on picking.id = stock.picking_id and picking.type = 'out'
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date
where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.create_date
union
select stock.date_planned, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty
select stock.date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty
from stock_picking picking
inner join stock_move stock
on picking.id = stock.picking_id and picking.type = 'out'
where stock.date_planned between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date_planned
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
group by stock.date
)

View File

@ -390,8 +390,8 @@
<field name="picking_id"/>
<field name="location_id" />
<field name="location_dest_id" />
<field name="date"/>
<field name="date_planned" string="Date"/>
<field name="create_date"/>
<field name="date" string="Date"/>
<field name="date_expected" string="Date Expected"/>
<field name="state"/>
<button name="action_done" states="confirmed,assigned" string="Done" type="object" icon="gtk-jump-to"/>
@ -415,8 +415,8 @@
<field name="picking_id"/>
<field name="location_id" />
<field name="location_dest_id" />
<field name="date" />
<field name="date_planned" string="Date"/>
<field name="create_date" />
<field name="date" string="Date"/>
<field name="date_expected" string="Date Expected"/>
<field name="state"/>
</tree>
@ -683,7 +683,7 @@
states="draft,assigned,confirmed,done"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
<field name="date"/>
<field name="date_expected" string="Date Expected"/>
<field name="state"/>
</tree>
@ -711,8 +711,8 @@
<group colspan="2" col="2">
<separator string="Dates" colspan="2" />
<field name="date" invisible="1"/>
<field name="date_planned"/>
<field name="create_date" invisible="1"/>
<field name="date"/>
<field name="date_expected"/>
</group>
@ -868,7 +868,7 @@
groups="base.group_extended"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
<field name="date"/>
<field name="date_expected" string="Date Expected"/>
<field name="state"/>
</tree>
@ -896,8 +896,8 @@
<group colspan="2" col="2">
<separator string="Dates" colspan="2" />
<field name="date" invisible="1"/>
<field name="date_planned"/>
<field name="create_date" invisible="1"/>
<field name="date"/>
<field name="date_expected"/>
</group>
@ -1083,7 +1083,7 @@
groups="base.group_extended"
states="draft,assigned,confirmed,done"/>
<field name="location_id"/>
<field name="date_planned"/>
<field name="date"/>
<field name="state"/>
<button name="%(action_partial_move)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
<button name="action_done" states="confirmed,assigned" string="Done" type="object" icon="gtk-jump-to"/>
@ -1112,8 +1112,8 @@
<group colspan="2" col="2">
<separator string="Dates" colspan="2" />
<field name="date" invisible="1"/>
<field name="date_planned"/>
<field name="create_date" invisible="1"/>
<field name="date"/>
<field name="date_expected"/>
</group>
@ -1323,8 +1323,8 @@
<group colspan="2" col="2">
<separator string="Dates" colspan="2" />
<field name="date" invisible="1"/>
<field name="date_planned"/>
<field name="create_date" invisible="1"/>
<field name="date"/>
<field name="date_expected"/>
</group>
@ -1497,10 +1497,10 @@
<field name="type">tree</field>
<field eval="6" name="priority"/>
<field name="arch" type="xml">
<tree colors="grey:state in ('cancel');red:(state not in ('cancel','done')) and date_planned > current_date" string="Moves" editable="top">
<tree colors="grey:state in ('cancel');red:(state not in ('cancel','done')) and date > current_date" string="Moves" editable="top">
<field name="picking_id" string="Reference"/>
<field name="origin"/>
<field name="date" invisible="1"/>
<field name="create_date" invisible="1"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
@ -1528,7 +1528,7 @@
states="draft,assigned,confirmed,done"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
<field name="date"/>
<field name="date_expected"/>
<field name="state"/>
<button name="action_done" states="confirmed,assigned" string="Done" type="object" icon="gtk-jump-to"/>
@ -1570,8 +1570,8 @@
<group colspan="2" col="2">
<separator string="Dates &amp; Priority" colspan="2" />
<field name="create_date"/>
<field name="date"/>
<field name="date_planned"/>
<field name="date_expected"/>
<field name="priority"/>
</group>
@ -1613,7 +1613,7 @@
<field name="arch" type="xml">
<search string="Stock Moves">
<group col="14" colspan="4">
<filter icon="terp-go-today" string="Today" domain="[('date_planned','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date_planned','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/>
<filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Done" name="done" domain="[('state','=','done')]" help="Stock moves that have been processed"/>
<filter icon="terp-stock" string="Future" name="future" domain="[('state','in',('assigned','confirmed','waiting'))]" help="Stock moves that are Confirmed, Available or Waiting"/>
@ -1622,7 +1622,7 @@
<field name="product_id"/>
<field name="location_id" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>
<field name="address_id" string="Partner" context="{'contact_display':'partner'}" filter_domain="[('picking_id.address_id','ilike',self)]"/>
<field name="date_planned"/>
<field name="date"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="8">
@ -1636,8 +1636,8 @@
<separator orientation="vertical"/>
<filter icon="terp-stock_effects-object-colorize" string="State" domain="[]" context="{'group_by':'state'}" />
<separator orientation="vertical"/>
<filter string="Creation" name="groupby_date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
<filter string="Expected" name="groupby_date_planned" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
<filter string="Creation" name="groupby_create_date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Expected" name="groupby_date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." colspan="4" col="8">
@ -1699,7 +1699,7 @@
groups="base.group_extended"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed,done"/>
<field name="date_planned"/>
<field name="date"/>
<field name="state"/>
<button name="action_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
<button name="%(action_partial_move)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
@ -1740,8 +1740,8 @@
<group colspan="2" col="2">
<separator string="Dates &amp; Priority" colspan="2" />
<field name="create_date"/>
<field name="date"/>
<field name="date_planned"/>
<field name="date_expected"/>
<field name="priority"/>
</group>
@ -1783,7 +1783,7 @@
<field name="arch" type="xml">
<search string="Stock Moves">
<group col="8" colspan="4">
<filter icon="terp-go-today" string="Today" domain="[('date_planned','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date_planned','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders planned for today"/>
<filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders planned for today"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-go-back-rtl" name="receive" string="To Do" domain="[('state','in',('confirmed','assigned'))]" help="Stock to be received"/>
<filter icon="terp-check" name="received" string="Done" domain="[('state','=','done')]"/>
@ -1800,7 +1800,7 @@
<filter string="Order" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'origin'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" />
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" />
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">

View File

@ -294,7 +294,7 @@
invoice_state: none
move_lines:
- company_id: base.main_company
date_planned: '2010-05-11 15:18:57'
date: '2010-05-11 15:18:57'
location_dest_id: stock.stock_location_customers
location_id: stock.stock_location_stock
name: HP CD writers

View File

@ -177,7 +177,7 @@ class stock_return_picking(osv.osv_memory):
new_qty, move.product_uos.id),
'picking_id':new_picking, 'state':'draft',
'location_id':new_location, 'location_dest_id':move.location_id.id,
'date':date_cur, 'date_planned':date_cur,})
'date':date_cur, 'date':date_cur,})
move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
if set_invoice_state_to_none: