70
70
[('true', 'Yes'), ('false', 'No')],
71
71
string='Split the Warehouse stock qty. to Stock and Unallocated Stock.',
73
'display_only_in_stock': fields.selection(
74
[('true', 'Yes'), ('false', 'No')],
75
string='Display only products in stock',
73
78
'last_update': fields.datetime(
74
79
string='Last update',
101
106
'with_valuation': lambda *a: 'true',
102
107
'split_stock': lambda *a: 'true',
108
'display_only_in_stock': lambda *a: 'false',
103
109
'fname': lambda *a: 'Mission stock report',
104
110
'processed_state': lambda *a: 'not_started',
105
111
'export_error_msg': lambda *a: False,
167
173
c = context.copy()
169
175
'mission_report_id': wiz_id.report_id.id,
170
'with_valuation': wiz_id.with_valuation == 'true' and True or False,
171
'split_stock': wiz_id.split_stock == 'true' and True or False,
176
'with_valuation': wiz_id.with_valuation == 'true',
177
'split_stock': wiz_id.split_stock == 'true',
172
178
'hide_amc_fmc': wiz_id.report_id.full_view and (self.pool.get('res.users').browse(cr, uid, uid, c).company_id.instance_id.level in ['section', 'coordo']),
180
display_only_in_stock = wiz_id.display_only_in_stock == 'true'
181
if display_only_in_stock:
182
# the qty column are not depending on with_valuation but only on
184
if wiz_id.split_stock == 'true':
186
('mission_report_id', '=', wiz_id.report_id.id),
187
'|', '|', '|', '|', '|', '|', '|',
188
('internal_qty', '!=', 0),
190
('cross_qty', '!=', 0),
191
('secondary_qty', '!=', 0),
193
('in_pipe_qty', '!=', 0),
194
('stock_qty', '!=', 0),
195
('central_qty', '!=', 0)]
197
# in case of split_stock is false, some fields are not
198
# displayed, so do not take into account this quantity
200
('mission_report_id', '=', wiz_id.report_id.id),
202
('internal_qty', '!=', 0),
203
('cross_qty', '!=', 0),
204
('secondary_qty', '!=', 0),
206
('in_pipe_qty', '!=', 0)]
208
domain = [('mission_report_id', '=', wiz_id.report_id.id)]
175
210
return {'type': 'ir.actions.act_window',
176
211
'name': '%s: %s' % (_('Stock mission report'), wiz_id.report_id.name),
177
212
'res_model': 'stock.mission.report.line',
178
213
'view_type': 'form',
179
214
'view_mode': 'tree,form',
180
'domain': [('mission_report_id', '=', wiz_id.report_id.id)],
182
217
'target': 'current'}
250
285
# add the requested field name and report_id to the datas
251
286
# to be used later on in the stock_mission_report_xls_parser
252
287
res = self.read(cr, uid, ids, ['with_valuation', 'split_stock',
253
'report_id'], context=context)
288
'report_id', 'display_only_in_stock'], context=context)
255
290
field_name = None
256
291
if res['split_stock'] == 'false' and res['with_valuation'] == 'false':