3
from __future__ import print_function
4
from unifield_test import UnifieldTest
5
from time import strftime
6
from random import randint
7
from oerplib import error
10
class ResourcingTest(UnifieldTest):
12
def create_order(self, db, pr=False):
14
Create a field order or an internal request (sale.order) with 4 lines:
15
- 2 lines with LOG products:
18
- 2 lines with MED products:
22
:param db: Connection to the database
23
:param pr: True if we want to create an Internal request, False if we
24
want to create a Field Order
26
:return The ID of the new Internal request or field orde
29
# Prepare some objects
30
order_obj = db.get('sale.order')
31
line_obj = db.get('sale.order.line')
33
# Prepare values for the field order
34
prod_log1_id = self.get_test_obj(db, 'prod_log_1')
35
prod_log2_id = self.get_test_obj(db, 'prod_log_2')
36
prod_med1_id = self.get_test_obj(db, 'prod_med_1')
37
prod_med2_id = self.get_test_obj(db, 'prod_med_2')
42
partner_id = self.get_test_obj(db, 'ext_customer_1')
43
p_addr_id = self.get_test_obj(db, 'ext_customer_1_addr')
45
order_id = order_obj.create({
46
'procurement_request': pr,
47
'partner_id': partner_id,
50
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: