Merge lp:~unifield-team/unifield-server/us-1485 into lp:unifield-server

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
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+309012@code.launchpad.net
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
=== modified file 'bin/addons/msf_audittrail/data/audittrail_data_purchase.yml'
--- bin/addons/msf_audittrail/data/audittrail_data_purchase.yml 2013-01-04 15:58:10 +0000
+++ bin/addons/msf_audittrail/data/audittrail_data_purchase.yml 2016-10-21 10:36:08 +0000
@@ -120,7 +120,7 @@
120 rule_id = self.search(cr, uid, [('name', '=', name)], context=context)120 rule_id = self.search(cr, uid, [('name', '=', name)], context=context)
121 if object_ids:121 if object_ids:
122 # Create the rule122 # Create the rule
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']
124 124
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)
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)
@@ -184,4 +184,4 @@
184 if rule_id:184 if rule_id:
185 self.write(cr, uid, rule_id, vals, context=context)185 self.write(cr, uid, rule_id, vals, context=context)
186 # Subscribe to the rule186 # Subscribe to the rule
187 self.subscribe(cr, uid, rule_id)
188\ No newline at end of file187\ No newline at end of file
188 self.subscribe(cr, uid, rule_id)
189189
=== modified file 'bin/addons/msf_outgoing/report/empty_picking_ticket.rml'
--- bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-07-28 12:34:28 +0000
+++ bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-10-21 10:36:08 +0000
@@ -4,13 +4,10 @@
4 <!-- Templating -->4 <!-- Templating -->
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">
6 <pageTemplate id="first">6 <pageTemplate id="first">
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" />
88
9 <pageGraphics>9 <pageGraphics>
10 <setFont name="Helvetica-Bold" size="13.0"/>10 <setFont name="Helvetica-Bold" size="13.0"/>
11 <drawString x="20.0" y="555.0">PRE-PACKING LIST ([[ getSel(objects[0], 'state') ]])</drawString>
12 <fill color="blue"/>
13 <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString>
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>
15 <setFont name="Helvetica" size="8" />12 <setFont name="Helvetica" size="8" />
16 <fill color="black" />13 <fill color="black" />
@@ -21,13 +18,10 @@
21 </pageTemplate>18 </pageTemplate>
2219
23 <pageTemplate id="second">20 <pageTemplate id="second">
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" />
2522
26 <pageGraphics>23 <pageGraphics>
27 <setFont name="Helvetica-Bold" size="13.0"/>24 <setFont name="Helvetica-Bold" size="13.0"/>
28 <drawString x="20.0" y="555.0">PICKING TICKET ([[ getSel(objects[0], 'state') ]])</drawString>
29 <fill color="blue"/>
30 <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString>
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>
32 <setFont name="Helvetica" size="8" />26 <setFont name="Helvetica" size="8" />
33 <fill color="black" />27 <fill color="black" />
@@ -45,6 +39,11 @@
45 <blockValign value="TOP" />39 <blockValign value="TOP" />
46 </blockTableStyle>40 </blockTableStyle>
4741
42 <blockTableStyle id="HeaderBigInfos">
43 <blockAlignment value="LEFT" />
44 <blockValign value="TOP" />
45 </blockTableStyle>
46
48 <blockTableStyle id="WarningTable">47 <blockTableStyle id="WarningTable">
49 <blockAlignment value="CENTRE" />48 <blockAlignment value="CENTRE" />
50 <blockValign value="MIDDLE" />49 <blockValign value="MIDDLE" />
@@ -78,6 +77,8 @@
78 <blockSpan start="8,0" stop="8,-1" />77 <blockSpan start="8,0" stop="8,-1" />
79 </blockTableStyle>78 </blockTableStyle>
8079
80 <paraStyle name="HeaderInfosBigTitle" fontName="Helvetica-Bold" fontSize="12.0" />
81 <paraStyle name="HeaderInfosBigTitleBlue" fontName="Helvetica-Bold" fontSize="12.0" textColor="blue" />
81 <paraStyle name="HeaderInfosTitle" fontName="Helvetica" fontSize="8.0" />82 <paraStyle name="HeaderInfosTitle" fontName="Helvetica" fontSize="8.0" />
82 <paraStyle name="HeaderInfosValue" fontName="Helvetica" fontSize="8.0" textColor="blue" />83 <paraStyle name="HeaderInfosValue" fontName="Helvetica" fontSize="8.0" textColor="blue" />
8384
@@ -98,10 +99,36 @@
98 <story>99 <story>
99 [[ repeatIn(objects, 'pt') ]]100 [[ repeatIn(objects, 'pt') ]]
100101
102 <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos">
103 <tr>
104 <td>
105 <para style="HeaderInfosBigTitle">
106 PRE-PACKING LIST ([[ getSel(pt, 'state') ]])
107 </para>
108 <para style="HeaderInfosBigTitleBlue">
109 [[ pt.name ]]
110 </para>
111 </td>
112 <td></td>
113 <td></td>
114 <td></td>
115 </tr>
116 </blockTable>
117
101 <!-- Empty line -->118 <!-- Empty line -->
102 <para style="HeaderInfosTitle">119 <para style="HeaderInfosTitle">
103 <font color="white"> </font>120 <font color="white"> </font>
104 </para>121 </para>
122 <para style="HeaderInfosTitle">
123 <font color="white"> </font>
124 </para>
125 <para style="HeaderInfosTitle">
126 <font color="white"> </font>
127 </para>
128 <para style="HeaderInfosTitle">
129 <font color="white"> </font>
130 </para>
131
105132
106 <!-- Picking Ticket header values -->133 <!-- Picking Ticket header values -->
107134
@@ -255,6 +282,27 @@
255282
256 <pto>283 <pto>
257 <pto_header>284 <pto_header>
285 <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos">
286 <tr>
287 <td>
288 <para style="HeaderInfosBigTitle">
289 PRE-PACKING LIST ([[ getSel(pt, 'state') ]])
290 </para>
291 <para style="HeaderInfosBigTitleBlue">
292 [[ pt.name ]]
293 </para>
294 </td>
295 <td></td>
296 <td></td>
297 <td></td>
298 </tr>
299 <tr>
300 <td></td>
301 <td></td>
302 <td></td>
303 <td></td>
304 </tr>
305 </blockTable>
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">
259 <tr>307 <tr>
260 <td>308 <td>
@@ -456,6 +504,7 @@
456 </para>504 </para>
457505
458 </pto>506 </pto>
507 <setNextTemplate name="first" />
459508
460 </story>509 </story>
461510
462511
=== modified file 'bin/addons/msf_tools/msf_tools.py'
--- bin/addons/msf_tools/msf_tools.py 2016-08-22 13:55:25 +0000
+++ bin/addons/msf_tools/msf_tools.py 2016-10-21 10:36:08 +0000
@@ -395,6 +395,9 @@
395 base_obj = self.pool.get(base_object)395 base_obj = self.pool.get(base_object)
396 dest_obj = self.pool.get(dest_object)396 dest_obj = self.pool.get(dest_object)
397 seq_obj = self.pool.get('ir.sequence')397 seq_obj = self.pool.get('ir.sequence')
398 audit_obj = self.pool.get('audittrail.rule')
399
400 to_trace = dest_obj.check_audit(cr, uid, 'write')
398401
399 # find the corresponding base ids402 # find the corresponding base ids
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]]
@@ -420,6 +423,11 @@
420 # numbering value423 # numbering value
421 start_num = start_num+1424 start_num = start_num+1
422 if item_data[i][seq_field] != start_num:425 if item_data[i][seq_field] != start_num:
426 # Create the audittrail log line if the object is traceable
427 if to_trace:
428 previous_values = dest_obj.read(cr, uid, [item_data[i]['id']], [seq_field], context=context)
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)
430
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']))
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)
425433
426434
=== modified file 'bin/addons/sourcing/sale_order_line.py'
--- bin/addons/sourcing/sale_order_line.py 2016-08-23 12:54:03 +0000
+++ bin/addons/sourcing/sale_order_line.py 2016-10-21 10:36:08 +0000
@@ -394,6 +394,41 @@
394394
395 return res395 return res
396396
397 def _src_line_values(self, cr, uid, obj, name, args, context=None):
398 """
399 Returns all field order lines that match with the order category or priority
400 domain given in args.
401
402 :param cr: Cursor to the database
403 :param uid: ID of the user that runs the method
404 :param obj: Object on which the search is
405 :param field_name: Name of the field on which the search is
406 :param args: The domain
407 :param context: Context of the call
408
409 :return A list of tuples that allows the system to return the list
410 of matching field order lines
411 :rtype list
412 """
413 if context is None:
414 context = {}
415
416 if not args:
417 return []
418
419 domain = [('active', 'in', ['t', 'f'])]
420 for arg in args:
421 if arg[0] == 'categ':
422 domain.append(('categ', arg[1], arg[2]))
423 elif arg[0] == 'priority':
424 domain.append(('priority', arg[1], arg[2]))
425
426 order_ids = self.pool.get('sale.order').search(cr, uid, domain, context=context)
427 if order_ids:
428 return [('order_id', 'in', order_ids)]
429
430 return []
431
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):
398 """433 """
399 Returns all field order lines that need to be sourced according to the434 Returns all field order lines that need to be sourced according to the
@@ -511,6 +546,7 @@
511 ),546 ),
512 'priority': fields.function(547 'priority': fields.function(
513 _get_line_values,548 _get_line_values,
549 fnct_search=_src_line_values,
514 method=True,550 method=True,
515 selection=ORDER_PRIORITY,551 selection=ORDER_PRIORITY,
516 type='selection',552 type='selection',
@@ -521,6 +557,7 @@
521 ),557 ),
522 'categ': fields.function(558 'categ': fields.function(
523 _get_line_values,559 _get_line_values,
560 fnct_search=_src_line_values,
524 method=True,561 method=True,
525 selection=ORDER_CATEGORY,562 selection=ORDER_CATEGORY,
526 type='selection',563 type='selection',

Subscribers

People subscribed via source and target branches

to all changes: