54
54
assert move_ids, ('No stock moves were generated on a Regular sale order with an internal partner')
55
55
for move in self.browse(cr, uid, move_ids):
56
56
assert move.order_priority == 'normal', ('Generated move hasn\'t the good priority')
57
assert move.order_category == 'other', ('Generated move hasn\'t the good category')
57
assert move.order_category == 'mixed', ('Generated move hasn\'t the good category')
58
58
assert move.order_type == 'regular', ('Generated move hasn\'t the good type')
59
59
reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_deliver_partner')[1]
60
60
assert move.picking_id.reason_type_id.id == reason_id, ('Generated picking hasn\'t the good reason type')
112
112
assert move_ids, ('No stock moves were generated on a Regular sale order with an external partner')
113
113
for move in self.browse(cr, uid, move_ids):
114
114
assert move.order_priority == 'normal', ('Generated move hasn\'t the good priority')
115
assert move.order_category == 'other', ('Generated move hasn\'t the good category')
115
assert move.order_category == 'mixed', ('Generated move hasn\'t the good category')
116
116
assert move.order_type == 'regular', ('Generated move hasn\'t the good type')
117
117
reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_deliver_partner')[1]
118
118
assert move.picking_id.reason_type_id.id == reason_id, ('Generated picking hasn\'t the good reason type')
171
171
assert move_ids, ('No stock moves were generated on Donation before expiry')
172
172
for move in self.browse(cr, uid, move_ids):
173
173
assert move.order_priority == 'normal', ('Generated move hasn\'t the good priority')
174
assert move.order_category == 'other', ('Generated move hasn\'t the good category')
174
assert move.order_category == 'mixed', ('Generated move hasn\'t the good category')
175
175
assert move.order_type == 'donation_exp', ('Generated move hasn\'t the good type')
176
176
reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_donation_expiry')[1]
177
177
assert move.picking_id.reason_type_id.id == reason_id, ('Generated picking hasn\'t the good reason type')
230
230
assert move_ids, ('No stock moves were generated on a standard donation')
231
231
for move in self.browse(cr, uid, move_ids):
232
232
assert move.order_priority == 'normal', ('Generated move hasn\'t the good priority')
233
assert move.order_category == 'other', ('Generated move hasn\'t the good category')
233
assert move.order_category == 'mixed', ('Generated move hasn\'t the good category')
234
234
assert move.order_type == 'donation_st', ('Generated move hasn\'t the good type')
235
235
reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_donation')[1]
236
236
assert move.picking_id.reason_type_id.id == reason_id, ('Generated picking hasn\'t the good reason type')
290
290
assert move_ids, ('No stock moves were generated on a Loan')
291
291
for move in self.browse(cr, uid, move_ids):
292
292
assert move.order_priority == 'normal', ('Generated move hasn\'t the good priority')
293
assert move.order_category == 'other', ('Generated move hasn\'t the good category')
293
assert move.order_category == 'mixed', ('Generated move hasn\'t the good category')
294
294
assert move.order_type == 'loan', ('Generated move hasn\'t the good type')
295
295
reason_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'reason_types_moves', 'reason_type_loan')[1]
296
296
assert move.picking_id.reason_type_id.id == reason_id, ('Generated picking hasn\'t the good reason type')
344
344
!assert {model: sale.order, id: loan5}:
345
345
- state == 'done', ('Loan order is not in done state')
347
Try to create a SO to the main company
349
!python {model: sale.order}: |
351
data = {'name': 'Main company',
352
'partner_id': ref('base.main_company'),
353
'company_id': ref('base.main_company'),
354
'picking_policy': 'direct',
355
'order_policy': 'manual',
356
'invoice_quantity': 'order',
357
'order_type': 'regular',
358
'date_order': time.strftime('%Y-%m-%d'),
359
'invoice_method': 'order',
360
'location_id': ref('stock.stock_location_stock'),
361
'partner_order_id': ref('base.main_address'),
362
'partner_invoice_id': ref('base.main_address'),
363
'partner_shipping_id': ref('base.main_address'),
364
'pricelist_id': ref('purchase.list0'),
367
self.create(cr, uid, data, context=context)
368
assert False, "The SO creation shouldn't allow a partner = main company"