Merge lp:~unifield-team/unifield-server/us-1485 into lp:unifield-server
- us-1485
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4052 |
Proposed branch: | lp:~unifield-team/unifield-server/us-1485 |
Merge into: | lp:unifield-server |
Diff against target: |
235 lines (+104/-10) 4 files modified
bin/addons/msf_audittrail/data/audittrail_data_purchase.yml (+2/-2) bin/addons/msf_outgoing/report/empty_picking_ticket.rml (+57/-8) bin/addons/msf_tools/msf_tools.py (+8/-0) bin/addons/sourcing/sale_order_line.py (+37/-0) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-1485 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+309012@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/msf_audittrail/data/audittrail_data_purchase.yml' | |||
2 | --- bin/addons/msf_audittrail/data/audittrail_data_purchase.yml 2013-01-04 15:58:10 +0000 | |||
3 | +++ bin/addons/msf_audittrail/data/audittrail_data_purchase.yml 2016-10-21 10:36:08 +0000 | |||
4 | @@ -120,7 +120,7 @@ | |||
5 | 120 | rule_id = self.search(cr, uid, [('name', '=', name)], context=context) | 120 | rule_id = self.search(cr, uid, [('name', '=', name)], context=context) |
6 | 121 | if object_ids: | 121 | if object_ids: |
7 | 122 | # Create the rule | 122 | # Create the rule |
9 | 123 | fields = ['confirmed_delivery_date', 'date_planned', 'default_code', 'name', 'notes', 'price_unit', 'product_qty', 'product_uom'] | 123 | fields = ['confirmed_delivery_date', 'date_planned', 'default_code', 'name', 'notes', 'price_unit', 'product_qty', 'product_uom', 'line_number'] |
10 | 124 | 124 | ||
11 | 125 | fields_ids = self.pool.get('ir.model.fields').search(cr, uid, [('model', '=' ,'purchase.order.line'), ('name', 'in', fields)], context=context) | 125 | fields_ids = self.pool.get('ir.model.fields').search(cr, uid, [('model', '=' ,'purchase.order.line'), ('name', 'in', fields)], context=context) |
12 | 126 | field_name = self.pool.get('ir.model.fields').search(cr, uid, [('model', '=', 'purchase.order.line'), ('name', '=', 'line_number')], context=context) | 126 | field_name = self.pool.get('ir.model.fields').search(cr, uid, [('model', '=', 'purchase.order.line'), ('name', '=', 'line_number')], context=context) |
13 | @@ -184,4 +184,4 @@ | |||
14 | 184 | if rule_id: | 184 | if rule_id: |
15 | 185 | self.write(cr, uid, rule_id, vals, context=context) | 185 | self.write(cr, uid, rule_id, vals, context=context) |
16 | 186 | # Subscribe to the rule | 186 | # Subscribe to the rule |
17 | 187 | self.subscribe(cr, uid, rule_id) | ||
18 | 188 | \ No newline at end of file | 187 | \ No newline at end of file |
19 | 188 | self.subscribe(cr, uid, rule_id) | ||
20 | 189 | 189 | ||
21 | === modified file 'bin/addons/msf_outgoing/report/empty_picking_ticket.rml' | |||
22 | --- bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-07-28 12:34:28 +0000 | |||
23 | +++ bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-10-21 10:36:08 +0000 | |||
24 | @@ -4,13 +4,10 @@ | |||
25 | 4 | <!-- Templating --> | 4 | <!-- Templating --> |
26 | 5 | <template pageSize="(842.0,595.0)" title="Packing-List" author="Unifield,MSF" allowSplitting="20"> | 5 | <template pageSize="(842.0,595.0)" title="Packing-List" author="Unifield,MSF" allowSplitting="20"> |
27 | 6 | <pageTemplate id="first"> | 6 | <pageTemplate id="first"> |
29 | 7 | <frame id="first" x1="0.0" y1="0.0" width="842" height="520" /> | 7 | <frame id="first" x1="0.0" y1="0.0" width="842" height="580" /> |
30 | 8 | 8 | ||
31 | 9 | <pageGraphics> | 9 | <pageGraphics> |
32 | 10 | <setFont name="Helvetica-Bold" size="13.0"/> | 10 | <setFont name="Helvetica-Bold" size="13.0"/> |
33 | 11 | <drawString x="20.0" y="555.0">PRE-PACKING LIST ([[ getSel(objects[0], 'state') ]])</drawString> | ||
34 | 12 | <fill color="blue"/> | ||
35 | 13 | <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString> | ||
36 | 14 | <image x="705.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image> | 11 | <image x="705.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image> |
37 | 15 | <setFont name="Helvetica" size="8" /> | 12 | <setFont name="Helvetica" size="8" /> |
38 | 16 | <fill color="black" /> | 13 | <fill color="black" /> |
39 | @@ -21,13 +18,10 @@ | |||
40 | 21 | </pageTemplate> | 18 | </pageTemplate> |
41 | 22 | 19 | ||
42 | 23 | <pageTemplate id="second"> | 20 | <pageTemplate id="second"> |
44 | 24 | <frame id="second" x1="0.0" y1="0.0" width="842" height="520" /> | 21 | <frame id="second" x1="0.0" y1="0.0" width="842" height="580" /> |
45 | 25 | 22 | ||
46 | 26 | <pageGraphics> | 23 | <pageGraphics> |
47 | 27 | <setFont name="Helvetica-Bold" size="13.0"/> | 24 | <setFont name="Helvetica-Bold" size="13.0"/> |
48 | 28 | <drawString x="20.0" y="555.0">PICKING TICKET ([[ getSel(objects[0], 'state') ]])</drawString> | ||
49 | 29 | <fill color="blue"/> | ||
50 | 30 | <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString> | ||
51 | 31 | <image x="725.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image> | 25 | <image x="725.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image> |
52 | 32 | <setFont name="Helvetica" size="8" /> | 26 | <setFont name="Helvetica" size="8" /> |
53 | 33 | <fill color="black" /> | 27 | <fill color="black" /> |
54 | @@ -45,6 +39,11 @@ | |||
55 | 45 | <blockValign value="TOP" /> | 39 | <blockValign value="TOP" /> |
56 | 46 | </blockTableStyle> | 40 | </blockTableStyle> |
57 | 47 | 41 | ||
58 | 42 | <blockTableStyle id="HeaderBigInfos"> | ||
59 | 43 | <blockAlignment value="LEFT" /> | ||
60 | 44 | <blockValign value="TOP" /> | ||
61 | 45 | </blockTableStyle> | ||
62 | 46 | |||
63 | 48 | <blockTableStyle id="WarningTable"> | 47 | <blockTableStyle id="WarningTable"> |
64 | 49 | <blockAlignment value="CENTRE" /> | 48 | <blockAlignment value="CENTRE" /> |
65 | 50 | <blockValign value="MIDDLE" /> | 49 | <blockValign value="MIDDLE" /> |
66 | @@ -78,6 +77,8 @@ | |||
67 | 78 | <blockSpan start="8,0" stop="8,-1" /> | 77 | <blockSpan start="8,0" stop="8,-1" /> |
68 | 79 | </blockTableStyle> | 78 | </blockTableStyle> |
69 | 80 | 79 | ||
70 | 80 | <paraStyle name="HeaderInfosBigTitle" fontName="Helvetica-Bold" fontSize="12.0" /> | ||
71 | 81 | <paraStyle name="HeaderInfosBigTitleBlue" fontName="Helvetica-Bold" fontSize="12.0" textColor="blue" /> | ||
72 | 81 | <paraStyle name="HeaderInfosTitle" fontName="Helvetica" fontSize="8.0" /> | 82 | <paraStyle name="HeaderInfosTitle" fontName="Helvetica" fontSize="8.0" /> |
73 | 82 | <paraStyle name="HeaderInfosValue" fontName="Helvetica" fontSize="8.0" textColor="blue" /> | 83 | <paraStyle name="HeaderInfosValue" fontName="Helvetica" fontSize="8.0" textColor="blue" /> |
74 | 83 | 84 | ||
75 | @@ -98,10 +99,36 @@ | |||
76 | 98 | <story> | 99 | <story> |
77 | 99 | [[ repeatIn(objects, 'pt') ]] | 100 | [[ repeatIn(objects, 'pt') ]] |
78 | 100 | 101 | ||
79 | 102 | <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos"> | ||
80 | 103 | <tr> | ||
81 | 104 | <td> | ||
82 | 105 | <para style="HeaderInfosBigTitle"> | ||
83 | 106 | PRE-PACKING LIST ([[ getSel(pt, 'state') ]]) | ||
84 | 107 | </para> | ||
85 | 108 | <para style="HeaderInfosBigTitleBlue"> | ||
86 | 109 | [[ pt.name ]] | ||
87 | 110 | </para> | ||
88 | 111 | </td> | ||
89 | 112 | <td></td> | ||
90 | 113 | <td></td> | ||
91 | 114 | <td></td> | ||
92 | 115 | </tr> | ||
93 | 116 | </blockTable> | ||
94 | 117 | |||
95 | 101 | <!-- Empty line --> | 118 | <!-- Empty line --> |
96 | 102 | <para style="HeaderInfosTitle"> | 119 | <para style="HeaderInfosTitle"> |
97 | 103 | <font color="white"> </font> | 120 | <font color="white"> </font> |
98 | 104 | </para> | 121 | </para> |
99 | 122 | <para style="HeaderInfosTitle"> | ||
100 | 123 | <font color="white"> </font> | ||
101 | 124 | </para> | ||
102 | 125 | <para style="HeaderInfosTitle"> | ||
103 | 126 | <font color="white"> </font> | ||
104 | 127 | </para> | ||
105 | 128 | <para style="HeaderInfosTitle"> | ||
106 | 129 | <font color="white"> </font> | ||
107 | 130 | </para> | ||
108 | 131 | |||
109 | 105 | 132 | ||
110 | 106 | <!-- Picking Ticket header values --> | 133 | <!-- Picking Ticket header values --> |
111 | 107 | 134 | ||
112 | @@ -255,6 +282,27 @@ | |||
113 | 255 | 282 | ||
114 | 256 | <pto> | 283 | <pto> |
115 | 257 | <pto_header> | 284 | <pto_header> |
116 | 285 | <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos"> | ||
117 | 286 | <tr> | ||
118 | 287 | <td> | ||
119 | 288 | <para style="HeaderInfosBigTitle"> | ||
120 | 289 | PRE-PACKING LIST ([[ getSel(pt, 'state') ]]) | ||
121 | 290 | </para> | ||
122 | 291 | <para style="HeaderInfosBigTitleBlue"> | ||
123 | 292 | [[ pt.name ]] | ||
124 | 293 | </para> | ||
125 | 294 | </td> | ||
126 | 295 | <td></td> | ||
127 | 296 | <td></td> | ||
128 | 297 | <td></td> | ||
129 | 298 | </tr> | ||
130 | 299 | <tr> | ||
131 | 300 | <td></td> | ||
132 | 301 | <td></td> | ||
133 | 302 | <td></td> | ||
134 | 303 | <td></td> | ||
135 | 304 | </tr> | ||
136 | 305 | </blockTable> | ||
137 | 258 | <blockTable colWidths="30.0,60.0,220.0,55.0,75.0,65.0,20.0,20.0,20.0,55.0,45.0,45.0,50.0,50.0" style="LinesHeader"> | 306 | <blockTable colWidths="30.0,60.0,220.0,55.0,75.0,65.0,20.0,20.0,20.0,55.0,45.0,45.0,50.0,50.0" style="LinesHeader"> |
138 | 259 | <tr> | 307 | <tr> |
139 | 260 | <td> | 308 | <td> |
140 | @@ -456,6 +504,7 @@ | |||
141 | 456 | </para> | 504 | </para> |
142 | 457 | 505 | ||
143 | 458 | </pto> | 506 | </pto> |
144 | 507 | <setNextTemplate name="first" /> | ||
145 | 459 | 508 | ||
146 | 460 | </story> | 509 | </story> |
147 | 461 | 510 | ||
148 | 462 | 511 | ||
149 | === modified file 'bin/addons/msf_tools/msf_tools.py' | |||
150 | --- bin/addons/msf_tools/msf_tools.py 2016-08-22 13:55:25 +0000 | |||
151 | +++ bin/addons/msf_tools/msf_tools.py 2016-10-21 10:36:08 +0000 | |||
152 | @@ -395,6 +395,9 @@ | |||
153 | 395 | base_obj = self.pool.get(base_object) | 395 | base_obj = self.pool.get(base_object) |
154 | 396 | dest_obj = self.pool.get(dest_object) | 396 | dest_obj = self.pool.get(dest_object) |
155 | 397 | seq_obj = self.pool.get('ir.sequence') | 397 | seq_obj = self.pool.get('ir.sequence') |
156 | 398 | audit_obj = self.pool.get('audittrail.rule') | ||
157 | 399 | |||
158 | 400 | to_trace = dest_obj.check_audit(cr, uid, 'write') | ||
159 | 398 | 401 | ||
160 | 399 | # find the corresponding base ids | 402 | # find the corresponding base ids |
161 | 400 | base_ids = [x[foreign_field][0] for x in dest_obj.read(cr, uid, ids, [foreign_field], context=context) if x[foreign_field]] | 403 | base_ids = [x[foreign_field][0] for x in dest_obj.read(cr, uid, ids, [foreign_field], context=context) if x[foreign_field]] |
162 | @@ -420,6 +423,11 @@ | |||
163 | 420 | # numbering value | 423 | # numbering value |
164 | 421 | start_num = start_num+1 | 424 | start_num = start_num+1 |
165 | 422 | if item_data[i][seq_field] != start_num: | 425 | if item_data[i][seq_field] != start_num: |
166 | 426 | # Create the audittrail log line if the object is traceable | ||
167 | 427 | if to_trace: | ||
168 | 428 | previous_values = dest_obj.read(cr, uid, [item_data[i]['id']], [seq_field], context=context) | ||
169 | 429 | audit_obj.audit_log(cr, uid, to_trace, dest_obj, [item_data[i]['id']], 'write', previous_values, {item_data[i]['id']: {seq_field: start_num}}, context=context) | ||
170 | 430 | |||
171 | 423 | cr.execute("update "+dest_obj._table+" set "+seq_field+"=%s where id=%s", (start_num, item_data[i]['id'])) | 431 | cr.execute("update "+dest_obj._table+" set "+seq_field+"=%s where id=%s", (start_num, item_data[i]['id'])) |
172 | 424 | #dest_obj.write(cr, uid, [item_data[i]['id']], {seq_field: start_num}, context=context) | 432 | #dest_obj.write(cr, uid, [item_data[i]['id']], {seq_field: start_num}, context=context) |
173 | 425 | 433 | ||
174 | 426 | 434 | ||
175 | === modified file 'bin/addons/sourcing/sale_order_line.py' | |||
176 | --- bin/addons/sourcing/sale_order_line.py 2016-08-23 12:54:03 +0000 | |||
177 | +++ bin/addons/sourcing/sale_order_line.py 2016-10-21 10:36:08 +0000 | |||
178 | @@ -394,6 +394,41 @@ | |||
179 | 394 | 394 | ||
180 | 395 | return res | 395 | return res |
181 | 396 | 396 | ||
182 | 397 | def _src_line_values(self, cr, uid, obj, name, args, context=None): | ||
183 | 398 | """ | ||
184 | 399 | Returns all field order lines that match with the order category or priority | ||
185 | 400 | domain given in args. | ||
186 | 401 | |||
187 | 402 | :param cr: Cursor to the database | ||
188 | 403 | :param uid: ID of the user that runs the method | ||
189 | 404 | :param obj: Object on which the search is | ||
190 | 405 | :param field_name: Name of the field on which the search is | ||
191 | 406 | :param args: The domain | ||
192 | 407 | :param context: Context of the call | ||
193 | 408 | |||
194 | 409 | :return A list of tuples that allows the system to return the list | ||
195 | 410 | of matching field order lines | ||
196 | 411 | :rtype list | ||
197 | 412 | """ | ||
198 | 413 | if context is None: | ||
199 | 414 | context = {} | ||
200 | 415 | |||
201 | 416 | if not args: | ||
202 | 417 | return [] | ||
203 | 418 | |||
204 | 419 | domain = [('active', 'in', ['t', 'f'])] | ||
205 | 420 | for arg in args: | ||
206 | 421 | if arg[0] == 'categ': | ||
207 | 422 | domain.append(('categ', arg[1], arg[2])) | ||
208 | 423 | elif arg[0] == 'priority': | ||
209 | 424 | domain.append(('priority', arg[1], arg[2])) | ||
210 | 425 | |||
211 | 426 | order_ids = self.pool.get('sale.order').search(cr, uid, domain, context=context) | ||
212 | 427 | if order_ids: | ||
213 | 428 | return [('order_id', 'in', order_ids)] | ||
214 | 429 | |||
215 | 430 | return [] | ||
216 | 431 | |||
217 | 397 | def _search_need_sourcing(self, cr, uid, obj, name, args, context=None): | 432 | def _search_need_sourcing(self, cr, uid, obj, name, args, context=None): |
218 | 398 | """ | 433 | """ |
219 | 399 | Returns all field order lines that need to be sourced according to the | 434 | Returns all field order lines that need to be sourced according to the |
220 | @@ -511,6 +546,7 @@ | |||
221 | 511 | ), | 546 | ), |
222 | 512 | 'priority': fields.function( | 547 | 'priority': fields.function( |
223 | 513 | _get_line_values, | 548 | _get_line_values, |
224 | 549 | fnct_search=_src_line_values, | ||
225 | 514 | method=True, | 550 | method=True, |
226 | 515 | selection=ORDER_PRIORITY, | 551 | selection=ORDER_PRIORITY, |
227 | 516 | type='selection', | 552 | type='selection', |
228 | @@ -521,6 +557,7 @@ | |||
229 | 521 | ), | 557 | ), |
230 | 522 | 'categ': fields.function( | 558 | 'categ': fields.function( |
231 | 523 | _get_line_values, | 559 | _get_line_values, |
232 | 560 | fnct_search=_src_line_values, | ||
233 | 524 | method=True, | 561 | method=True, |
234 | 525 | selection=ORDER_CATEGORY, | 562 | selection=ORDER_CATEGORY, |
235 | 526 | type='selection', | 563 | type='selection', |