@return: Dictionary of values.
"""
res={}
- if not context:
- context = {}
for op in self.browse(cr, uid, ids, context=context):
if op.date_start:
res[op.id] = op.date_start[:10]
""" Finds ending date.
@return: Dictionary of values.
"""
- if not context:
- context = {}
ops = self.browse(cr, uid, ids, context=context)
date_and_hours_by_cal = [(op.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops if op.date_planned]
return
def write(self, cr, uid, ids, vals, context=None, update=True):
- if not context:
- context = {}
result = super(mrp_production_workcenter_line, self).write(cr, uid, ids, vals, context=context)
prod_obj = self.pool.get('mrp.production')
if vals.get('date_planned', False) and update:
@return: Dictionary of values
"""
result = {}
- if not context:
- context = {}
for prod in self.browse(cr, uid, ids, context=context):
result[prod.id] = prod.date_planned
for line in prod.workcenter_lines:
@return: Calculated date
"""
dt_end = datetime.now()
- if not context:
+ if context is None:
context = {}
for po in self.browse(cr, uid, ids, context=context):
dt_end = datetime.strptime(po.date_planned, '%Y-%m-%d %H:%M:%S')
""" Calculates start date for stock moves finding interval from resource calendar.
@return: True
"""
- if not context:
- context = {}
for po in self.browse(cr, uid, ids, context=context):
if po.allow_reorder:
continue
""" Calculates start date for stock moves.
@return: True
"""
- if not context:
- context = {}
for po in self.browse(cr, uid, ids, context=context):
if po.allow_reorder:
continue
def write(self, cr, uid, ids, vals, context=None, update=True, mini=True):
direction = {}
- if not context:
- context = {}
if vals.get('date_start', False):
for po in self.browse(cr, uid, ids, context=context):
direction[po.id] = cmp(po.date_start, vals.get('date_start', False))
@return: Dictionary of values
"""
res={}
- if not context:
- context = {}
operation_obj = self.browse(cr, uid, ids, context=context)
for operation in operation_obj:
res[operation.id] = operation.production_id.date_planned
return True
def write(self, cr, uid, ids, vals, context=None):
- if not context:
- context = {}
oper_objs = self.browse(cr, uid, ids, context=context)[0]
vals['production_id']=oper_objs.production_id.id
vals['workcenter_id']=oper_objs.workcenter_id.id
return super(mrp_operations_operation, self).write(cr, uid, ids, vals, context=context)
def create(self, cr, uid, vals, context=None):
- if not context:
- context = {}
wf_service = netsvc.LocalService('workflow')
code_ids=self.pool.get('mrp_operations.operation.code').search(cr,uid,[('id','=',vals['code_id'])])
code=self.pool.get('mrp_operations.operation.code').browse(cr, uid, code_ids, context=context)[0]