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

Proposed by Quentin THEURET @Amaris
Status: Rejected
Rejected by: jftempo
Proposed branch: lp:~unifield-team/unifield-server/us-1485-1557-1594
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-1557-1594
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+308996@code.launchpad.net
To post a comment you must log in.
3975. By Quentin THEURET @Amaris

US-1485 [FIX] Fix layout of PPL report when the PPL report is on many pages

Unmerged revisions

3975. By Quentin THEURET @Amaris

US-1485 [FIX] Fix layout of PPL report when the PPL report is on many pages

3974. By Quentin THEURET @Amaris

US-1485 [FIX] Fix issuew with inactive field orders that were not displayed when a filter on category or priority is set

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 09:40:44 +0000
4@@ -120,7 +120,7 @@
5 rule_id = self.search(cr, uid, [('name', '=', name)], context=context)
6 if object_ids:
7 # Create the rule
8- fields = ['confirmed_delivery_date', 'date_planned', 'default_code', 'name', 'notes', 'price_unit', 'product_qty', 'product_uom']
9+ fields = ['confirmed_delivery_date', 'date_planned', 'default_code', 'name', 'notes', 'price_unit', 'product_qty', 'product_uom', 'line_number']
10
11 fields_ids = self.pool.get('ir.model.fields').search(cr, uid, [('model', '=' ,'purchase.order.line'), ('name', 'in', fields)], context=context)
12 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 if rule_id:
15 self.write(cr, uid, rule_id, vals, context=context)
16 # Subscribe to the rule
17- self.subscribe(cr, uid, rule_id)
18\ No newline at end of file
19+ self.subscribe(cr, uid, rule_id)
20
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 09:40:44 +0000
24@@ -4,13 +4,10 @@
25 <!-- Templating -->
26 <template pageSize="(842.0,595.0)" title="Packing-List" author="Unifield,MSF" allowSplitting="20">
27 <pageTemplate id="first">
28- <frame id="first" x1="0.0" y1="0.0" width="842" height="520" />
29+ <frame id="first" x1="0.0" y1="0.0" width="842" height="580" />
30
31 <pageGraphics>
32 <setFont name="Helvetica-Bold" size="13.0"/>
33- <drawString x="20.0" y="555.0">PRE-PACKING LIST ([[ getSel(objects[0], 'state') ]])</drawString>
34- <fill color="blue"/>
35- <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString>
36 <image x="705.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image>
37 <setFont name="Helvetica" size="8" />
38 <fill color="black" />
39@@ -21,13 +18,10 @@
40 </pageTemplate>
41
42 <pageTemplate id="second">
43- <frame id="second" x1="0.0" y1="0.0" width="842" height="520" />
44+ <frame id="second" x1="0.0" y1="0.0" width="842" height="580" />
45
46 <pageGraphics>
47 <setFont name="Helvetica-Bold" size="13.0"/>
48- <drawString x="20.0" y="555.0">PICKING TICKET ([[ getSel(objects[0], 'state') ]])</drawString>
49- <fill color="blue"/>
50- <drawString x="20.0" y="541.0">[[ objects[0].name ]]</drawString>
51 <image x="725.0" y="525.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image>
52 <setFont name="Helvetica" size="8" />
53 <fill color="black" />
54@@ -45,6 +39,11 @@
55 <blockValign value="TOP" />
56 </blockTableStyle>
57
58+ <blockTableStyle id="HeaderBigInfos">
59+ <blockAlignment value="LEFT" />
60+ <blockValign value="TOP" />
61+ </blockTableStyle>
62+
63 <blockTableStyle id="WarningTable">
64 <blockAlignment value="CENTRE" />
65 <blockValign value="MIDDLE" />
66@@ -78,6 +77,8 @@
67 <blockSpan start="8,0" stop="8,-1" />
68 </blockTableStyle>
69
70+ <paraStyle name="HeaderInfosBigTitle" fontName="Helvetica-Bold" fontSize="12.0" />
71+ <paraStyle name="HeaderInfosBigTitleBlue" fontName="Helvetica-Bold" fontSize="12.0" textColor="blue" />
72 <paraStyle name="HeaderInfosTitle" fontName="Helvetica" fontSize="8.0" />
73 <paraStyle name="HeaderInfosValue" fontName="Helvetica" fontSize="8.0" textColor="blue" />
74
75@@ -98,10 +99,36 @@
76 <story>
77 [[ repeatIn(objects, 'pt') ]]
78
79+ <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos">
80+ <tr>
81+ <td>
82+ <para style="HeaderInfosBigTitle">
83+ PRE-PACKING LIST ([[ getSel(pt, 'state') ]])
84+ </para>
85+ <para style="HeaderInfosBigTitleBlue">
86+ [[ pt.name ]]
87+ </para>
88+ </td>
89+ <td></td>
90+ <td></td>
91+ <td></td>
92+ </tr>
93+ </blockTable>
94+
95 <!-- Empty line -->
96 <para style="HeaderInfosTitle">
97 <font color="white"> </font>
98 </para>
99+ <para style="HeaderInfosTitle">
100+ <font color="white"> </font>
101+ </para>
102+ <para style="HeaderInfosTitle">
103+ <font color="white"> </font>
104+ </para>
105+ <para style="HeaderInfosTitle">
106+ <font color="white"> </font>
107+ </para>
108+
109
110 <!-- Picking Ticket header values -->
111
112@@ -255,6 +282,27 @@
113
114 <pto>
115 <pto_header>
116+ <blockTable colWidths="300.0,170.0,170.0,165.0" style="HeaderBigInfos">
117+ <tr>
118+ <td>
119+ <para style="HeaderInfosBigTitle">
120+ PRE-PACKING LIST ([[ getSel(pt, 'state') ]])
121+ </para>
122+ <para style="HeaderInfosBigTitleBlue">
123+ [[ pt.name ]]
124+ </para>
125+ </td>
126+ <td></td>
127+ <td></td>
128+ <td></td>
129+ </tr>
130+ <tr>
131+ <td></td>
132+ <td></td>
133+ <td></td>
134+ <td></td>
135+ </tr>
136+ </blockTable>
137 <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 <tr>
139 <td>
140@@ -456,6 +504,7 @@
141 </para>
142
143 </pto>
144+ <setNextTemplate name="first" />
145
146 </story>
147
148
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 09:40:44 +0000
152@@ -395,6 +395,9 @@
153 base_obj = self.pool.get(base_object)
154 dest_obj = self.pool.get(dest_object)
155 seq_obj = self.pool.get('ir.sequence')
156+ audit_obj = self.pool.get('audittrail.rule')
157+
158+ to_trace = dest_obj.check_audit(cr, uid, 'write')
159
160 # find the corresponding base ids
161 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 # numbering value
164 start_num = start_num+1
165 if item_data[i][seq_field] != start_num:
166+ # Create the audittrail log line if the object is traceable
167+ if to_trace:
168+ previous_values = dest_obj.read(cr, uid, [item_data[i]['id']], [seq_field], context=context)
169+ 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+
171 cr.execute("update "+dest_obj._table+" set "+seq_field+"=%s where id=%s", (start_num, item_data[i]['id']))
172 #dest_obj.write(cr, uid, [item_data[i]['id']], {seq_field: start_num}, context=context)
173
174
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 09:40:44 +0000
178@@ -394,6 +394,41 @@
179
180 return res
181
182+ def _src_line_values(self, cr, uid, obj, name, args, context=None):
183+ """
184+ Returns all field order lines that match with the order category or priority
185+ domain given in args.
186+
187+ :param cr: Cursor to the database
188+ :param uid: ID of the user that runs the method
189+ :param obj: Object on which the search is
190+ :param field_name: Name of the field on which the search is
191+ :param args: The domain
192+ :param context: Context of the call
193+
194+ :return A list of tuples that allows the system to return the list
195+ of matching field order lines
196+ :rtype list
197+ """
198+ if context is None:
199+ context = {}
200+
201+ if not args:
202+ return []
203+
204+ domain = [('active', 'in', ['t', 'f'])]
205+ for arg in args:
206+ if arg[0] == 'categ':
207+ domain.append(('categ', arg[1], arg[2]))
208+ elif arg[0] == 'priority':
209+ domain.append(('priority', arg[1], arg[2]))
210+
211+ order_ids = self.pool.get('sale.order').search(cr, uid, domain, context=context)
212+ if order_ids:
213+ return [('order_id', 'in', order_ids)]
214+
215+ return []
216+
217 def _search_need_sourcing(self, cr, uid, obj, name, args, context=None):
218 """
219 Returns all field order lines that need to be sourced according to the
220@@ -511,6 +546,7 @@
221 ),
222 'priority': fields.function(
223 _get_line_values,
224+ fnct_search=_src_line_values,
225 method=True,
226 selection=ORDER_PRIORITY,
227 type='selection',
228@@ -521,6 +557,7 @@
229 ),
230 'categ': fields.function(
231 _get_line_values,
232+ fnct_search=_src_line_values,
233 method=True,
234 selection=ORDER_CATEGORY,
235 type='selection',

Subscribers

People subscribed via source and target branches

to all changes: