[FIX] purchase: fix the scheduled date on the created stock move + stock: usability fixes/imp
bzr revid: qdp-launchpad@openerp.com-20130515101810-tt0w2uz0sjva1l7j
This commit is contained in:
@@ -641,7 +641,7 @@ class purchase_order(osv.osv):
|
||||
'product_uom': order_line.product_uom.id,
|
||||
'product_uos': order_line.product_uom.id,
|
||||
'date': self.date_to_datetime(cr, uid, order.date_order, context),
|
||||
'date_expected': self.date_to_datetime(cr, uid, order.date_order, context),
|
||||
'date_expected': self.date_to_datetime(cr, uid, order_line.date_planned, context),
|
||||
'location_id': order.partner_id.property_stock_supplier.id,
|
||||
'location_dest_id': order.location_id.id,
|
||||
'picking_id': picking_id,
|
||||
|
||||
@@ -29,7 +29,7 @@ from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
from openerp import tools
|
||||
from openerp.tools import float_compare
|
||||
from openerp.tools import float_compare, DEFAULT_SERVER_DATETIME_FORMAT
|
||||
import openerp.addons.decimal_precision as dp
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -651,7 +651,7 @@ class stock_picking(osv.osv):
|
||||
),
|
||||
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
|
||||
store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
|
||||
'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
|
||||
store=True, type='datetime', string='Max. Expected Date', select=2),
|
||||
@@ -2334,7 +2334,6 @@ class stock_move(osv.osv):
|
||||
'line_id': move_lines,
|
||||
'ref': move.picking_id and move.picking_id.name})
|
||||
|
||||
|
||||
def action_done(self, cr, uid, ids, context=None):
|
||||
""" Makes the move done and if all moves are done, it will finish the picking.
|
||||
@return:
|
||||
@@ -2380,7 +2379,7 @@ class stock_move(osv.osv):
|
||||
if todo:
|
||||
self.action_confirm(cr, uid, todo, context=context)
|
||||
|
||||
self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
|
||||
self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
|
||||
for id in move_ids:
|
||||
wf_service.trg_trigger(uid, 'stock.move', id, cr)
|
||||
|
||||
|
||||
@@ -1252,8 +1252,8 @@
|
||||
<field name="location_dest_id" groups="stock.group_locations"/>
|
||||
<field name="partner_id" context="{'contact_display':'partner'}"
|
||||
groups="stock.group_locations"/>
|
||||
<field name="date_expected" on_change="onchange_date(date,date_expected)"/>
|
||||
<field name="date" groups="base.group_no_one"/>
|
||||
<field name="date_expected" on_change="onchange_date(date,date_expected)" attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
<field name="date" attrs="{'invisible': [('state', '!=', 'done')]}"/>
|
||||
</group>
|
||||
<group string="Traceability"
|
||||
groups="stock.group_tracking_lot">
|
||||
|
||||
Reference in New Issue
Block a user