instruction
2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Установка:
1. Добавляем в компоненты:
'odooMapper' => [
'class' => OdooMapper::className(),
'map' => [
'id' => 'remote_id',
'active' => 'status',
'create_date' => [
'attribute' => 'created_at',
'artbox' => function ($field) {
return strtotime($field);
},
'odoo' => function ($field) {
return date('Y-m-d H:i:s', $field);
},
],
'__last_update' => [
'attribute' => 'updated_at',
'artbox' => function ($field) {
return strtotime($field);
},
'odoo' => function ($field) {
return date('Y-m-d H:i:s', $field);
},
],
'name' => 'title',
'default_code' => 'sku',
'list_price' => 'price',
'product_id' => [
'attribute' => 'variant_id',
'artbox' => function ($field) {
return $field[ 0 ];
},
'odoo' => function ($field) {
return [ $field ];
},
],
'price_unit' => 'price',
'product_uom_qty' => 'count',
'categ_id' => 'category',
'contact_address' => [
'attribute' => 'address',
'artbox' => function ($field) {
return strval($field);
},
'odoo' => function ($field) {
return boolval($field);
},
],
'phone' => [
'attribute' => 'phone',
'artbox' => function ($field) {
return strval($field);
},
'odoo' => function ($field) {
return boolval($field);
},
],
'email' => [
'attribute' => 'email',
'artbox' => function ($field) {
return strval($field);
},
'odoo' => function ($field) {
return boolval($field);
},
],
'city' => [
'attribute' => 'city',
'artbox' => function ($field) {
return strval($field);
},
'odoo' => function ($field) {
return boolval($field);
},
],
'comment' => [
'attribute' => 'comment',
'artbox' => function ($field) {
return strval($field);
},
'odoo' => function ($field) {
return boolval($field);
},
],
],
],
2. Добавляем в компоненты доступы:
'odoo' => [
'class' => Connection::className(),
'url' => 'https://demo.cloudbank.biz',
'db' => 'odoo',
'username' => 'admin',
'password' => 'htcge,kbrf',
]