summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-12-11 15:44:20 +0100
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-12-11 15:44:20 +0100
commita101d351b5b6da87c6f3c413bcf41c9649dd23e4 (patch)
tree0e385525f78c7601a38f94acceff0334b1cd7eb5
parent3b7e8fcbf657b97ced25f94ac1f5447354b8be1c (diff)
[FIX] stock: filled picking_type_id field on stock.move when created manually from a picking + fixed errors in dates with push rules
bzr revid: qdp-launchpad@openerp.com-20131211144420-y1pdr47kofvsdnwa
-rw-r--r--addons/stock/stock.py6
-rw-r--r--addons/stock/stock_view.xml3
2 files changed, 5 insertions, 4 deletions
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index b158f9fdfcb..bfb15fb91e7 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1439,7 +1439,6 @@ class stock_move(osv.osv):
if rules:
rule = push_obj.browse(cr, uid, rules[0], context=context)
push_obj._apply(cr, uid, rule, move, context=context)
-
return True
# Create the stock.move.putaway records
@@ -2925,11 +2924,12 @@ class stock_location_path(osv.osv):
}
def _apply(self, cr, uid, rule, move, context=None):
move_obj = self.pool.get('stock.move')
- newdate = (datetime.strptime(move.date, DEFAULT_SERVER_DATETIME_FORMAT) + relativedelta.relativedelta(days=rule.delay or 0)).strftime(DEFAULT_SERVER_DATE_FORMAT)
+ newdate = (datetime.strptime(move.date_expected, DEFAULT_SERVER_DATETIME_FORMAT) + relativedelta.relativedelta(days=rule.delay or 0)).strftime(DEFAULT_SERVER_DATE_FORMAT)
if rule.auto == 'transparent':
old_dest_location = move.location_dest_id.id
move_obj.write(cr, uid, [move.id], {
'date': newdate,
+ 'date_expected': newdate,
'location_dest_id': rule.location_dest_id.id
})
move.refresh()
@@ -2942,7 +2942,7 @@ class stock_location_path(osv.osv):
move_id = move_obj.copy(cr, uid, move.id, {
'location_id': move.location_dest_id.id,
'location_dest_id': rule.location_dest_id.id,
- 'date': datetime.now().strftime('%Y-%m-%d'),
+ 'date': newdate,
'company_id': rule.company_id and rule.company_id.id or False,
'date_expected': newdate,
'picking_id': False,
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 08a68ba56af..35fdcd16054 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1128,6 +1128,7 @@
<group>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
<field name="procure_method"/>
+ <field name="picking_type_id" invisible="1"/>
<label for="product_uom_qty"/>
<div>
<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)" class="oe_inline"/>
@@ -1153,7 +1154,7 @@
</group>
<group string="Locations" groups="stock.group_locations">
<field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
- <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
+ <field name="location_dest_id" domain="[('usage','=','internal')]"/>
</group>
</group>
</form>