Merge lp:~unifield-team/unifield-server/unidata into lp:unifield-server
- unidata
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 3679 |
Proposed branch: | lp:~unifield-team/unifield-server/unidata |
Merge into: | lp:unifield-server |
Diff against target: |
3819 lines (+1615/-563) (has conflicts) 50 files modified
bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py (+62/-18) bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen_view.xml (+3/-3) bin/addons/msf_outgoing/msf_outgoing.py (+26/-53) bin/addons/msf_outgoing/msf_outgoing_view.xml (+28/-28) bin/addons/msf_outgoing/report/empty_picking_ticket.rml (+9/-9) bin/addons/msf_outgoing/report/labels.rml (+1/-1) bin/addons/msf_outgoing/report/packing_list.rml (+8/-8) bin/addons/msf_outgoing/report/packing_list_xls.mako (+4/-4) bin/addons/msf_outgoing/report/picking_ticket.py (+3/-3) bin/addons/msf_outgoing/report/picking_ticket.rml (+9/-9) bin/addons/msf_outgoing/wizard/create_picking_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/create_picking_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/incoming_shipment_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/internal_move_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/internal_move_processor_view.xml (+5/-5) bin/addons/msf_outgoing/wizard/outgoing_delivery_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/outgoing_delivery_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/picking_processor.py (+26/-16) bin/addons/msf_outgoing/wizard/picking_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/ppl_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/ppl_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/return_ppl_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/return_ppl_processor_view.xml (+4/-4) bin/addons/msf_outgoing/wizard/stock_partial_move_view.xml (+12/-12) bin/addons/msf_outgoing/wizard/validate_picking_processor.py (+10/-6) bin/addons/msf_outgoing/wizard/validate_picking_processor_view.xml (+4/-4) bin/addons/msf_printed_documents/report/freight_manifest.py (+3/-3) bin/addons/msf_printed_documents/report/freight_manifest.rml (+1/-1) bin/addons/msf_printed_documents/report/report_reception.py (+3/-1) bin/addons/msf_printed_documents/report/report_reception.rml (+1/-1) bin/addons/msf_profile/data/patches.xml (+51/-0) bin/addons/msf_profile/msf_profile.py (+63/-0) bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+3/-3) bin/addons/product_attributes/data/product_justification_code.xml (+44/-16) bin/addons/product_attributes/product_attributes.py (+594/-25) bin/addons/product_attributes/product_attributes_data.xml (+64/-45) bin/addons/product_attributes/product_attributes_view.xml (+29/-16) bin/addons/specific_rules/specific_rules.py (+276/-102) bin/addons/specific_rules/specific_rules_view.xml (+33/-33) bin/addons/specific_rules/wizard/stock_partial_move.py (+78/-18) bin/addons/specific_rules/wizard/stock_partial_move_view.xml (+8/-8) bin/addons/specific_rules/wizard/stock_partial_picking.py (+3/-3) bin/addons/stock_forecast/wizard/stock_forecast.py (+3/-4) bin/addons/stock_override/report/destruction_location.rml (+1/-1) bin/addons/stock_override/stock.py (+2/-9) bin/addons/stock_override/stock_view.xml (+28/-28) bin/addons/sync_client/update.py (+1/-1) bin/addons/sync_so/sale.py (+8/-0) bin/osv/orm.py (+24/-6) Text conflict in bin/addons/msf_profile/data/patches.xml Text conflict in bin/addons/sync_so/sale.py |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/unidata |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email:
|
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_doc_import/wizard/wizard_in_simulation_screen.py' |
2 | --- bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2015-11-03 12:55:51 +0000 |
3 | +++ bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2016-03-24 09:31:01 +0000 |
4 | @@ -887,13 +887,15 @@ |
5 | |
6 | |
7 | product = line.imp_product_id or line.move_product_id |
8 | - res[line.id] = {'lot_check': product.batch_management, |
9 | - 'exp_check': product.perishable, |
10 | - 'kc_check': product.heat_sensitive_item and True or False, |
11 | - 'dg_check': product.dangerous_goods, |
12 | - 'np_check': product.narcotic, |
13 | - 'move_price_unit': price_unit, |
14 | - 'move_currency_id': curr_id, } |
15 | + res[line.id] = { |
16 | + 'lot_check': product.batch_management, |
17 | + 'exp_check': product.perishable, |
18 | + 'kc_check': product.kc_txt, |
19 | + 'dg_check': product.dg_txt, |
20 | + 'np_check': product.cs_txt, |
21 | + 'move_price_unit': price_unit, |
22 | + 'move_currency_id': curr_id, |
23 | + } |
24 | |
25 | return res |
26 | |
27 | @@ -975,17 +977,59 @@ |
28 | 'message_esc1': fields.char(size=256, string='Message ESC 1', readonly=True), |
29 | 'message_esc2': fields.char(size=256, string='Message ESC 2', readonly=True), |
30 | # Computed fields |
31 | - 'lot_check': fields.function(_get_values, method=True, type='boolean', |
32 | - string='B.Num', readonly=True, store=False, multi='computed'), |
33 | - 'exp_check': fields.function(_get_values, method=True, type='boolean', |
34 | - string='Exp', readonly=True, store=False, multi='computed'), |
35 | - 'kc_check': fields.function(_get_values, method=True, type='boolean', |
36 | - string='KC', readonly=True, store=False, multi='computed'), |
37 | - 'dg_check': fields.function(_get_values, method=True, type='boolean', |
38 | - string='DG', readonly=True, store=False, multi='computed'), |
39 | - 'np_check': fields.function(_get_values, method=True, type='boolean', |
40 | - string='NP', readonly=True, store=False, multi='computed'), |
41 | - 'integrity_status': fields.selection(string=' ', selection=INTEGRITY_STATUS_SELECTION, readonly=True), |
42 | + 'lot_check': fields.function( |
43 | + _get_values, |
44 | + method=True, |
45 | + type='boolean', |
46 | + string='B.Num', |
47 | + readonly=True, |
48 | + store=False, |
49 | + multi='computed', |
50 | + ), |
51 | + 'exp_check': fields.function( |
52 | + _get_values, |
53 | + method=True, |
54 | + type='boolean', |
55 | + string='Exp', |
56 | + readonly=True, |
57 | + store=False, |
58 | + multi='computed', |
59 | + ), |
60 | + 'kc_check': fields.function( |
61 | + _get_values, |
62 | + method=True, |
63 | + type='char', |
64 | + size=8, |
65 | + string='KC', |
66 | + readonly=True, |
67 | + store=False, |
68 | + multi='computed', |
69 | + ), |
70 | + 'dg_check': fields.function( |
71 | + _get_values, |
72 | + method=True, |
73 | + type='char', |
74 | + size=8, |
75 | + string='DG', |
76 | + readonly=True, |
77 | + store=False, |
78 | + multi='computed', |
79 | + ), |
80 | + 'np_check': fields.function( |
81 | + _get_values, |
82 | + method=True, |
83 | + type='char', |
84 | + size=8, |
85 | + string='CS', |
86 | + readonly=True, |
87 | + store=False, |
88 | + multi='computed', |
89 | + ), |
90 | + 'integrity_status': fields.selection( |
91 | + selection=INTEGRITY_STATUS_SELECTION, |
92 | + string=' ', |
93 | + readonly=True, |
94 | + ), |
95 | } |
96 | |
97 | _defaults = { |
98 | |
99 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen_view.xml' |
100 | --- bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen_view.xml 2014-04-09 14:39:49 +0000 |
101 | +++ bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen_view.xml 2016-03-24 09:31:01 +0000 |
102 | @@ -96,9 +96,9 @@ |
103 | <field name="imp_exp_date" /> |
104 | <field name="lot_check" /> |
105 | <field name="exp_check" /> |
106 | - <field name="kc_check" /> |
107 | - <field name="dg_check" /> |
108 | - <field name="np_check" /> |
109 | + <field name="kc_check" widget="null_boolean" /> |
110 | + <field name="dg_check" widget="null_boolean" /> |
111 | + <field name="np_check" widget="null_boolean" /> |
112 | <field name="imp_packing_list" /> |
113 | <field name="message_esc1" /> |
114 | <field name="message_esc2" /> |
115 | |
116 | === modified file 'bin/addons/msf_outgoing/msf_outgoing.py' |
117 | --- bin/addons/msf_outgoing/msf_outgoing.py 2016-03-17 13:00:29 +0000 |
118 | +++ bin/addons/msf_outgoing/msf_outgoing.py 2016-03-24 09:31:01 +0000 |
119 | @@ -2027,16 +2027,17 @@ |
120 | result = {} |
121 | |
122 | for stock_picking in self.read(cr, uid, ids, ['pack_family_memory_ids', 'move_lines'], context=context): |
123 | - values = {'total_amount': 0.0, |
124 | - 'currency_id': False, |
125 | - 'is_dangerous_good': False, |
126 | - 'is_keep_cool': False, |
127 | - 'is_narcotic': False, |
128 | - 'num_of_packs': 0, |
129 | - 'total_volume': 0.0, |
130 | - 'total_weight': 0.0, |
131 | - # 'is_completed': False, |
132 | - } |
133 | + values = { |
134 | + 'total_amount': 0.0, |
135 | + 'currency_id': False, |
136 | + 'is_dangerous_good': '', |
137 | + 'is_keep_cool': '', |
138 | + 'is_narcotic': '', |
139 | + 'num_of_packs': 0, |
140 | + 'total_volume': 0.0, |
141 | + 'total_weight': 0.0, |
142 | + # 'is_completed': False, |
143 | + } |
144 | result[stock_picking['id']] = values |
145 | |
146 | if stock_picking['pack_family_memory_ids']: |
147 | @@ -2061,11 +2062,11 @@ |
148 | # currency |
149 | values['currency_id'] = move['currency_id'] or False |
150 | # dangerous good |
151 | - values['is_dangerous_good'] = move['is_dangerous_good'] |
152 | + values['is_dangerous_good'] = values['is_dangerous_good'] or move['is_dangerous_good'] |
153 | # keep cool - if heat_sensitive_item is True |
154 | - values['is_keep_cool'] = move['is_keep_cool'] |
155 | + values['is_keep_cool'] = values['is_dangerous_good'] or move['is_keep_cool'] |
156 | # narcotic |
157 | - values['is_narcotic'] = move['is_narcotic'] |
158 | + values['is_narcotic'] = values['is_dangerous_good'] or move['is_narcotic'] |
159 | |
160 | # completed field - based on the previous_step_ids field, recursive call from picking to draft packing and packing |
161 | # - picking checks that the corresponding ppl is completed |
162 | @@ -2248,9 +2249,9 @@ |
163 | 'total_weight': fields.function(_vals_get, method=True, type='float', string='Total Weight[kg]', multi='get_vals'), |
164 | 'total_amount': fields.function(_vals_get, method=True, type='float', string='Total Amount', digits_compute=dp.get_precision('Picking Price'), multi='get_vals'), |
165 | 'currency_id': fields.function(_vals_get, method=True, type='many2one', relation='res.currency', string='Currency', multi='get_vals'), |
166 | - 'is_dangerous_good': fields.function(_vals_get, method=True, type='boolean', string='Dangerous Good', multi='get_vals'), |
167 | - 'is_keep_cool': fields.function(_vals_get, method=True, type='boolean', string='Keep Cool', multi='get_vals'), |
168 | - 'is_narcotic': fields.function(_vals_get, method=True, type='boolean', string='Narcotic', multi='get_vals'), |
169 | + 'is_dangerous_good': fields.function(_vals_get, method=True, type='char', size=8, string='Dangerous Good', multi='get_vals'), |
170 | + 'is_keep_cool': fields.function(_vals_get, method=True, type='char', size=8, string='Keep Cool', multi='get_vals'), |
171 | + 'is_narcotic': fields.function(_vals_get, method=True, type='char', size=8, string='CS', multi='get_vals'), |
172 | 'overall_qty': fields.function(_get_overall_qty, method=True, fnct_search=_qty_search, type='float', string='Overall Qty', |
173 | store={'stock.move': (_get_picking_ids, ['product_qty', 'picking_id'], 10), }), |
174 | 'line_state': fields.function(_get_lines_state, method=True, type='selection', |
175 | @@ -4466,34 +4467,6 @@ |
176 | wizard() |
177 | |
178 | |
179 | -class product_product(osv.osv): |
180 | - ''' |
181 | - add a getter for keep cool notion |
182 | - ''' |
183 | - _inherit = 'product.product' |
184 | - |
185 | - def _vals_get(self, cr, uid, ids, fields, arg, context=None): |
186 | - ''' |
187 | - get functional values |
188 | - ''' |
189 | - result = {} |
190 | - for product in self.browse(cr, uid, ids, context=context): |
191 | - values = {'is_keep_cool': False, |
192 | - } |
193 | - result[product.id] = values |
194 | - # keep cool |
195 | - is_keep_cool = bool(product.heat_sensitive_item) # in ('*', '**', '***',) |
196 | - values['is_keep_cool'] = is_keep_cool |
197 | - |
198 | - return result |
199 | - |
200 | - _columns = {'is_keep_cool': fields.function(_vals_get, method=True, type='boolean', string='Keep Cool', multi='get_vals',), |
201 | - 'prodlot_ids': fields.one2many('stock.production.lot', 'product_id', string='Batch Numbers',), |
202 | - } |
203 | - |
204 | -product_product() |
205 | - |
206 | - |
207 | class stock_move(osv.osv): |
208 | ''' |
209 | stock move |
210 | @@ -4528,9 +4501,9 @@ |
211 | 'amount': 0.0, |
212 | 'currency_id': False, |
213 | 'num_of_packs': 0, |
214 | - 'is_dangerous_good': False, |
215 | - 'is_keep_cool': False, |
216 | - 'is_narcotic': False, |
217 | + 'is_dangerous_good': '', |
218 | + 'is_keep_cool': '', |
219 | + 'is_narcotic': '', |
220 | 'sale_order_line_number': 0, |
221 | } |
222 | result[move.id] = values |
223 | @@ -4559,11 +4532,11 @@ |
224 | # currency |
225 | values['currency_id'] = move.sale_line_id and move.sale_line_id.currency_id and move.sale_line_id.currency_id.id or False |
226 | # dangerous good |
227 | - values['is_dangerous_good'] = move.product_id and move.product_id.dangerous_goods or False |
228 | + values['is_dangerous_good'] = move.product_id and move.product_id.dg_txt or '' |
229 | # keep cool - if heat_sensitive_item is True |
230 | - values['is_keep_cool'] = bool(move.product_id and move.product_id.heat_sensitive_item or False) |
231 | + values['is_keep_cool'] = move.product_id and move.product_id.kc_txt or '' |
232 | # narcotic |
233 | - values['is_narcotic'] = move.product_id and move.product_id.narcotic or False |
234 | + values['is_narcotic'] = move.product_id and move.product_id.cs_txt or '' |
235 | # sale_order_line_number |
236 | values['sale_order_line_number'] = move.sale_line_id and move.sale_line_id.line_number or 0 |
237 | |
238 | @@ -4628,9 +4601,9 @@ |
239 | 'amount': fields.function(_vals_get, method=True, type='float', string='Pack Amount', digits_compute=dp.get_precision('Picking Price'), multi='get_vals',), |
240 | 'num_of_packs': fields.function(_vals_get, method=True, type='integer', string='#Packs', multi='get_vals_X',), # old_multi get_vals |
241 | 'currency_id': fields.function(_vals_get, method=True, type='many2one', relation='res.currency', string='Currency', multi='get_vals',), |
242 | - 'is_dangerous_good': fields.function(_vals_get, method=True, type='boolean', string='Dangerous Good', multi='get_vals',), |
243 | - 'is_keep_cool': fields.function(_vals_get, method=True, type='boolean', string='Keep Cool', multi='get_vals',), |
244 | - 'is_narcotic': fields.function(_vals_get, method=True, type='boolean', string='Narcotic', multi='get_vals',), |
245 | + 'is_dangerous_good': fields.function(_vals_get, method=True, type='char', size=8, string='Dangerous Good', multi='get_vals',), |
246 | + 'is_keep_cool': fields.function(_vals_get, method=True, type='char', size=8, string='Keep Cool', multi='get_vals',), |
247 | + 'is_narcotic': fields.function(_vals_get, method=True, type='char', size=8, string='CS', multi='get_vals',), |
248 | 'sale_order_line_number': fields.function(_vals_get, method=True, type='integer', string='Sale Order Line Number', multi='get_vals_X',), # old_multi get_vals |
249 | # Fields used for domain |
250 | 'location_virtual_id': fields.many2one('stock.location', string='Virtual location'), |
251 | |
252 | === modified file 'bin/addons/msf_outgoing/msf_outgoing_view.xml' |
253 | --- bin/addons/msf_outgoing/msf_outgoing_view.xml 2016-03-10 11:12:16 +0000 |
254 | +++ bin/addons/msf_outgoing/msf_outgoing_view.xml 2016-03-24 09:31:01 +0000 |
255 | @@ -246,10 +246,10 @@ |
256 | |
257 | <field name="lot_check" /> |
258 | <field name="exp_check" /> |
259 | - <field name="kc_check" /> |
260 | - <field name="ssl_check" invisible="True" /> |
261 | - <field name="dg_check" /> |
262 | - <field name="np_check" /> |
263 | + <field name="kc_check" widget="null_boolean" /> |
264 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
265 | + <field name="dg_check" widget="null_boolean" /> |
266 | + <field name="np_check" widget="null_boolean" /> |
267 | <field name="inactive_product" invisible="1" /> |
268 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
269 | <field name="pt_created" invisible="1" /> |
270 | @@ -307,10 +307,10 @@ |
271 | <group colspan="4" col="10"> |
272 | <field name="lot_check" /> |
273 | <field name="exp_check" /> |
274 | - <field name="kc_check" /> |
275 | - <field name="ssl_check" invisible="True" /> |
276 | - <field name="dg_check" /> |
277 | - <field name="np_check" /> |
278 | + <field name="kc_check" widget="null_boolean" /> |
279 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
280 | + <field name="dg_check" widget="null_boolean" /> |
281 | + <field name="np_check" widget="null_boolean" /> |
282 | </group> |
283 | <field name="reason_type_id" |
284 | domain="[('outgoing_ok', '=', True)]" |
285 | @@ -631,10 +631,10 @@ |
286 | |
287 | <field name="lot_check" /> |
288 | <field name="exp_check" /> |
289 | - <field name="kc_check" /> |
290 | - <field name="ssl_check" invisible="True" /> |
291 | - <field name="dg_check" /> |
292 | - <field name="np_check" /> |
293 | + <field name="kc_check" widget="null_boolean" /> |
294 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
295 | + <field name="dg_check" widget="null_boolean" /> |
296 | + <field name="np_check" widget="null_boolean" /> |
297 | <field name="inactive_product" invisible="1" /> |
298 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
299 | </tree> |
300 | @@ -674,10 +674,10 @@ |
301 | <group colspan="4" col="10"> |
302 | <field name="lot_check" /> |
303 | <field name="exp_check" /> |
304 | - <field name="kc_check" /> |
305 | - <field name="ssl_check" invisible="True" /> |
306 | - <field name="dg_check" /> |
307 | - <field name="np_check" /> |
308 | + <field name="kc_check" widget="null_boolean" /> |
309 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
310 | + <field name="dg_check" widget="null_boolean" /> |
311 | + <field name="np_check" widget="null_boolean" /> |
312 | </group> |
313 | <field name="reason_type_id" attrs="{'readonly': [('state', 'not in', ('draft', 'confirmed', 'assigned'))]}" widget="selection"/> |
314 | </group> |
315 | @@ -843,10 +843,10 @@ |
316 | <field name="state"/> |
317 | <field name="lot_check" /> |
318 | <field name="exp_check" /> |
319 | - <field name="kc_check" /> |
320 | - <field name="ssl_check" invisible="True" /> |
321 | - <field name="dg_check" /> |
322 | - <field name="np_check" /> |
323 | + <field name="kc_check" widget="null_boolean" /> |
324 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
325 | + <field name="dg_check" widget="null_boolean" /> |
326 | + <field name="np_check" widget="null_boolean" /> |
327 | <field name="inactive_product" invisible="1" /> |
328 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
329 | </tree> |
330 | @@ -1012,10 +1012,10 @@ |
331 | <field name="state"/> |
332 | <field name="lot_check" /> |
333 | <field name="exp_check" /> |
334 | - <field name="kc_check" /> |
335 | - <field name="ssl_check" invisible="True" /> |
336 | - <field name="dg_check" /> |
337 | - <field name="np_check" /> |
338 | + <field name="kc_check" widget="null_boolean" /> |
339 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
340 | + <field name="dg_check" widget="null_boolean" /> |
341 | + <field name="np_check" widget="null_boolean" /> |
342 | <field name="inactive_product" invisible="1" /> |
343 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
344 | </tree> |
345 | @@ -1058,10 +1058,10 @@ |
346 | <field name="expired_date" /> |
347 | <field name="lot_check" /> |
348 | <field name="exp_check" /> |
349 | - <field name="kc_check" /> |
350 | - <field name="ssl_check" invisible="True" /> |
351 | - <field name="dg_check" /> |
352 | - <field name="np_check" /> |
353 | + <field name="kc_check" widget="null_boolean" /> |
354 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
355 | + <field name="dg_check" widget="null_boolean" /> |
356 | + <field name="np_check" widget="null_boolean" /> |
357 | </group> |
358 | <label string="" colspan="4"/> |
359 | <field name="state"/> |
360 | |
361 | === modified file 'bin/addons/msf_outgoing/report/empty_picking_ticket.rml' |
362 | --- bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-01-27 16:20:09 +0000 |
363 | +++ bin/addons/msf_outgoing/report/empty_picking_ticket.rml 2016-03-24 09:31:01 +0000 |
364 | @@ -232,7 +232,7 @@ |
365 | <para style="LineHeader">DG</para> |
366 | </td> |
367 | <td> |
368 | - <para style="LineHeader">NP</para> |
369 | + <para style="LineHeader">CS</para> |
370 | </td> |
371 | <td> |
372 | <para style="LineHeader">Qty Packed</para> |
373 | @@ -326,7 +326,7 @@ |
374 | <para style="LineHeader">DG</para> |
375 | </td> |
376 | <td> |
377 | - <para style="LineHeader">NP</para> |
378 | + <para style="LineHeader">CS</para> |
379 | </td> |
380 | <td> |
381 | <para style="LineHeader">Qty Packed</para> |
382 | @@ -371,13 +371,13 @@ |
383 | <para style="LineValue">[[ m.prodlot_id and formatLang(m.prodlot_id.life_date, date=True) or '' ]]</para> |
384 | </td> |
385 | <td> |
386 | - <para style="LineValue">[[ m.kc_check and 'X' or ' ' ]]</para> |
387 | - </td> |
388 | - <td> |
389 | - <para style="LineValue">[[ m.dg_check and 'X' or ' ' ]]</para> |
390 | - </td> |
391 | - <td> |
392 | - <para style="LineValue">[[ m.np_check and 'X' or ' ' ]]</para> |
393 | + <para style="LineValue">[[ m.product_id.kc_txt or ' ' ]]</para> |
394 | + </td> |
395 | + <td> |
396 | + <para style="LineValue">[[ m.product_id.dg_txt or ' ' ]]</para> |
397 | + </td> |
398 | + <td> |
399 | + <para style="LineValue">[[ m.product_id.cs_txt or ' ' ]]</para> |
400 | </td> |
401 | <td> |
402 | <para style="LineValueGrey">[[ not m.no_product and removeParentNode('para') ]]</para> |
403 | |
404 | === modified file 'bin/addons/msf_outgoing/report/labels.rml' |
405 | --- bin/addons/msf_outgoing/report/labels.rml 2014-04-10 13:15:01 +0000 |
406 | +++ bin/addons/msf_outgoing/report/labels.rml 2016-03-24 09:31:01 +0000 |
407 | @@ -147,7 +147,7 @@ |
408 | <para style="P4">[[ stock_picking.ppl_customize_label.specific_information and translate('Specific Information:') or ' ' ]]</para> |
409 | </td> |
410 | <td> |
411 | - <para style="P2">[[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_keep_cool and translate('KC / ') or ' ' ]][[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_dangerous_good and translate('DG / ') or ' ' ]][[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_narcotic and translate('N') or ' ' ]]</para> |
412 | + <para style="P2">[[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_keep_cool and translate('KC / ') or ' ' ]][[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_dangerous_good and translate('DG / ') or ' ' ]][[ stock_picking.ppl_customize_label.specific_information and stock_picking.is_narcotic and translate('CS') or ' ' ]]</para> |
413 | </td> |
414 | </tr> |
415 | </blockTable> |
416 | |
417 | === modified file 'bin/addons/msf_outgoing/report/packing_list.rml' |
418 | --- bin/addons/msf_outgoing/report/packing_list.rml 2015-10-26 09:46:59 +0000 |
419 | +++ bin/addons/msf_outgoing/report/packing_list.rml 2016-03-24 09:31:01 +0000 |
420 | @@ -234,7 +234,7 @@ |
421 | <para style="ParcelLineTitle">DG</para> |
422 | </td> |
423 | <td> |
424 | - <para style="ParcelLineTitle">NP</para> |
425 | + <para style="ParcelLineTitle">CS</para> |
426 | </td> |
427 | <td> |
428 | <para style="ParcelLineTitle">[[ pf.description_ppl or ' ' ]]</para> |
429 | @@ -264,13 +264,13 @@ |
430 | <para style="ParcelLineValue">[[ formatLang(m.prodlot_id.life_date, date=True) ]]</para> |
431 | </td> |
432 | <td> |
433 | - <para style="ParcelLineValue">[[ m.kc_check and 'X' or ' ' ]]</para> |
434 | - </td> |
435 | - <td> |
436 | - <para style="ParcelLineValue">[[ m.dg_check and 'X' or ' ' ]]</para> |
437 | - </td> |
438 | - <td> |
439 | - <para style="ParcelLineValue">[[ m.np_check and 'X' or ' ' ]]</para> |
440 | + <para style="ParcelLineValue">[[ m.product_id.kc_txt or ' ' ]]</para> |
441 | + </td> |
442 | + <td> |
443 | + <para style="ParcelLineValue">[[ m.product_id.dg_txt or ' ' ]]</para> |
444 | + </td> |
445 | + <td> |
446 | + <para style="ParcelLineValue">[[ m.product_id.cs_txt or ' ' ]]</para> |
447 | </td> |
448 | <td> |
449 | <para style="ParcelLineValue"></para> |
450 | |
451 | === modified file 'bin/addons/msf_outgoing/report/packing_list_xls.mako' |
452 | --- bin/addons/msf_outgoing/report/packing_list_xls.mako 2015-07-24 10:07:46 +0000 |
453 | +++ bin/addons/msf_outgoing/report/packing_list_xls.mako 2016-03-24 09:31:01 +0000 |
454 | @@ -434,7 +434,7 @@ |
455 | <Cell ss:StyleID="s131"><Data ss:Type="String">Exp. Date</Data></Cell> |
456 | <Cell ss:StyleID="s131"><Data ss:Type="String">KC</Data></Cell> |
457 | <Cell ss:StyleID="s131"><Data ss:Type="String">DG</Data></Cell> |
458 | - <Cell ss:StyleID="s131"><Data ss:Type="String">NP</Data></Cell> |
459 | + <Cell ss:StyleID="s131"><Data ss:Type="String">CS</Data></Cell> |
460 | </Row> |
461 | % for m in pf.move_lines: |
462 | <Row ss:AutoFitHeight="0" ss:Height="11.0625"> |
463 | @@ -449,9 +449,9 @@ |
464 | % else: |
465 | <Cell ss:StyleID="s134"><Data ss:Type="String"></Data></Cell> |
466 | % endif |
467 | - <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.kc_check and 'X' or '')|x}</Data></Cell> |
468 | - <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.dg_check and 'X' or '')|x}</Data></Cell> |
469 | - <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.np_check and 'X' or '')|x}</Data></Cell> |
470 | + <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.product_id.kc_txt or '')|x}</Data></Cell> |
471 | + <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.product_id.dg_txt or '')|x}</Data></Cell> |
472 | + <Cell ss:StyleID="s134"><Data ss:Type="String">${(m.product_id.cs_txt or '')|x}</Data></Cell> |
473 | </Row> |
474 | % endfor |
475 | <Row></Row> |
476 | |
477 | === modified file 'bin/addons/msf_outgoing/report/picking_ticket.py' |
478 | --- bin/addons/msf_outgoing/report/picking_ticket.py 2016-01-20 13:03:09 +0000 |
479 | +++ bin/addons/msf_outgoing/report/picking_ticket.py 2016-03-24 09:31:01 +0000 |
480 | @@ -143,9 +143,9 @@ |
481 | bm.product_uom = m.product_uom |
482 | bm.product_qty = m.product_qty |
483 | bm.prodlot_id = m.prodlot_id |
484 | - bm.kc_check = m.kc_check |
485 | - bm.dg_check = m.dg_check |
486 | - bm.np_check = m.np_check |
487 | + bm.kc_check = m.product_id and m.product_id.is_kc or False |
488 | + bm.dg_check = m.product_id and m.product_id.is_dg or False |
489 | + bm.np_check = m.product_id and m.product_id.is_cs or False |
490 | if m.prodlot_id and dict_res[m.line_number]: |
491 | bm.no_product = True |
492 | dict_res[m.line_number][0].product_qty += pool.get('product.uom')._compute_qty( |
493 | |
494 | === modified file 'bin/addons/msf_outgoing/report/picking_ticket.rml' |
495 | --- bin/addons/msf_outgoing/report/picking_ticket.rml 2016-01-14 15:39:28 +0000 |
496 | +++ bin/addons/msf_outgoing/report/picking_ticket.rml 2016-03-24 09:31:01 +0000 |
497 | @@ -235,7 +235,7 @@ |
498 | <para style="LineHeader">DG</para> |
499 | </td> |
500 | <td> |
501 | - <para style="LineHeader">NP</para> |
502 | + <para style="LineHeader">CS</para> |
503 | </td> |
504 | </tr> |
505 | <tr> |
506 | @@ -319,7 +319,7 @@ |
507 | <para style="LineHeader">DG</para> |
508 | </td> |
509 | <td> |
510 | - <para style="LineHeader">NP</para> |
511 | + <para style="LineHeader">CS</para> |
512 | </td> |
513 | </tr> |
514 | <tr> |
515 | @@ -399,13 +399,13 @@ |
516 | <para style="LineValue">[[ m.prodlot_id and formatLang(m.prodlot_id.life_date, date=True) or '' ]]</para> |
517 | </td> |
518 | <td> |
519 | - <para style="LineValue">[[ m.kc_check and 'X' or ' ' ]]</para> |
520 | - </td> |
521 | - <td> |
522 | - <para style="LineValue">[[ m.dg_check and 'X' or ' ' ]]</para> |
523 | - </td> |
524 | - <td> |
525 | - <para style="LineValue">[[ m.np_check and 'X' or ' ' ]]</para> |
526 | + <para style="LineValue">[[ m.product_id.kc_txt or ' ' ]]</para> |
527 | + </td> |
528 | + <td> |
529 | + <para style="LineValue">[[ m.product_id.dg_txt or ' ' ]]</para> |
530 | + </td> |
531 | + <td> |
532 | + <para style="LineValue">[[ m.product_id.cs_txt or ' ' ]]</para> |
533 | </td> |
534 | </tr> |
535 | <tr> |
536 | |
537 | === modified file 'bin/addons/msf_outgoing/wizard/create_picking_processor.py' |
538 | --- bin/addons/msf_outgoing/wizard/create_picking_processor.py 2014-07-22 12:11:45 +0000 |
539 | +++ bin/addons/msf_outgoing/wizard/create_picking_processor.py 2016-03-24 09:31:01 +0000 |
540 | @@ -235,7 +235,8 @@ |
541 | _get_product_info, |
542 | method=True, |
543 | string='KC', |
544 | - type='boolean', |
545 | + type='char', |
546 | + size=8, |
547 | store={ |
548 | 'create.picking.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
549 | }, |
550 | @@ -247,7 +248,8 @@ |
551 | _get_product_info, |
552 | method=True, |
553 | string='SSL', |
554 | - type='boolean', |
555 | + type='char', |
556 | + size=8, |
557 | store={ |
558 | 'create.picking.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
559 | }, |
560 | @@ -259,7 +261,8 @@ |
561 | _get_product_info, |
562 | method=True, |
563 | string='DG', |
564 | - type='boolean', |
565 | + type='char', |
566 | + size=8, |
567 | store={ |
568 | 'create.picking.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
569 | }, |
570 | @@ -270,14 +273,15 @@ |
571 | 'np_check': fields.function( |
572 | _get_product_info, |
573 | method=True, |
574 | - string='NP', |
575 | - type='boolean', |
576 | + string='CS', |
577 | + type='char', |
578 | + size=8, |
579 | store={ |
580 | 'create.picking.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
581 | }, |
582 | readonly=True, |
583 | multi='product_info', |
584 | - help="Ticked if the product is a Narcotic", |
585 | + help="Ticked if the product is a Controlled Substance", |
586 | ), |
587 | } |
588 | |
589 | |
590 | === modified file 'bin/addons/msf_outgoing/wizard/create_picking_processor_view.xml' |
591 | --- bin/addons/msf_outgoing/wizard/create_picking_processor_view.xml 2014-03-04 14:33:23 +0000 |
592 | +++ bin/addons/msf_outgoing/wizard/create_picking_processor_view.xml 2016-03-24 09:31:01 +0000 |
593 | @@ -42,7 +42,7 @@ |
594 | <field name="kit_check" invisible="1" /> |
595 | <field name="asset_check" invisible="1" /> |
596 | <field name="location_id" invisible="1" /> |
597 | - <field name="ssl_check" invisible="1" /> |
598 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
599 | <!-- Visible fields --> |
600 | <field name="line_number" string="Line" /> |
601 | <field name="product_id" string="Product" /> |
602 | @@ -87,9 +87,9 @@ |
603 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
604 | <field name="lot_check" /> |
605 | <field name="exp_check" /> |
606 | - <field name="kc_check" /> |
607 | - <field name="dg_check" /> |
608 | - <field name="np_check" /> |
609 | + <field name="kc_check" widget="null_boolean" /> |
610 | + <field name="dg_check" widget="null_boolean" /> |
611 | + <field name="np_check" widget="null_boolean" /> |
612 | <field name="cost" invisible="1" /> |
613 | <field name="currency" invisible="1" /> |
614 | <field name="integrity_status" string="" /> |
615 | |
616 | === modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py' |
617 | --- bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2015-11-16 08:28:07 +0000 |
618 | +++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2016-03-24 09:31:01 +0000 |
619 | @@ -656,7 +656,8 @@ |
620 | _get_product_info, |
621 | method=True, |
622 | string='KC', |
623 | - type='boolean', |
624 | + type='char', |
625 | + size=8, |
626 | store={ |
627 | 'stock.move.in.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
628 | }, |
629 | @@ -668,7 +669,8 @@ |
630 | _get_product_info, |
631 | method=True, |
632 | string='SSL', |
633 | - type='boolean', |
634 | + type='char', |
635 | + size=8, |
636 | store={ |
637 | 'stock.move.in.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
638 | }, |
639 | @@ -680,7 +682,8 @@ |
640 | _get_product_info, |
641 | method=True, |
642 | string='DG', |
643 | - type='boolean', |
644 | + type='char', |
645 | + size=8, |
646 | store={ |
647 | 'stock.move.in.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
648 | }, |
649 | @@ -691,14 +694,15 @@ |
650 | 'np_check': fields.function( |
651 | _get_product_info, |
652 | method=True, |
653 | - string='NP', |
654 | - type='boolean', |
655 | + string='CS', |
656 | + type='char', |
657 | + size=8, |
658 | store={ |
659 | 'stock.move.in.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
660 | }, |
661 | readonly=True, |
662 | multi='product_info', |
663 | - help="Ticked if the product is a Narcotic", |
664 | + help="Ticked if the product is a Controlled Substance", |
665 | ), |
666 | } |
667 | |
668 | |
669 | === modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor_view.xml' |
670 | --- bin/addons/msf_outgoing/wizard/incoming_shipment_processor_view.xml 2015-05-22 14:03:49 +0000 |
671 | +++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor_view.xml 2016-03-24 09:31:01 +0000 |
672 | @@ -107,7 +107,7 @@ |
673 | <field name="kit_check" invisible="1" /> |
674 | <field name="asset_check" invisible="1" /> |
675 | <field name="location_id" invisible="1" /> |
676 | - <field name="ssl_check" invisible="1" /> |
677 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
678 | <!-- Visible fields --> |
679 | <field name="line_number" string="Line" /> |
680 | <field name="product_id" string="Product" /> |
681 | @@ -153,9 +153,9 @@ |
682 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
683 | <field name="lot_check" /> |
684 | <field name="exp_check" /> |
685 | - <field name="kc_check" /> |
686 | - <field name="dg_check" /> |
687 | - <field name="np_check" /> |
688 | + <field name="kc_check" widget="null_boolean" /> |
689 | + <field name="dg_check" widget="null_boolean" /> |
690 | + <field name="np_check" widget="null_boolean" /> |
691 | <field name="cost" /> |
692 | <field name="currency" /> |
693 | <field name="integrity_status" string="" /> |
694 | |
695 | === modified file 'bin/addons/msf_outgoing/wizard/internal_move_processor.py' |
696 | --- bin/addons/msf_outgoing/wizard/internal_move_processor.py 2014-09-19 12:34:58 +0000 |
697 | +++ bin/addons/msf_outgoing/wizard/internal_move_processor.py 2016-03-24 09:31:01 +0000 |
698 | @@ -534,7 +534,8 @@ |
699 | _get_product_info, |
700 | method=True, |
701 | string='KC', |
702 | - type='boolean', |
703 | + type='char', |
704 | + size=8, |
705 | store={ |
706 | 'internal.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
707 | }, |
708 | @@ -546,7 +547,8 @@ |
709 | _get_product_info, |
710 | method=True, |
711 | string='SSL', |
712 | - type='boolean', |
713 | + type='char', |
714 | + size=8, |
715 | store={ |
716 | 'internal.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
717 | }, |
718 | @@ -558,7 +560,8 @@ |
719 | _get_product_info, |
720 | method=True, |
721 | string='DG', |
722 | - type='boolean', |
723 | + type='char', |
724 | + size=8, |
725 | store={ |
726 | 'internal.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
727 | }, |
728 | @@ -569,14 +572,15 @@ |
729 | 'np_check': fields.function( |
730 | _get_product_info, |
731 | method=True, |
732 | - string='NP', |
733 | - type='boolean', |
734 | + sstring='CS', |
735 | + type='char', |
736 | + size=8, |
737 | store={ |
738 | 'internal.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
739 | }, |
740 | readonly=True, |
741 | multi='product_info', |
742 | - help="Ticked if the product is a Narcotic", |
743 | + help="Ticked if the product is a Controlled Substance", |
744 | ), |
745 | } |
746 | |
747 | |
748 | === modified file 'bin/addons/msf_outgoing/wizard/internal_move_processor_view.xml' |
749 | --- bin/addons/msf_outgoing/wizard/internal_move_processor_view.xml 2014-03-05 16:09:08 +0000 |
750 | +++ bin/addons/msf_outgoing/wizard/internal_move_processor_view.xml 2016-03-24 09:31:01 +0000 |
751 | @@ -62,7 +62,7 @@ |
752 | <field name="kit_check" invisible="1" /> |
753 | <field name="asset_check" invisible="1" /> |
754 | <field name="location_id" invisible="1" /> |
755 | - <field name="ssl_check" invisible="1" /> |
756 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
757 | <!-- Visible fields --> |
758 | <field name="line_number" string="Line" /> |
759 | <field name="product_id" string="Product" /> |
760 | @@ -107,9 +107,9 @@ |
761 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
762 | <field name="lot_check" /> |
763 | <field name="exp_check" /> |
764 | - <field name="kc_check" /> |
765 | - <field name="dg_check" /> |
766 | - <field name="np_check" /> |
767 | + <field name="kc_check" widget="null_boolean" /> |
768 | + <field name="dg_check" widget="null_boolean" /> |
769 | + <field name="np_check" widget="null_boolean" /> |
770 | <field name="cost" invisible="1" /> |
771 | <field name="currency" invisible="1" /> |
772 | <field name="integrity_status" string="" /> |
773 | @@ -118,4 +118,4 @@ |
774 | </record> |
775 | |
776 | </data> |
777 | -</openerp> |
778 | \ No newline at end of file |
779 | +</openerp> |
780 | |
781 | === modified file 'bin/addons/msf_outgoing/wizard/outgoing_delivery_processor.py' |
782 | --- bin/addons/msf_outgoing/wizard/outgoing_delivery_processor.py 2014-03-05 10:32:45 +0000 |
783 | +++ bin/addons/msf_outgoing/wizard/outgoing_delivery_processor.py 2016-03-24 09:31:01 +0000 |
784 | @@ -322,7 +322,8 @@ |
785 | _get_product_info, |
786 | method=True, |
787 | string='KC', |
788 | - type='boolean', |
789 | + type='char', |
790 | + size=8, |
791 | store={ |
792 | 'outgoing.delivery.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
793 | }, |
794 | @@ -334,7 +335,8 @@ |
795 | _get_product_info, |
796 | method=True, |
797 | string='SSL', |
798 | - type='boolean', |
799 | + type='char', |
800 | + size=8, |
801 | store={ |
802 | 'outgoing.delivery.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
803 | }, |
804 | @@ -346,7 +348,8 @@ |
805 | _get_product_info, |
806 | method=True, |
807 | string='DG', |
808 | - type='boolean', |
809 | + type='char', |
810 | + size=8, |
811 | store={ |
812 | 'outgoing.delivery.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
813 | }, |
814 | @@ -357,14 +360,15 @@ |
815 | 'np_check': fields.function( |
816 | _get_product_info, |
817 | method=True, |
818 | - string='NP', |
819 | - type='boolean', |
820 | + string='CS', |
821 | + type='char', |
822 | + size=8, |
823 | store={ |
824 | 'outgoing.delivery.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
825 | }, |
826 | readonly=True, |
827 | multi='product_info', |
828 | - help="Ticked if the product is a Narcotic", |
829 | + help="Ticked if the product is a Controlled Substance", |
830 | ), |
831 | } |
832 | |
833 | |
834 | === modified file 'bin/addons/msf_outgoing/wizard/outgoing_delivery_processor_view.xml' |
835 | --- bin/addons/msf_outgoing/wizard/outgoing_delivery_processor_view.xml 2014-03-04 14:33:23 +0000 |
836 | +++ bin/addons/msf_outgoing/wizard/outgoing_delivery_processor_view.xml 2016-03-24 09:31:01 +0000 |
837 | @@ -42,7 +42,7 @@ |
838 | <field name="kit_check" invisible="1" /> |
839 | <field name="asset_check" invisible="1" /> |
840 | <field name="location_id" invisible="1" /> |
841 | - <field name="ssl_check" invisible="1" /> |
842 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
843 | <!-- Visible fields --> |
844 | <field name="line_number" string="Line" /> |
845 | <field name="product_id" string="Product" /> |
846 | @@ -87,9 +87,9 @@ |
847 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
848 | <field name="lot_check" /> |
849 | <field name="exp_check" /> |
850 | - <field name="kc_check" /> |
851 | - <field name="dg_check" /> |
852 | - <field name="np_check" /> |
853 | + <field name="kc_check" widget="null_boolean" /> |
854 | + <field name="dg_check" widget="null_boolean" /> |
855 | + <field name="np_check" widget="null_boolean" /> |
856 | <field name="cost" /> |
857 | <field name="currency" /> |
858 | <field name="integrity_status" string="" /> |
859 | |
860 | === modified file 'bin/addons/msf_outgoing/wizard/picking_processor.py' |
861 | --- bin/addons/msf_outgoing/wizard/picking_processor.py 2016-03-02 15:57:47 +0000 |
862 | +++ bin/addons/msf_outgoing/wizard/picking_processor.py 2016-03-24 09:31:01 +0000 |
863 | @@ -58,11 +58,17 @@ |
864 | 'contains_dg': False, |
865 | } |
866 | # KC |
867 | - kc_lines = line_obj.search(cr, uid, [('wizard_id', '=', wizard_id), ('kc_check', '=', True)], context=context) |
868 | + kc_lines = line_obj.search(cr, uid, [ |
869 | + ('wizard_id', '=', wizard_id), |
870 | + ('kc_check', '!=', ''), |
871 | + ], limit=1, order='NO_ORDER', context=context) |
872 | if kc_lines: |
873 | res[wizard_id]['contains_kc'] = True |
874 | # DG |
875 | - dg_lines = line_obj.search(cr, uid, [('wizard_id', '=', wizard_id), ('dg_check', '=', True)], context=context) |
876 | + dg_lines = line_obj.search(cr, uid, [ |
877 | + ('wizard_id', '=', wizard_id), |
878 | + ('dg_check', '!=', ''), |
879 | + ], limit=1, order='NO_ORDER', context=context) |
880 | if dg_lines: |
881 | res[wizard_id]['contains_dg'] = True |
882 | |
883 | @@ -284,10 +290,10 @@ |
884 | 'exp_check': False, |
885 | 'asset_check': False, |
886 | 'kit_check': False, |
887 | - 'kc_check': False, |
888 | - 'ssl_check': False, |
889 | - 'dg_check': False, |
890 | - 'np_check': False, |
891 | + 'kc_check': '', |
892 | + 'ssl_check': '', |
893 | + 'dg_check': '', |
894 | + 'np_check': '', |
895 | } |
896 | |
897 | if line.product_id: |
898 | @@ -296,10 +302,10 @@ |
899 | 'exp_check': line.product_id.perishable, |
900 | 'asset_check': line.product_id.type == 'product' and line.product_id.subtype == 'asset', |
901 | 'kit_check': line.product_id.type == 'product' and line.product_id.subtype == 'kit' and not line.product_id.perishable, |
902 | - 'kc_check': line.product_id.heat_sensitive_item and True or False, |
903 | - 'ssl_check': line.product_id.short_shelf_life, |
904 | - 'dg_check': line.product_id.dangerous_goods, |
905 | - 'np_check': line.product_id.narcotic, |
906 | + 'kc_check': line.product_id.kc_txt, |
907 | + 'ssl_check': line.product_id.ssl_txt, |
908 | + 'dg_check': line.product_id.dg_txt, |
909 | + 'np_check': line.product_id.cs_txt, |
910 | } |
911 | |
912 | return res |
913 | @@ -576,7 +582,8 @@ |
914 | _get_product_info, |
915 | method=True, |
916 | string='KC', |
917 | - type='boolean', |
918 | + type='char', |
919 | + size=8, |
920 | store={ |
921 | 'stock.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
922 | }, |
923 | @@ -588,7 +595,8 @@ |
924 | _get_product_info, |
925 | method=True, |
926 | string='SSL', |
927 | - type='boolean', |
928 | + type='char', |
929 | + size=8, |
930 | store={ |
931 | 'stock.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
932 | }, |
933 | @@ -600,7 +608,8 @@ |
934 | _get_product_info, |
935 | method=True, |
936 | string='DG', |
937 | - type='boolean', |
938 | + type='char', |
939 | + size=8, |
940 | store={ |
941 | 'stock.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
942 | }, |
943 | @@ -611,14 +620,15 @@ |
944 | 'np_check': fields.function( |
945 | _get_product_info, |
946 | method=True, |
947 | - string='NP', |
948 | - type='boolean', |
949 | + string='CS', |
950 | + type='char', |
951 | + size=8, |
952 | store={ |
953 | 'stock.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
954 | }, |
955 | readonly=True, |
956 | multi='product_info', |
957 | - help="Ticked if the product is a Narcotic", |
958 | + help="Ticked if the product is a Controlled Substance", |
959 | ), |
960 | 'prodlot_id': fields.many2one( |
961 | 'stock.production.lot', |
962 | |
963 | === modified file 'bin/addons/msf_outgoing/wizard/picking_processor_view.xml' |
964 | --- bin/addons/msf_outgoing/wizard/picking_processor_view.xml 2014-02-24 16:08:27 +0000 |
965 | +++ bin/addons/msf_outgoing/wizard/picking_processor_view.xml 2016-03-24 09:31:01 +0000 |
966 | @@ -42,7 +42,7 @@ |
967 | <field name="kit_check" invisible="1" /> |
968 | <field name="asset_check" invisible="1" /> |
969 | <field name="location_id" invisible="1" /> |
970 | - <field name="ssl_check" invisible="1" /> |
971 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
972 | <!-- Visible fields --> |
973 | <field name="line_number" string="Line" /> |
974 | <field name="product_id" string="Product" /> |
975 | @@ -87,9 +87,9 @@ |
976 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
977 | <field name="lot_check" /> |
978 | <field name="exp_check" /> |
979 | - <field name="kc_check" /> |
980 | - <field name="dg_check" /> |
981 | - <field name="np_check" /> |
982 | + <field name="kc_check" widget="null_boolean" /> |
983 | + <field name="dg_check" widget="null_boolean" /> |
984 | + <field name="np_check" widget="null_boolean" /> |
985 | <field name="cost" /> |
986 | <field name="currency" /> |
987 | <field name="integrity_status" string="" /> |
988 | |
989 | === modified file 'bin/addons/msf_outgoing/wizard/ppl_processor.py' |
990 | --- bin/addons/msf_outgoing/wizard/ppl_processor.py 2015-08-27 08:44:05 +0000 |
991 | +++ bin/addons/msf_outgoing/wizard/ppl_processor.py 2016-03-24 09:31:01 +0000 |
992 | @@ -554,7 +554,8 @@ |
993 | _get_product_info, |
994 | method=True, |
995 | string='KC', |
996 | - type='boolean', |
997 | + type='char', |
998 | + size=8, |
999 | store={ |
1000 | 'ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1001 | }, |
1002 | @@ -566,7 +567,8 @@ |
1003 | _get_product_info, |
1004 | method=True, |
1005 | string='SSL', |
1006 | - type='boolean', |
1007 | + type='char', |
1008 | + size=8, |
1009 | store={ |
1010 | 'ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1011 | }, |
1012 | @@ -578,7 +580,8 @@ |
1013 | _get_product_info, |
1014 | method=True, |
1015 | string='DG', |
1016 | - type='boolean', |
1017 | + type='char', |
1018 | + size=8, |
1019 | store={ |
1020 | 'ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1021 | }, |
1022 | @@ -589,14 +592,15 @@ |
1023 | 'np_check': fields.function( |
1024 | _get_product_info, |
1025 | method=True, |
1026 | - string='NP', |
1027 | - type='boolean', |
1028 | + string='CS', |
1029 | + type='char', |
1030 | + size=8, |
1031 | store={ |
1032 | 'ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1033 | }, |
1034 | readonly=True, |
1035 | multi='product_info', |
1036 | - help="Ticked if the product is a Narcotic", |
1037 | + help="Ticked if the product is a Controlled Substance", |
1038 | ), |
1039 | } |
1040 | |
1041 | |
1042 | === modified file 'bin/addons/msf_outgoing/wizard/ppl_processor_view.xml' |
1043 | --- bin/addons/msf_outgoing/wizard/ppl_processor_view.xml 2015-05-19 08:44:23 +0000 |
1044 | +++ bin/addons/msf_outgoing/wizard/ppl_processor_view.xml 2016-03-24 09:31:01 +0000 |
1045 | @@ -56,7 +56,7 @@ |
1046 | colors="red: integrity_status not in ('ok', 'empty'); green: integrity_status in ('ok');" |
1047 | > |
1048 | <!-- Invisible fields --> |
1049 | - <field name="ssl_check" invisible="1" /> |
1050 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
1051 | |
1052 | <field name="line_number" |
1053 | string="Line" |
1054 | @@ -87,9 +87,9 @@ |
1055 | /> |
1056 | <field name="lot_check" /> |
1057 | <field name="exp_check" /> |
1058 | - <field name="kc_check" /> |
1059 | - <field name="dg_check" /> |
1060 | - <field name="np_check" /> |
1061 | + <field name="kc_check" widget="null_boolean" /> |
1062 | + <field name="dg_check" widget="null_boolean" /> |
1063 | + <field name="np_check" widget="null_boolean" /> |
1064 | <field name="integrity_status" string="" /> |
1065 | </tree> |
1066 | </field> |
1067 | |
1068 | === modified file 'bin/addons/msf_outgoing/wizard/return_ppl_processor.py' |
1069 | --- bin/addons/msf_outgoing/wizard/return_ppl_processor.py 2014-03-05 16:51:14 +0000 |
1070 | +++ bin/addons/msf_outgoing/wizard/return_ppl_processor.py 2016-03-24 09:31:01 +0000 |
1071 | @@ -258,7 +258,8 @@ |
1072 | _get_product_info, |
1073 | method=True, |
1074 | string='KC', |
1075 | - type='boolean', |
1076 | + type='char', |
1077 | + size=8, |
1078 | store={ |
1079 | 'return.ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1080 | }, |
1081 | @@ -270,7 +271,8 @@ |
1082 | _get_product_info, |
1083 | method=True, |
1084 | string='SSL', |
1085 | - type='boolean', |
1086 | + type='char', |
1087 | + size=8, |
1088 | store={ |
1089 | 'return.ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1090 | }, |
1091 | @@ -282,7 +284,8 @@ |
1092 | _get_product_info, |
1093 | method=True, |
1094 | string='DG', |
1095 | - type='boolean', |
1096 | + type='char', |
1097 | + size=8, |
1098 | store={ |
1099 | 'return.ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1100 | }, |
1101 | @@ -293,14 +296,15 @@ |
1102 | 'np_check': fields.function( |
1103 | _get_product_info, |
1104 | method=True, |
1105 | - string='NP', |
1106 | - type='boolean', |
1107 | + string='CS', |
1108 | + type='char', |
1109 | + size=8, |
1110 | store={ |
1111 | 'return.ppl.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1112 | }, |
1113 | readonly=True, |
1114 | multi='product_info', |
1115 | - help="Ticked if the product is a Narcotic", |
1116 | + help="Ticked if the product is a Controlled Substance", |
1117 | ), |
1118 | } |
1119 | |
1120 | |
1121 | === modified file 'bin/addons/msf_outgoing/wizard/return_ppl_processor_view.xml' |
1122 | --- bin/addons/msf_outgoing/wizard/return_ppl_processor_view.xml 2014-02-27 16:45:04 +0000 |
1123 | +++ bin/addons/msf_outgoing/wizard/return_ppl_processor_view.xml 2016-03-24 09:31:01 +0000 |
1124 | @@ -37,7 +37,7 @@ |
1125 | colors="red: integrity_status not in ('ok', 'empty'); green: integrity_status in ('ok');" |
1126 | > |
1127 | <!-- Invisible fields --> |
1128 | - <field name="ssl_check" invisible="1" /> |
1129 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
1130 | |
1131 | <field name="line_number" |
1132 | string="Line" |
1133 | @@ -62,9 +62,9 @@ |
1134 | <field name="expiry_date" readonly="1" /> |
1135 | <field name="lot_check" /> |
1136 | <field name="exp_check" /> |
1137 | - <field name="kc_check" /> |
1138 | - <field name="dg_check" /> |
1139 | - <field name="np_check" /> |
1140 | + <field name="kc_check" widget="null_boolean" /> |
1141 | + <field name="dg_check" widget="null_boolean" /> |
1142 | + <field name="np_check" widget="null_boolean" /> |
1143 | <field name="integrity_status" string="" /> |
1144 | </tree> |
1145 | </field> |
1146 | |
1147 | === modified file 'bin/addons/msf_outgoing/wizard/stock_partial_move_view.xml' |
1148 | --- bin/addons/msf_outgoing/wizard/stock_partial_move_view.xml 2013-09-05 09:50:18 +0000 |
1149 | +++ bin/addons/msf_outgoing/wizard/stock_partial_move_view.xml 2016-03-24 09:31:01 +0000 |
1150 | @@ -38,10 +38,10 @@ |
1151 | <button name="split" string="Split" colspan="1" type="object" icon="terp-stock_effects-object-colorize" /> |
1152 | <field name="lot_check" /> |
1153 | <field name="exp_check" /> |
1154 | - <field name="kc_check" /> |
1155 | - <field name="ssl_check" invisible="True" /> |
1156 | - <field name="dg_check" /> |
1157 | - <field name="np_check" /> |
1158 | + <field name="kc_check" widget="null_boolean" /> |
1159 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
1160 | + <field name="dg_check" widget="null_boolean" /> |
1161 | + <field name="np_check" widget="null_boolean" /> |
1162 | <field name="integrity_status" /> |
1163 | <field name="location_id" invisible="1" /> |
1164 | </tree> |
1165 | @@ -65,10 +65,10 @@ |
1166 | <field name="qty_to_return" on_change="onchange_uom_qty(product_uom, qty_to_return)" /> |
1167 | <field name="lot_check" /> |
1168 | <field name="exp_check" /> |
1169 | - <field name="kc_check" /> |
1170 | - <field name="ssl_check" invisible="True" /> |
1171 | - <field name="dg_check" /> |
1172 | - <field name="np_check" /> |
1173 | + <field name="kc_check" widget="null_boolean" /> |
1174 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
1175 | + <field name="dg_check" widget="null_boolean" /> |
1176 | + <field name="np_check" widget="null_boolean" /> |
1177 | <field name="integrity_status" /> |
1178 | </tree> |
1179 | </field> |
1180 | @@ -93,10 +93,10 @@ |
1181 | <button name="split" string="Split" colspan="1" type="object" icon="terp-stock_effects-object-colorize" /> |
1182 | <field name="lot_check" /> |
1183 | <field name="exp_check" /> |
1184 | - <field name="kc_check" /> |
1185 | - <field name="ssl_check" invisible="True" /> |
1186 | - <field name="dg_check" /> |
1187 | - <field name="np_check" /> |
1188 | + <field name="kc_check" widget="null_boolean" /> |
1189 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
1190 | + <field name="dg_check" widget="null_boolean" /> |
1191 | + <field name="np_check" widget="null_boolean" /> |
1192 | <field name="integrity_status" /> |
1193 | </tree> |
1194 | </field> |
1195 | |
1196 | === modified file 'bin/addons/msf_outgoing/wizard/validate_picking_processor.py' |
1197 | --- bin/addons/msf_outgoing/wizard/validate_picking_processor.py 2014-03-05 16:51:14 +0000 |
1198 | +++ bin/addons/msf_outgoing/wizard/validate_picking_processor.py 2016-03-24 09:31:01 +0000 |
1199 | @@ -329,7 +329,8 @@ |
1200 | _get_product_info, |
1201 | method=True, |
1202 | string='KC', |
1203 | - type='boolean', |
1204 | + type='char', |
1205 | + size=8, |
1206 | store={ |
1207 | 'validate.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1208 | }, |
1209 | @@ -341,7 +342,8 @@ |
1210 | _get_product_info, |
1211 | method=True, |
1212 | string='SSL', |
1213 | - type='boolean', |
1214 | + type='char', |
1215 | + size=8, |
1216 | store={ |
1217 | 'validate.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1218 | }, |
1219 | @@ -353,7 +355,8 @@ |
1220 | _get_product_info, |
1221 | method=True, |
1222 | string='DG', |
1223 | - type='boolean', |
1224 | + type='char', |
1225 | + size=8, |
1226 | store={ |
1227 | 'validate.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1228 | }, |
1229 | @@ -364,14 +367,15 @@ |
1230 | 'np_check': fields.function( |
1231 | _get_product_info, |
1232 | method=True, |
1233 | - string='NP', |
1234 | - type='boolean', |
1235 | + string='CS', |
1236 | + type='char', |
1237 | + size=8, |
1238 | store={ |
1239 | 'validate.move.processor': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 20), |
1240 | }, |
1241 | readonly=True, |
1242 | multi='product_info', |
1243 | - help="Ticked if the product is a Narcotic", |
1244 | + help="Ticked if the product is a Controlled Substance", |
1245 | ), |
1246 | } |
1247 | |
1248 | |
1249 | === modified file 'bin/addons/msf_outgoing/wizard/validate_picking_processor_view.xml' |
1250 | --- bin/addons/msf_outgoing/wizard/validate_picking_processor_view.xml 2014-03-05 09:05:16 +0000 |
1251 | +++ bin/addons/msf_outgoing/wizard/validate_picking_processor_view.xml 2016-03-24 09:31:01 +0000 |
1252 | @@ -42,7 +42,7 @@ |
1253 | <field name="kit_check" invisible="1" /> |
1254 | <field name="asset_check" invisible="1" /> |
1255 | <field name="location_id" invisible="1" /> |
1256 | - <field name="ssl_check" invisible="1" /> |
1257 | + <field name="ssl_check" invisible="1" widget="null_boolean" /> |
1258 | <!-- Visible fields --> |
1259 | <field name="line_number" string="Line" /> |
1260 | <field name="product_id" string="Product" /> |
1261 | @@ -87,9 +87,9 @@ |
1262 | on_change="change_expiry(expiry_date, product_id, type_check)" /> |
1263 | <field name="lot_check" /> |
1264 | <field name="exp_check" /> |
1265 | - <field name="kc_check" /> |
1266 | - <field name="dg_check" /> |
1267 | - <field name="np_check" /> |
1268 | + <field name="kc_check" widget="null_boolean" /> |
1269 | + <field name="dg_check" widget="null_boolean" /> |
1270 | + <field name="np_check" widget="null_boolean" /> |
1271 | <field name="cost" invisible="1" /> |
1272 | <field name="currency" invisible="1" /> |
1273 | <field name="integrity_status" string="" /> |
1274 | |
1275 | === modified file 'bin/addons/msf_printed_documents/report/freight_manifest.py' |
1276 | --- bin/addons/msf_printed_documents/report/freight_manifest.py 2015-10-26 09:42:39 +0000 |
1277 | +++ bin/addons/msf_printed_documents/report/freight_manifest.py 2016-03-24 09:31:01 +0000 |
1278 | @@ -95,11 +95,11 @@ |
1279 | np = "" |
1280 | for x in line.move_lines: |
1281 | if x.kc_check: |
1282 | - kc = 'X' |
1283 | + kc = x.kc_check |
1284 | if x.dg_check: |
1285 | - dg = 'X' |
1286 | + dg = x.dg_check |
1287 | if x.np_check: |
1288 | - np = 'X' |
1289 | + np = x.np_check |
1290 | |
1291 | if line_ref not in line_obj: |
1292 | line_obj[line_ref] = {} |
1293 | |
1294 | === modified file 'bin/addons/msf_printed_documents/report/freight_manifest.rml' |
1295 | --- bin/addons/msf_printed_documents/report/freight_manifest.rml 2015-05-28 12:51:01 +0000 |
1296 | +++ bin/addons/msf_printed_documents/report/freight_manifest.rml 2016-03-24 09:31:01 +0000 |
1297 | @@ -524,7 +524,7 @@ |
1298 | <para style="TextInformation5" alignment="CENTER">DG</para> |
1299 | </td> |
1300 | <td> |
1301 | - <para style="TextInformation5" alignment="CENTER">NP</para> |
1302 | + <para style="TextInformation5" alignment="CENTER">CS</para> |
1303 | </td> |
1304 | </tr> |
1305 | |
1306 | |
1307 | === modified file 'bin/addons/msf_printed_documents/report/report_reception.py' |
1308 | --- bin/addons/msf_printed_documents/report/report_reception.py 2015-05-22 08:34:02 +0000 |
1309 | +++ bin/addons/msf_printed_documents/report/report_reception.py 2016-03-24 09:31:01 +0000 |
1310 | @@ -180,8 +180,10 @@ |
1311 | 'ed': 'exp_check', |
1312 | } |
1313 | |
1314 | - if opt in options and hasattr(line, options[opt]) and getattr(line, options[opt]) == True: |
1315 | + if opt in options and hasattr(line, options[opt]) and getattr(line, options[opt]) is True: |
1316 | return 'X' |
1317 | + elif opt in options and hasattr(line, options[opt]): |
1318 | + return getattr(line, options[opt]) |
1319 | |
1320 | return ' ' |
1321 | |
1322 | |
1323 | === modified file 'bin/addons/msf_printed_documents/report/report_reception.rml' |
1324 | --- bin/addons/msf_printed_documents/report/report_reception.rml 2015-05-21 07:13:23 +0000 |
1325 | +++ bin/addons/msf_printed_documents/report/report_reception.rml 2016-03-24 09:31:01 +0000 |
1326 | @@ -541,7 +541,7 @@ |
1327 | <para style="TextInformation4" alignment="CENTER">DG</para> |
1328 | </td> |
1329 | <td> |
1330 | - <para style="TextInformation4" alignment="CENTER">NP</para> |
1331 | + <para style="TextInformation4" alignment="CENTER">CS</para> |
1332 | </td> |
1333 | </tr> |
1334 | </blockTable> |
1335 | |
1336 | === modified file 'bin/addons/msf_profile/data/patches.xml' |
1337 | --- bin/addons/msf_profile/data/patches.xml 2016-03-11 15:55:20 +0000 |
1338 | +++ bin/addons/msf_profile/data/patches.xml 2016-03-24 09:31:01 +0000 |
1339 | @@ -5,8 +5,59 @@ |
1340 | <field name="method">update_us_963_negative_rule_seq</field> |
1341 | </record> |
1342 | |
1343 | +<<<<<<< TREE |
1344 | <record id="another_translation_fix" model="patch.scripts"> |
1345 | <field name="method">another_translation_fix</field> |
1346 | +======= |
1347 | + <record id="us_133_patch" model="patch.scripts"> |
1348 | + <field name="method">update_us_133</field> |
1349 | + </record> |
1350 | + <record id="us_489_patch" model="patch.scripts"> |
1351 | + <field name="method">update_parent_budget_us_489</field> |
1352 | + </record> |
1353 | + <record id="us_435_patch_2" model="patch.scripts"> |
1354 | + <field name="method">update_us_435_2</field> |
1355 | + </record> |
1356 | + |
1357 | + <record id="us_394_2_patch" model="patch.scripts"> |
1358 | + <field name="method">us_394_2_patch</field> |
1359 | + </record> |
1360 | + |
1361 | + <record id="us_394_3_patch" model="patch.scripts"> |
1362 | + <field name="method">us_394_3_patch</field> |
1363 | + </record> |
1364 | + |
1365 | + <record id="us_651_patch" model="patch.scripts"> |
1366 | + <field name="method">disable_crondoall</field> |
1367 | + </record> |
1368 | + |
1369 | + <record id="us_332_patch" model="patch.scripts"> |
1370 | + <field name="method">us_332_patch</field> |
1371 | + </record> |
1372 | + |
1373 | + <record id="us_898_patch" model="patch.scripts"> |
1374 | + <field name="method">us_898_patch</field> |
1375 | + </record> |
1376 | + |
1377 | + <record id="us_822_patch" model="patch.scripts"> |
1378 | + <field name="method">us_822_patch</field> |
1379 | + </record> |
1380 | + |
1381 | + <record id="us_908_patch" model="patch.scripts"> |
1382 | + <field name="method">us_908_patch</field> |
1383 | + </record> |
1384 | + |
1385 | + <record id="us_750_patch" model="patch.scripts"> |
1386 | + <field name="method">us_750_patch</field> |
1387 | + </record> |
1388 | + |
1389 | + <record id="bar_action_patch" model="patch.scripts"> |
1390 | + <field name="method">bar_action_patch</field> |
1391 | +>>>>>>> MERGE-SOURCE |
1392 | + </record> |
1393 | + |
1394 | + <record id="update_volume_patch" model="patch.scripts"> |
1395 | + <field name="method">update_volume_patch</field> |
1396 | </record> |
1397 | |
1398 | </data> |
1399 | |
1400 | === modified file 'bin/addons/msf_profile/msf_profile.py' |
1401 | --- bin/addons/msf_profile/msf_profile.py 2016-03-11 15:55:20 +0000 |
1402 | +++ bin/addons/msf_profile/msf_profile.py 2016-03-24 09:31:01 +0000 |
1403 | @@ -305,6 +305,69 @@ |
1404 | for view in view_to_gen: |
1405 | view_obj.generate_button_access_rules(cr, uid, view) |
1406 | |
1407 | + def update_volume_patch(self, cr, uid, *a, **b): |
1408 | + """ |
1409 | + Update the volume from dm³ to m³ for OCB databases |
1410 | + :param cr: Cursor to the database |
1411 | + :param uid: ID of the res.users that calls the method |
1412 | + :param a: Unnamed parameters |
1413 | + :param b: Named parameters |
1414 | + :return: True |
1415 | + """ |
1416 | + instance = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id |
1417 | + if instance: |
1418 | + while instance.level != 'section': |
1419 | + if not instance.parent_id: |
1420 | + break |
1421 | + instance = instance.parent_id |
1422 | + |
1423 | + if instance and instance.name != 'OCBHQ': |
1424 | + cr.execute(""" |
1425 | + UPDATE product_template |
1426 | + SET volume_updated = True |
1427 | + WHERE volume_updated = False |
1428 | + """) |
1429 | + else: |
1430 | + cr.execute(""" |
1431 | + UPDATE product_template |
1432 | + SET volume = volume*1000, |
1433 | + volume_updated = True |
1434 | + WHERE volume_updated = False |
1435 | + """) |
1436 | + |
1437 | + def us_750_patch(self, cr, uid, *a, **b): |
1438 | + """ |
1439 | + Update the heat_sensitive_item field of product.product |
1440 | + to 'Yes' if there is a value already defined by de-activated. |
1441 | + :param cr: Cursor to the database |
1442 | + :param uid: ID of the res.users that calls this method |
1443 | + :param a: Non-named parameters |
1444 | + :param b: Named parameters |
1445 | + :return: True |
1446 | + """ |
1447 | + prd_obj = self.pool.get('product.product') |
1448 | + phs_obj = self.pool.get('product.heat_sensitive') |
1449 | + data_obj = self.pool.get('ir.model.data') |
1450 | + |
1451 | + heat_id = data_obj.get_object_reference(cr, uid, 'product_attributes', 'heat_yes')[1] |
1452 | + no_heat_id = data_obj.get_object_reference(cr, uid, 'product_attributes', 'heat_no')[1] |
1453 | + |
1454 | + phs_ids = phs_obj.search(cr, uid, [('active', '=', False)]) |
1455 | + prd_ids = prd_obj.search(cr, uid, [('heat_sensitive_item', '!=', False), ('active', 'in', ['t', 'f'])]) |
1456 | + if prd_ids: |
1457 | + cr.execute(""" |
1458 | + UPDATE product_product SET heat_sensitive_item = %s, is_kc = True, kc_txt = 'X', show_cold_chain = True WHERE id IN %s |
1459 | + """, (heat_id, tuple(prd_ids),)) |
1460 | + |
1461 | + no_prd_ids = prd_obj.search(cr, uid, [('heat_sensitive_item', '=', False), ('active', 'in', ['t', 'f'])]) |
1462 | + if no_prd_ids: |
1463 | + cr.execute(""" |
1464 | + UPDATE product_product SET heat_sensitive_item = %s, is_kc = False, kc_txt = '', show_cold_chain = False WHERE id IN %s |
1465 | + """, (no_heat_id, tuple(no_prd_ids),)) |
1466 | + |
1467 | + cr.execute('ALTER TABLE product_product ALTER COLUMN heat_sensitive_item SET NOT NULL') |
1468 | + |
1469 | + return True |
1470 | |
1471 | def update_us_963_negative_rule_seq(self, cr, uid, *a, **b): |
1472 | if self.pool.get('sync.client.update_received'): |
1473 | |
1474 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv' |
1475 | --- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-03-16 14:11:26 +0000 |
1476 | +++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-03-24 09:31:01 +0000 |
1477 | @@ -107,8 +107,8 @@ |
1478 | msf_sync_data_server.price_list_version,FALSE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,[],"['active', 'date_end', 'date_start', 'name', 'pricelist_id/id']",MISSION,product.pricelist.version,,Price List Version,Valid,,561 |
1479 | msf_sync_data_server.country_restrictions,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],['name'],MISSION,res.country.restriction,,Country restrictions,Valid,,570 |
1480 | msf_sync_data_server.country_code_mapping,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,[],"['instance_id/id', 'mapping_value']",COORDINATIONS,country.export.mapping,,Country Code Mapping,Valid,,571 |
1481 | -msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|',('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ')]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'code', 'cold_chain', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item', 'international_status', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'narcotic', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'soq_weight', 'soq_volume']",OC,product.product,,"OC Product (Creator = ITC, ESC or HQ)",Valid,,600 |
1482 | -msf_sync_data_server.mission_product_creator_local,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('international_status','=','Local')]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'code', 'xmlid_code','cold_chain', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item', 'international_status', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'narcotic', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume','soq_weight','soq_volume']",MISSION,product.product,,Mission Product (Creator = local),Valid,,601 |
1483 | +msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|','|',('international_status','=','UniData'),('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'cold_chain/id', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_weight', 'soq_volume']",OC,product.product,,"OC Product (Creator = ITC, ESC or HQ)",Valid,,600 |
1484 | +msf_sync_data_server.mission_product_creator_local,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('international_status','=','Local'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'xmlid_code','cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_weight','soq_volume']",MISSION,product.product,,Mission Product (Creator = local),Valid,,601 |
1485 | msf_sync_data_server.standard_product_list,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('standard_list_ok','=','True')]","['creation_date', 'creator', 'description', 'last_update_date', 'name', 'order_list_print_ok', 'ref', 'standard_list_ok', 'type']",OC,product.list,,Standard Product List,Valid,,605 |
1486 | msf_sync_data_server.standard_product_list_line,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('list_id' , 'in', ('product.list', 'id', [('standard_list_ok','=','True')]))]","['comment','list_id/id','ref','name']",OC,product.list.line,,Standard Product List Line,Valid,,606 |
1487 | msf_sync_data_server.tax_code,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],"['code', 'info', 'name', 'notprintable', 'sign']",OC,account.tax.code,,Tax Code,Valid,,610 |
1488 | @@ -199,7 +199,7 @@ |
1489 | msf_usb_sync_data_server.cp_all_partners_address,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['active', 'city', 'country_id/id', 'email', 'fax', 'function', 'mobile', 'name', 'partner_id/id', 'phone', 'state_id/id', 'street', 'street2', 'title/id', 'type', 'zip']",USB,res.partner.address,,[MASTER] Partner Address,Valid,,1662 |
1490 | msf_usb_sync_data_server.cp_product_price_list,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['active', 'company_id/id', 'currency_id/id', 'currency_name', 'name', 'type']",USB,product.pricelist,,[MASTER] Product_price_list,Valid,,1670 |
1491 | msf_usb_sync_data_server.cp_country_restrictions,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],['name'],USB,res.country.restriction,,[MASTER] Country restrictions,Valid,,1680 |
1492 | -msf_usb_sync_data_server.cp_all_product,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['alert_time', 'batch_management', 'asset_type_id', 'categ_id/id', 'closed_article', 'code', 'cold_chain', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item', 'international_status', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'narcotic', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'xmlid_code', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume','soq_weight','soq_volume']",USB,product.product,,[MASTER] Products,Valid,,1810 |
1493 | +msf_usb_sync_data_server.cp_all_product,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,[],"['alert_time', 'batch_management', 'asset_type_id', 'categ_id/id', 'closed_article','manufacturer_txt', 'manufacturer_ref','code', 'cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'xmlid_code', 'active', 'state', 'old_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume','volume_updated','soq_weight','soq_volume']",USB,product.product,,[MASTER] Products,Valid,,1810 |
1494 | msf_usb_sync_data_server.cp_standard_product_list,TRUE,TRUE,TRUE,TRUE,cp_to_rw,Bidirectional,"[('standard_list_ok','=','True')]","['creation_date', 'creator', 'description', 'last_update_date', 'name', 'order_list_print_ok', 'ref', 'standard_list_ok', 'type']",USB,product.list,,[MASTER] Standard Product List,Valid,,1820 |
1495 | msf_usb_sync_data_server.cp_standard_product_list_line,TRUE,TRUE,TRUE,TRUE,cp_to_rw,Bidirectional,"[('list_id' , 'in', ('product.list', 'id', [('standard_list_ok','=','True')]))]","['comment','list_id/id','ref','name/id']",USB,product.list.line,,[MASTER] Standard Product List Line,Valid,,1821 |
1496 | msf_usb_sync_data_server.cp_composition_kit,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Bidirectional,"[('state','=','completed'),('composition_type','=','theoretical')]","['active', 'composition_creation_date', 'composition_description', 'composition_product_id/id', 'composition_type', 'composition_version', 'composition_version_txt', 'name', 'state']",USB,composition.kit,,[MASTER] Theoretical Kit Composition List,Valid,,1830 |
1497 | |
1498 | === modified file 'bin/addons/product_attributes/data/product_justification_code.xml' |
1499 | --- bin/addons/product_attributes/data/product_justification_code.xml 2012-10-30 12:00:35 +0000 |
1500 | +++ bin/addons/product_attributes/data/product_justification_code.xml 2016-03-24 09:31:01 +0000 |
1501 | @@ -1,59 +1,87 @@ |
1502 | <?xml version="1.0" encoding="utf-8"?> |
1503 | <openerp> |
1504 | - <data noupdate="1"> |
1505 | - |
1506 | + <data noupdate="0"> |
1507 | + |
1508 | <record id="justification_code_ja" model="product.justification.code"> |
1509 | - <field name="code">18 J(A)</field> |
1510 | + <field name="code">A</field> |
1511 | <field name="description">This kind of article need a more detailed description of the context in which it will be used.</field> |
1512 | </record> |
1513 | + <record id="justification_code_jc" model="product.justification.code"> |
1514 | + <field name="code">C</field> |
1515 | + <field name="description">The article is potentially subject to important modifications (supply sources, better alternatives).</field> |
1516 | + </record> |
1517 | <record id="justification_code_je" model="product.justification.code"> |
1518 | - <field name="code">21 J(E)</field> |
1519 | + <field name="code">E</field> |
1520 | <field name="description">The article is expensive and its choice should be justified in relation to cheaper alternatives.</field> |
1521 | </record> |
1522 | <record id="justification_code_jf" model="product.justification.code"> |
1523 | - <field name="code">22 J(F)</field> |
1524 | + <field name="code">F</field> |
1525 | <field name="description">Monitor the use, efficacy for at least one year after the introduction of new drugs.</field> |
1526 | </record> |
1527 | <record id="justification_code_jm" model="product.justification.code"> |
1528 | - <field name="code">23 J(M)</field> |
1529 | + <field name="code">M</field> |
1530 | <field name="description">The article may imply medical risks if misused by persons with insufficient training or knowledge.</field> |
1531 | </record> |
1532 | <record id="justification_code_jme" model="product.justification.code"> |
1533 | - <field name="code">24 J(ME)</field> |
1534 | + <field name="code">ME</field> |
1535 | <field name="description">The article may imply medical risks if misused by persons with insufficient training, Expensive.</field> |
1536 | </record> |
1537 | <record id="justification_code_jmf" model="product.justification.code"> |
1538 | - <field name="code">25 J(MF)</field> |
1539 | + <field name="code">MF</field> |
1540 | <field name="description">The article may imply medical risks if misused + Monitor the use, efficacy at least one year.</field> |
1541 | </record> |
1542 | <record id="justification_code_jo" model="product.justification.code"> |
1543 | - <field name="code">27 J(O)</field> |
1544 | + <field name="code">O</field> |
1545 | <field name="description">The article and its specifications are obsolete or are no longer the international standard.</field> |
1546 | </record> |
1547 | + <record id="justification_code_jom" model="product.justification.code"> |
1548 | + <field name="code">OM</field> |
1549 | + <field name="description">The article and its specifications are obsolete , it may imply a medical risk if misused.</field> |
1550 | + </record> |
1551 | + <record id="justification_code_jop" model="product.justification.code"> |
1552 | + <field name="code">OP</field> |
1553 | + <field name="description">The article and its specifications are obsolete , it has to be used only in a specific program.</field> |
1554 | + </record> |
1555 | <record id="justification_code_jp" model="product.justification.code"> |
1556 | - <field name="code">30 J(P)</field> |
1557 | + <field name="code">P</field> |
1558 | <field name="description">The article must be used only in a properly designed programme.</field> |
1559 | </record> |
1560 | <record id="justification_code_jpa" model="product.justification.code"> |
1561 | - <field name="code">31 J(PA)</field> |
1562 | + <field name="code">PA</field> |
1563 | <field name="description">Article must be used only in a properly designed programme, need a more detailed description.</field> |
1564 | </record> |
1565 | + <record id="justification_code_jpcme" model="product.justification.code"> |
1566 | + <field name="code">PCME</field> |
1567 | + <field name="description">Article only for a properly designed Programme, it may imply a Medical risk if misused, Expensive.</field> |
1568 | + </record> |
1569 | <record id="justification_code_jpe" model="product.justification.code"> |
1570 | - <field name="code">35 J(PE)</field> |
1571 | + <field name="code">PE</field> |
1572 | <field name="description">Article must be used only in a properly designed programme, Expensive, cheaper alternatives exist.</field> |
1573 | </record> |
1574 | <record id="justification_code_jpf" model="product.justification.code"> |
1575 | - <field name="code">36 J(PF)</field> |
1576 | + <field name="code">PF</field> |
1577 | <field name="description">The article must be used only in a properly designed programme + monitor the use, efficacy.</field> |
1578 | </record> |
1579 | <record id="justification_code_jpm" model="product.justification.code"> |
1580 | - <field name="code">37 J(PM)</field> |
1581 | + <field name="code">PM</field> |
1582 | <field name="description">Article must be used only in a properly designed programme, it may imply a medical risk if misused.</field> |
1583 | </record> |
1584 | <record id="justification_code_jpme" model="product.justification.code"> |
1585 | - <field name="code">38 J(PME)</field> |
1586 | + <field name="code">PME</field> |
1587 | <field name="description">Article only for a properly designed Programme, it may imply a Medical risk if misused, Expensive.</field> |
1588 | </record> |
1589 | + <record id="justification_code_js" model="product.justification.code"> |
1590 | + <field name="code">S</field> |
1591 | + <field name="description">Second choice. Article must only be used if the first choice is not available or cannot be used in a specific context.</field> |
1592 | + </record> |
1593 | + <record id="justification_code_jsm" model="product.justification.code"> |
1594 | + <field name="code">SM</field> |
1595 | + <field name="description">Second choice & medical risk. Article must be only used if the first choice is not available or cannot be used in a specific context. The article may imply medical risks if misused by persons with insufficient training or knowledge.</field> |
1596 | + </record> |
1597 | + <record id="justification_code_jsp" model="product.justification.code"> |
1598 | + <field name="code">SP</field> |
1599 | + <field name="description">Second Choice & specific programme. The article must only be used if the first choice. is not available or cannot be used in a specific context. The article must be used only in a properly designed programme.</field> |
1600 | + </record> |
1601 | |
1602 | </data> |
1603 | -</openerp> |
1604 | \ No newline at end of file |
1605 | +</openerp> |
1606 | |
1607 | === modified file 'bin/addons/product_attributes/product_attributes.py' |
1608 | --- bin/addons/product_attributes/product_attributes.py 2016-01-25 10:53:51 +0000 |
1609 | +++ bin/addons/product_attributes/product_attributes.py 2016-03-24 09:31:01 +0000 |
1610 | @@ -103,9 +103,24 @@ |
1611 | |
1612 | class product_heat_sensitive(osv.osv): |
1613 | _name = "product.heat_sensitive" |
1614 | + _order = 'code desc' |
1615 | _columns = { |
1616 | - 'code': fields.char('Code', size=256), |
1617 | - 'name': fields.char('Name', size=256, required=True), |
1618 | + 'code': fields.char( |
1619 | + string='Code', |
1620 | + size=256, |
1621 | + ), |
1622 | + 'name': fields.char( |
1623 | + string='Name', |
1624 | + size=256, |
1625 | + required=True, |
1626 | + ), |
1627 | + 'active': fields.boolean( |
1628 | + string='Active', |
1629 | + ) |
1630 | + } |
1631 | + |
1632 | + _defaults = { |
1633 | + 'active': True, |
1634 | } |
1635 | |
1636 | def unlink(self, cr, uid, ids, context=None): |
1637 | @@ -113,13 +128,45 @@ |
1638 | context = {} |
1639 | if isinstance(ids, (int, long)): |
1640 | ids = [ids] |
1641 | - ids_p = self.pool.get('product.product').search(cr, uid, |
1642 | - [('heat_sensitive_item','in',ids)], |
1643 | - limit=1, order='NO_ORDER') |
1644 | + ids_p = self.pool.get('product.product').search(cr, uid, [ |
1645 | + ('heat_sensitive_item', 'in', ids), |
1646 | + ], limit=1, order='NO_ORDER') |
1647 | if ids_p: |
1648 | - raise osv.except_osv(_('Error'), _('You cannot delete this heat sensitive because it\'s used at least in one product')) |
1649 | + raise osv.except_osv( |
1650 | + _('Error'), |
1651 | + _('You cannot delete this heat sensitive because it\'s used at least in one product'), |
1652 | + ) |
1653 | return super(product_heat_sensitive, self).unlink(cr, uid, ids, context=context) |
1654 | |
1655 | + def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=100): |
1656 | + """ |
1657 | + In context of sync. update execution, look for active and inactive heat sensitive items |
1658 | + :param cr: Cursor to the database |
1659 | + :param uid: ID of the res.users that calls this method |
1660 | + :param name: Object name to search |
1661 | + :param args: List of tubles specifying search criteria [('field_name', 'operator', 'value'), ...] |
1662 | + :param operatior: Operator for search criterion |
1663 | + :param context: Context of the call |
1664 | + :param limit: Optional max number of records to return |
1665 | + :return: List of objects names matching the search criteria, used to provide completion for to-many relationships |
1666 | + """ |
1667 | + data_obj = self.pool.get('ir.model.data') |
1668 | + |
1669 | + if context is None: |
1670 | + context = {} |
1671 | + |
1672 | + if args is None: |
1673 | + args = [] |
1674 | + |
1675 | + if context.get('sync_update_execution'): |
1676 | + item_id = data_obj.get_object_reference(cr, uid, 'product_attributes', 'heat_yes') |
1677 | + if item_id: |
1678 | + ids = self._search(cr, uid, [('id', '=', item_id[1])], limit=limit, context=context, |
1679 | + access_rights_uid=uid) |
1680 | + return self.name_get(cr, uid, ids, context) |
1681 | + |
1682 | + return super(product_heat_sensitive, self).name_search(cr, uid, name, args, operator, context=context, limit=limit) |
1683 | + |
1684 | product_heat_sensitive() |
1685 | |
1686 | class product_cold_chain(osv.osv): |
1687 | @@ -141,6 +188,51 @@ |
1688 | raise osv.except_osv(_('Error'), _('You cannot delete this cold chain because it\'s used at least in one product')) |
1689 | return super(product_cold_chain, self).unlink(cr, uid, ids, context=context) |
1690 | |
1691 | + def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=100): |
1692 | + """ |
1693 | + In context of sync. update execution, look for active and inactive heat sensitive items |
1694 | + :param cr: Cursor to the database |
1695 | + :param uid: ID of the res.users that calls this method |
1696 | + :param name: Object name to search |
1697 | + :param args: List of tubles specifying search criteria [('field_name', 'operator', 'value'), ...] |
1698 | + :param operatior: Operator for search criterion |
1699 | + :param context: Context of the call |
1700 | + :param limit: Optional max number of records to return |
1701 | + :return: List of objects names matching the search criteria, used to provide completion for to-many relationships |
1702 | + """ |
1703 | + data_obj = self.pool.get('ir.model.data') |
1704 | + if context is None: |
1705 | + context = {} |
1706 | + |
1707 | + if args is None: |
1708 | + args = [] |
1709 | + |
1710 | + if context.get('sync_update_execution'): |
1711 | + match_dict = { |
1712 | + tools.ustr('3* Cold Chain * - Keep Cool: used for a kit containing cold chain module or item(s)'): 'cold_1', |
1713 | + tools.ustr('6*0 Cold Chain *0 - Problem if any window blue'): 'cold_2', |
1714 | + tools.ustr('7*0F Cold Chain *0F - Problem if any window blue or Freeze-tag = ALARM'): 'cold_3', |
1715 | + tools.ustr('8*A Cold Chain *A - Problem if B, C and/or D totally blue'): 'cold_4', |
1716 | + tools.ustr('9*AF Cold Chain *AF - Problem if B, C and/or D totally blue or Freeze-tag = ALARM'): 'cold_5', |
1717 | + tools.ustr('10*B Cold Chain *B - Problem if C and/or D totally blue'): 'cold_6', |
1718 | + tools.ustr('11*BF Cold Chain *BF - Problem if C and/or D totally blue or Freeze-tag = ALARM'): 'cold_7', |
1719 | + tools.ustr('12*C Cold Chain *C - Problem if D totally blue'): 'cold_8', |
1720 | + tools.ustr('13*CF Cold Chain *CF - Problem if D totally blue or Freeze-tag = ALARM'): 'cold_9', |
1721 | + tools.ustr('14*D Cold Chain *D - Store and transport at -25°C (store in deepfreezer, transport with dry-ice)'): 'cold_10', |
1722 | + tools.ustr('15*F Cold Chain *F - Cannot be frozen: check Freeze-tag'): 'cold_11', |
1723 | + tools.ustr('16*25 Cold Chain *25 - Must be kept below 25°C (but not necesseraly in cold chain)'): 'cold_12', |
1724 | + tools.ustr('17*25F Cold Chain *25F - Must be kept below 25°C and cannot be frozen: check Freeze-tag'): 'cold_13', |
1725 | + } |
1726 | + |
1727 | + if name in match_dict.keys(): |
1728 | + item_id = data_obj.get_object_reference(cr, uid, 'product_attributes', match_dict[name]) |
1729 | + if item_id: |
1730 | + ids = self._search(cr, uid, [('id', '=', item_id[1])], limit=limit, context=context, |
1731 | + access_rights_uid=uid) |
1732 | + return self.name_get(cr, uid, ids, context) |
1733 | + |
1734 | + return super(product_cold_chain, self).name_search(cr, uid, name, args, operator, context=context, limit=limit) |
1735 | + |
1736 | product_cold_chain() |
1737 | |
1738 | class product_supply_source(osv.osv): |
1739 | @@ -154,6 +246,7 @@ |
1740 | |
1741 | class product_justification_code(osv.osv): |
1742 | _name = "product.justification.code" |
1743 | + _order = 'code' |
1744 | _rec_name = 'code' |
1745 | _columns = { |
1746 | 'code': fields.char('Justification Code', size=32, required=True, translate=True), |
1747 | @@ -206,6 +299,7 @@ |
1748 | |
1749 | product_template() |
1750 | |
1751 | + |
1752 | class product_attributes(osv.osv): |
1753 | _inherit = "product.product" |
1754 | |
1755 | @@ -219,6 +313,45 @@ |
1756 | file = tools.file_open(pathname) |
1757 | tools.convert_xml_import(cr, 'product_attributes', file, {}, mode=mode, noupdate=True) |
1758 | |
1759 | + def execute_migration(self, cr, moved_column, new_column): |
1760 | + super(product_attributes, self).execute_migration(cr, moved_column, new_column) |
1761 | + |
1762 | + # Get the list of ID of product.product that will be updated to make a touch() on it to trigger a new sync. update |
1763 | + ids_req = 'SELECT id FROM product_product WHERE %s = True' % moved_column |
1764 | + if new_column == 'controlled_substance': |
1765 | + ids_req = '%s OR narcotic = True' % ids_req |
1766 | + |
1767 | + cr.execute('''UPDATE ir_model_data SET |
1768 | + last_modification = now(), |
1769 | + touched='[''%s'']' |
1770 | + WHERE model = 'product.product' |
1771 | + AND res_id IN (%s) |
1772 | + ''' % (new_column, ids_req)) |
1773 | + |
1774 | + # Make the migration |
1775 | + if new_column == 'standard_ok': |
1776 | + request = 'UPDATE product_product SET standard_ok = \'True\' WHERE %s = True' % moved_column |
1777 | + cr.execute(request) |
1778 | + |
1779 | + if new_column == 'dangerous_goods': |
1780 | + request = 'UPDATE product_product SET is_dg = True, dg_txt = \'X\', dangerous_goods = \'True\' WHERE %s = True' % moved_column |
1781 | + cr.execute(request) |
1782 | + |
1783 | + if new_column == 'short_shelf_life': |
1784 | + request = 'UPDATE product_product SET is_ssl = True, ssl_txt = \'X\', short_shelf_life = \'True\' WHERE %s = True' % moved_column |
1785 | + cr.execute(request) |
1786 | + |
1787 | + if new_column == 'controlled_substance': |
1788 | + # Update old ticked controlled substance but not narcotic |
1789 | + request = '''UPDATE product_product SET |
1790 | + controlled_substance = 'True', |
1791 | + is_cs = True, |
1792 | + cs_txt = 'X' |
1793 | + WHERE %s = True OR narcotic = True''' % moved_column |
1794 | + cr.execute(request) |
1795 | + |
1796 | + return |
1797 | + |
1798 | def _get_nomen(self, cr, uid, ids, field_name, args, context=None): |
1799 | res = {} |
1800 | |
1801 | @@ -352,19 +485,186 @@ |
1802 | |
1803 | return [] |
1804 | |
1805 | + def _compute_is_kc(self, cr, uid, product, context=None): |
1806 | + """ |
1807 | + Return True if the product is considered as a Keep Cool product |
1808 | + :param cr: Cursor to the database |
1809 | + :param uid: ID of the res.users that calls this method |
1810 | + :param product: browse_record of a product.product |
1811 | + :param context: Context of the call |
1812 | + :return: True or False |
1813 | + """ |
1814 | + return product.heat_sensitive_item.code == 'yes' |
1815 | + |
1816 | + def _compute_kc_txt(self, cr, uid, product, context=None): |
1817 | + """ |
1818 | + Return the character to display on views or reports ('X' or '?' or '') for Keep Cool |
1819 | + :param cr: Cursor to the database |
1820 | + :param uid: ID of the res.users that calls this method |
1821 | + :param product: browse_record of a product.product |
1822 | + :param context: Context of the call |
1823 | + :return: 'X' or '?' or '' |
1824 | + """ |
1825 | + if product.heat_sensitive_item.code == 'no_know': |
1826 | + return '?' |
1827 | + elif product.heat_sensitive_item.code == 'no': |
1828 | + return '' |
1829 | + else: |
1830 | + return 'X' |
1831 | + |
1832 | + def _compute_is_dg(self, cr, uid, product, context=None): |
1833 | + """ |
1834 | + Return True if the product is considered as a Dangerous Goods product |
1835 | + :param cr: Cursor to the database |
1836 | + :param uid: ID of the res.users that calls this method |
1837 | + :param product: browse_record of a product.product |
1838 | + :param context: Context of the call |
1839 | + :return: True or False |
1840 | + """ |
1841 | + return product.dangerous_goods == 'True' |
1842 | + |
1843 | + def _compute_dg_txt(self, cr, uid, product, context=None): |
1844 | + """ |
1845 | + Return the character to display on views or reports ('X' or '?' or '') for Dangerous Goods |
1846 | + :param cr: Cursor to the database |
1847 | + :param uid: ID of the res.users that calls this method |
1848 | + :param product: browse_record of a product.product |
1849 | + :param context: Context of the call |
1850 | + :return: 'X' or '?' or '' |
1851 | + """ |
1852 | + if product.dangerous_goods == 'True': |
1853 | + return 'X' |
1854 | + elif product.dangerous_goods == 'no_know': |
1855 | + return '?' |
1856 | + |
1857 | + return '' |
1858 | + |
1859 | + def _compute_is_cs(self, cr, uid, product, context=None): |
1860 | + """ |
1861 | + Return True if the product is considered as a Controlled Substance product |
1862 | + :param cr: Cursor to the database |
1863 | + :param uid: ID of the res.users that calls this method |
1864 | + :param product: browse_record of a product.product |
1865 | + :param context: Context of the call |
1866 | + :return: True or False |
1867 | + """ |
1868 | + return product.controlled_substance |
1869 | + |
1870 | + def _compute_cs_txt(self, cr, uid, product, context=None): |
1871 | + """ |
1872 | + Return the character to display on views or reports ('X' or '?' or '') for Controlled Substance |
1873 | + :param cr: Cursor to the database |
1874 | + :param uid: ID of the res.users that calls this method |
1875 | + :param product: browse_record of a product.product |
1876 | + :param context: Context of the call |
1877 | + :return: 'X' or '?' or '' |
1878 | + """ |
1879 | + return product.controlled_substance and 'X' or '' |
1880 | + |
1881 | + def _compute_is_ssl(self, cr, uid, product, context=None): |
1882 | + """ |
1883 | + Return True if the product is considered as a Short Shelf Life product |
1884 | + :param cr: Cursor to the database |
1885 | + :param uid: ID of the res.users that calls this method |
1886 | + :param product: browse_record of a product.product |
1887 | + :param context: Context of the call |
1888 | + :return: True or False |
1889 | + """ |
1890 | + return product.short_shelf_life == 'True' |
1891 | + |
1892 | + def _compute_ssl_txt(self, cr, uid, product, context=None): |
1893 | + """ |
1894 | + Return the character to display on views or reports ('X' or '?' or '') for Short Shelf Life |
1895 | + :param cr: Cursor to the database |
1896 | + :param uid: ID of the res.users that calls this method |
1897 | + :param product: browse_record of a product.product |
1898 | + :param context: Context of the call |
1899 | + :return: 'X' or '?' or '' |
1900 | + """ |
1901 | + if product.short_shelf_life == 'True': |
1902 | + return 'X' |
1903 | + elif product.short_shelf_life == 'no_know': |
1904 | + return '?' |
1905 | + |
1906 | + return '' |
1907 | + |
1908 | + def _compute_kc_dg_cs_ssl_values(self, cr, uid, ids, field_names, args, context=None): |
1909 | + """ |
1910 | + Compute the character to display ('X' or '?' or '') according to product values |
1911 | + for Keep Cool, Dangerous Goods, Controlled Substance and Short Shelf Life. |
1912 | + :param cr: Cursor to the database |
1913 | + :param uid: ID of the res.users that calls this method |
1914 | + :param ids: List of ID of product.product to compute values |
1915 | + :param field_names: Name of the fields to compute |
1916 | + :param args: Additionnal arguments |
1917 | + :param context: Conetxt of the call |
1918 | + :return: A dictionary with the ID of product.product as keys and |
1919 | + a dictionary with computed field values for each ID in ids. |
1920 | + """ |
1921 | + if context is None: |
1922 | + context = {} |
1923 | + |
1924 | + if isinstance(ids, (int, long)): |
1925 | + ids = [ids] |
1926 | + |
1927 | + if not isinstance(field_names, list): |
1928 | + field_names = [field_names] |
1929 | + |
1930 | + res = {} |
1931 | + for product in self.browse(cr, uid, ids, context=context): |
1932 | + res[product.id] = {} |
1933 | + for fld in field_names: |
1934 | + method_name = '_compute_%s' % fld |
1935 | + res[product.id][fld] = getattr(self, method_name)(cr, uid, product, context=context) |
1936 | + |
1937 | + return res |
1938 | + |
1939 | _columns = { |
1940 | 'duplicate_ok': fields.boolean('Is a duplicate'), |
1941 | 'loc_indic': fields.char('Indicative Location', size=64), |
1942 | 'description2': fields.text('Description 2'), |
1943 | - 'old_code' : fields.char('Old code', size=64), |
1944 | + 'old_code' : fields.char( |
1945 | + string='Old code', |
1946 | + size=1024, |
1947 | + ), |
1948 | 'new_code' : fields.char('New code', size=64), |
1949 | - |
1950 | 'international_status': fields.many2one('product.international.status', 'Product Creator', required=False), |
1951 | 'perishable': fields.boolean('Expiry Date Mandatory'), |
1952 | 'batch_management': fields.boolean('Batch Number Mandatory'), |
1953 | 'product_catalog_page' : fields.char('Product Catalog Page', size=64), |
1954 | - 'product_catalog_path' : fields.char('Product Catalog Path', size=64), |
1955 | - 'short_shelf_life': fields.boolean('Short Shelf Life'), |
1956 | + 'product_catalog_path' : fields.char('Product Catalog Path', size=1024), |
1957 | + 'is_ssl': fields.function( |
1958 | + _compute_kc_dg_cs_ssl_values, |
1959 | + method=True, |
1960 | + type='boolean', |
1961 | + string='Is Short Shelf Life ?', |
1962 | + multi='ssl', |
1963 | + readonly=True, |
1964 | + store={ |
1965 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['short_shelf_life'], 10), |
1966 | + } |
1967 | + ), |
1968 | + 'ssl_txt': fields.function( |
1969 | + _compute_kc_dg_cs_ssl_values, |
1970 | + method=True, |
1971 | + type='char', |
1972 | + size=8, |
1973 | + string='Short Shelf Life icon', |
1974 | + multi='ssl', |
1975 | + readonly=True, |
1976 | + store={ |
1977 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['short_shelf_life'], 10), |
1978 | + } |
1979 | + ), |
1980 | + 'short_shelf_life': fields.selection( |
1981 | + selection=[ |
1982 | + ('False', 'No'), |
1983 | + ('True', 'Yes'), |
1984 | + ('no_know', 'tbd'), |
1985 | + ], |
1986 | + string='Short Shelf Life', |
1987 | + required=True, |
1988 | + ), |
1989 | 'criticism': fields.selection([('',''), |
1990 | ('exceptional','1-Exceptional'), |
1991 | ('specific','2-Specific'), |
1992 | @@ -390,22 +690,122 @@ |
1993 | 'composed_kit': fields.boolean('Kit Composed of Kits/Modules'), |
1994 | 'options_ids': fields.many2many('product.product','product_options_rel','product_id','product_option_id','Options'), |
1995 | |
1996 | - 'heat_sensitive_item': fields.many2one('product.heat_sensitive', 'Temperature sensitive item',), |
1997 | + 'is_kc': fields.function( |
1998 | + _compute_kc_dg_cs_ssl_values, |
1999 | + method=True, |
2000 | + type='boolean', |
2001 | + string='Is Keep Cool ?', |
2002 | + multi='kc', |
2003 | + readonly=True, |
2004 | + store={ |
2005 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['heat_sensitive_item'], 10), |
2006 | + } |
2007 | + ), |
2008 | + 'kc_txt': fields.function( |
2009 | + _compute_kc_dg_cs_ssl_values, |
2010 | + method=True, |
2011 | + type='char', |
2012 | + size=8, |
2013 | + string='Keep Cool icon', |
2014 | + multi='kc', |
2015 | + readonly=True, |
2016 | + store={ |
2017 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['heat_sensitive_item'], 10), |
2018 | + } |
2019 | + ), |
2020 | + 'heat_sensitive_item': fields.many2one( |
2021 | + 'product.heat_sensitive', |
2022 | + string='Temperature sensitive item', |
2023 | + required=True, |
2024 | + ), |
2025 | 'cold_chain': fields.many2one('product.cold_chain', 'Cold Chain',), |
2026 | 'show_cold_chain': fields.boolean('Show cold chain'), |
2027 | # Inverse of m2m options_ids |
2028 | 'options_ids_inv': fields.many2many('product.product', 'product_options_rel', 'product_option_id', 'product_id', 'Options Inv.'), |
2029 | - 'sterilized': fields.selection([('yes', 'Yes'), ('no', 'No')], string='Sterile'), |
2030 | - 'single_use': fields.selection([('yes', 'Yes'),('no', 'No')], string='Single Use'), |
2031 | + 'sterilized': fields.selection( |
2032 | + selection=[ |
2033 | + ('yes', 'Yes'), |
2034 | + ('no', 'No'), |
2035 | + ('no_know', 'tbd'), |
2036 | + ], |
2037 | + string='Sterile', |
2038 | + required=True, |
2039 | + ), |
2040 | + 'single_use': fields.selection( |
2041 | + selection=[ |
2042 | + ('yes', 'Yes'), |
2043 | + ('no', 'No'), |
2044 | + ('no_know', 'tbd'), |
2045 | + ], |
2046 | + string='Single Use', |
2047 | + required=True, |
2048 | + ), |
2049 | 'justification_code_id': fields.many2one('product.justification.code', 'Justification Code'), |
2050 | 'med_device_class': fields.selection([('',''), |
2051 | ('I','Class I (General controls)'), |
2052 | ('II','Class II (General control with special controls)'), |
2053 | ('III','Class III (General controls and premarket)')], 'Medical Device Class'), |
2054 | - 'closed_article': fields.selection([('yes', 'Yes'), ('no', 'No'),],string='Closed Article'), |
2055 | - 'dangerous_goods': fields.boolean('Dangerous Goods'), |
2056 | + 'manufacturer_txt': fields.text( |
2057 | + string='Manufacturer', |
2058 | + ), |
2059 | + 'manufacturer_ref': fields.char( |
2060 | + size=1024, |
2061 | + string='Manufacturer Ref.' |
2062 | + ), |
2063 | + 'closed_article': fields.selection( |
2064 | + selection=[ |
2065 | + ('yes', 'Yes'), |
2066 | + ('no', 'No'), |
2067 | + ('recommanded', 'Recommended'), |
2068 | + ], |
2069 | + string='Closed Article', |
2070 | + required=True, |
2071 | + ), |
2072 | + 'is_dg': fields.function( |
2073 | + _compute_kc_dg_cs_ssl_values, |
2074 | + method=True, |
2075 | + type='boolean', |
2076 | + string='Is a Dangerous Goods ?', |
2077 | + multi='dg', |
2078 | + readonly=True, |
2079 | + store={ |
2080 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['dangerous_goods'], 10), |
2081 | + } |
2082 | + ), |
2083 | + 'dg_txt': fields.function( |
2084 | + _compute_kc_dg_cs_ssl_values, |
2085 | + method=True, |
2086 | + type='char', |
2087 | + size=8, |
2088 | + string='Dangerous Goods icon', |
2089 | + multi='dg', |
2090 | + readonly=True, |
2091 | + store={ |
2092 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['dangerous_goods'], 10), |
2093 | + } |
2094 | + ), |
2095 | + 'dangerous_goods': fields.selection( |
2096 | + selection=[ |
2097 | + ('False', 'No'), # False is put as key for migration (see US-752) |
2098 | + ('True', 'Yes'), # True is put as key for migration (see US-752) |
2099 | + ('no_know', 'tbd'), |
2100 | + ], |
2101 | + string='Dangerous goods', |
2102 | + required=True, |
2103 | + ), |
2104 | 'restricted_country': fields.boolean('Restricted in the Country'), |
2105 | 'country_restriction': fields.many2one('res.country.restriction', 'Country Restriction'), |
2106 | + 'state_ud': fields.selection( |
2107 | + selection=[ |
2108 | + ('valid', 'Valid'), |
2109 | + ('phase_out', 'Phase Out'), |
2110 | + ('stopped', 'Stopped'), |
2111 | + ('archived', 'Archived'), |
2112 | + ], |
2113 | + string='UniData Status', |
2114 | + readonly=True, |
2115 | + help="Automatically filled with UniData information.", |
2116 | + ), |
2117 | # TODO: validation on 'un_code' field |
2118 | 'un_code': fields.char('UN Code', size=7), |
2119 | 'gmdn_code' : fields.char('GMDN Code', size=5), |
2120 | @@ -421,7 +821,42 @@ |
2121 | 'field_currency_id': fields.many2one('res.currency', string='Currency', readonly=True), |
2122 | 'nomen_ids': fields.function(_get_nomen, fnct_search=_search_nomen, |
2123 | type='many2many', relation='product.nomenclature', method=True, string='Nomenclatures'), |
2124 | - 'controlled_substance': fields.boolean(string='Controlled substance'), |
2125 | + 'controlled_substance': fields.selection( |
2126 | + selection=[ |
2127 | + ('!', '! - Requires national export license'), |
2128 | + ('N1', 'N1 - Narcotic 1'), |
2129 | + ('N2', 'N2 - Narcotic 2'), |
2130 | + ('P1', 'P1 - Psychotrop 1'), |
2131 | + ('P3', 'P3 - Psychotrop 3'), |
2132 | + ('P4', 'P4 - Psychotrop 4'), |
2133 | + ('Y', 'Y - Kit or module with controlled substance'), |
2134 | + ('True', 'CS / NP - Controlled Substance / Narcotic / Psychotropic') |
2135 | + ], |
2136 | + string='Controlled substance', |
2137 | + ), |
2138 | + 'is_cs': fields.function( |
2139 | + _compute_kc_dg_cs_ssl_values, |
2140 | + method=True, |
2141 | + type='boolean', |
2142 | + string='Is Controlled subst.', |
2143 | + multi='cs', |
2144 | + readonly=True, |
2145 | + store={ |
2146 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['controlled_substance'], 10), |
2147 | + } |
2148 | + ), |
2149 | + 'cs_txt': fields.function( |
2150 | + _compute_kc_dg_cs_ssl_values, |
2151 | + method=True, |
2152 | + type='char', |
2153 | + size=8, |
2154 | + string='Controlled subst. icon', |
2155 | + multi='cs', |
2156 | + readonly=True, |
2157 | + store={ |
2158 | + 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['controlled_substance'], 10), |
2159 | + } |
2160 | + ), |
2161 | 'uom_category_id': fields.related('uom_id', 'category_id', string='Uom Category', type='many2one', relation='product.uom.categ'), |
2162 | 'no_external': fields.function(_get_restriction, method=True, type='boolean', string='External partners orders', readonly=True, multi='restriction', |
2163 | store={'product.product': (lambda self, cr, uid, ids, c=None: ids, ['international_status', 'state'], 20), |
2164 | @@ -448,10 +883,22 @@ |
2165 | 'form_value': fields.text(string='Form', translate=True), |
2166 | 'fit_value': fields.text(string='Fit', translate=True), |
2167 | 'function_value': fields.text(string='Function', translate=True), |
2168 | - 'standard_ok': fields.boolean(string='Standard'), |
2169 | + 'standard_ok': fields.selection( |
2170 | + selection=[ |
2171 | + ('True', 'Standard'), |
2172 | + ('False', 'Non-standard'), |
2173 | + ], |
2174 | + string='Standardization Level', |
2175 | + required=True, |
2176 | + ), |
2177 | 'soq_weight': fields.float(digits=(16,5), string='SoQ Weight'), |
2178 | 'soq_volume': fields.float(digits=(16,5), string='SoQ Volume'), |
2179 | 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True), |
2180 | + 'prodlot_ids': fields.one2many( |
2181 | + 'stock.production.lot', |
2182 | + 'product_id', |
2183 | + string='Batch Numbers', |
2184 | + ), |
2185 | } |
2186 | |
2187 | # US-43: Remove the default_get that set value on Product Creator field. By removing the required = True value |
2188 | @@ -463,15 +910,37 @@ |
2189 | # res.update({'international_status': id }) |
2190 | # return res |
2191 | |
2192 | + def _get_default_sensitive_item(self, cr, uid, context=None): |
2193 | + """ |
2194 | + Return the ID of the product.heat_sensitive item with 'No' value. |
2195 | + :param cr: Cursor to the datase |
2196 | + :param uid: ID of the res.users that calls the method |
2197 | + :param context: Context of the call |
2198 | + :return: The ID of the product.heat_sensitive item with 'No' value. |
2199 | + """ |
2200 | + return self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product_attributes', 'heat_no')[1] |
2201 | + |
2202 | + def default_get(self, cr, uid, fields, context=None): |
2203 | + res = super(product_attributes, self).default_get(cr, uid, fields, context=context) |
2204 | + |
2205 | + res['heat_sensitive_item'] = self._get_default_sensitive_item(cr, uid, context=context) |
2206 | + |
2207 | + return res |
2208 | + |
2209 | _defaults = { |
2210 | + 'closed_article': 'no', |
2211 | 'duplicate_ok': True, |
2212 | 'perishable': False, |
2213 | 'batch_management': False, |
2214 | - 'short_shelf_life': False, |
2215 | + 'short_shelf_life': 'False', |
2216 | 'narcotic': False, |
2217 | 'composed_kit': False, |
2218 | - 'dangerous_goods': False, |
2219 | + 'dangerous_goods': 'False', |
2220 | + 'controlled_substance': False, |
2221 | 'restricted_country': False, |
2222 | + 'sterilized': 'no', |
2223 | + 'single_use': 'no', |
2224 | + 'standard_ok': 'False', |
2225 | 'currency_id': lambda obj, cr, uid, c: obj.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id, |
2226 | 'field_currency_id': lambda obj, cr, uid, c: obj.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id, |
2227 | 'vat_ok': lambda obj, cr, uid, c: obj.pool.get('unifield.setup.configuration').get_config(cr, uid).vat_ok, |
2228 | @@ -661,12 +1130,25 @@ |
2229 | |
2230 | return result, res |
2231 | |
2232 | - |
2233 | def onchange_heat(self, cr, uid, ids, heat, context=None): |
2234 | - heat_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product_attributes', 'heat_1')[1] |
2235 | - if not heat or heat == heat_id: |
2236 | - return {'value': {'show_cold_chain':False}} |
2237 | - return {'value': {'show_cold_chain':True}} |
2238 | + """ |
2239 | + Set the value for the field 'show_cold_chain' according to |
2240 | + selection Temperature sensitive value. |
2241 | + If the returned value is True, the field Cold Chain will be displayed |
2242 | + :param cr: Cursor to the database |
2243 | + :param uid: ID of the res.users that calls the method |
2244 | + :param ids: List of ID of product.product on which the field is computed |
2245 | + :param heat: ID of the selected product.heat_sensitive |
2246 | + :param context: Context of the call |
2247 | + :return: True of False in the 'show_cold_chain' field |
2248 | + """ |
2249 | + heat2_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product_attributes', 'heat_no')[1] |
2250 | + heat3_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product_attributes', 'heat_no_know')[1] |
2251 | + return { |
2252 | + 'value': { |
2253 | + 'show_cold_chain': heat and heat not in [heat2_id, heat3_id] |
2254 | + } |
2255 | + } |
2256 | |
2257 | def _check_gmdn_code(self, cr, uid, ids, context=None): |
2258 | int_pattern = re.compile(r'^\d*$') |
2259 | @@ -699,6 +1181,20 @@ |
2260 | if category_id not in product_uom_categ: |
2261 | product_uom_categ.append(category_id) |
2262 | |
2263 | + if 'heat_sensitive_item' in vals: |
2264 | + if not vals.get('heat_sensitive_item'): |
2265 | + heat2_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product_attributes', 'heat_no')[1] |
2266 | + vals['heat_sensitive_item'] = heat2_id |
2267 | + vals.update(self.onchange_heat(cr, uid, ids, vals['heat_sensitive_item'], context=context).get('value', {})) |
2268 | + |
2269 | + if 'narcotic' in vals or 'controlled_substance' in vals: |
2270 | + if vals.get('narcotic') == True or tools.ustr(vals.get('controlled_substance', '')) == 'True': |
2271 | + vals['controlled_substance'] = 'True' |
2272 | + |
2273 | + for f in ['sterilized', 'closed_article', 'single_use']: |
2274 | + if f in vals and not vals.get(f): |
2275 | + vals[f] = 'no' |
2276 | + |
2277 | res = super(product_attributes, self).write(cr, uid, ids, vals, context=context) |
2278 | |
2279 | if product_uom_categ: |
2280 | @@ -1074,6 +1570,20 @@ |
2281 | """ |
2282 | sptc_obj = self.pool.get('standard.price.track.changes') |
2283 | |
2284 | + if 'narcotic' in vals or 'controlled_substance' in vals: |
2285 | + if vals.get('narcotic') == True or tools.ustr(vals.get('controlled_substance', '')) == 'True': |
2286 | + vals['controlled_substance'] = 'True' |
2287 | + |
2288 | + if 'heat_sensitive_item' in vals: |
2289 | + if not vals.get('heat_sensitive_item'): |
2290 | + heat2_id = self.pool.get('ir.model.data').get_object_reference(cr, user, 'product_attributes', 'heat_no')[1] |
2291 | + vals['heat_sensitive_item'] = heat2_id |
2292 | + vals.update(self.onchange_heat(cr, user, False, vals['heat_sensitive_item'], context=context).get('value', {})) |
2293 | + |
2294 | + for f in ['sterilized', 'closed_article', 'single_use']: |
2295 | + if f in vals and not vals.get(f): |
2296 | + vals[f] = 'no' |
2297 | + |
2298 | res = super(product_attributes, self).create(cr, user, vals, |
2299 | context=context) |
2300 | |
2301 | @@ -1089,11 +1599,45 @@ |
2302 | _inherit = 'product.template' |
2303 | |
2304 | _columns = { |
2305 | - 'volume': fields.float('Volume', digits=(16,5), help="The volume in m3."), |
2306 | + 'volume': fields.float( |
2307 | + string='Volume', |
2308 | + digits=(16, 5), |
2309 | + help="The volume in dm3.", |
2310 | + ), |
2311 | + 'volume_updated': fields.boolean( |
2312 | + strinrg='Volume updated', |
2313 | + readonly=True, |
2314 | + ), |
2315 | 'weight': fields.float('Gross weight', digits=(16,5), help="The gross weight in Kg."), |
2316 | 'weight_net': fields.float('Net weight', digits=(16,5), help="The net weight in Kg."), |
2317 | } |
2318 | |
2319 | + _defaults = { |
2320 | + 'volume_updated': False, |
2321 | + } |
2322 | + |
2323 | + def write(self, cr, uid, ids, vals, context=None): |
2324 | + """ |
2325 | + Update the volume from dm³ to m³ if the volume was not |
2326 | + yet updated. |
2327 | + :param cr: Cursor to the database |
2328 | + :param uid: ID of the res.users that calls this method |
2329 | + :param ids: List of ID of product.template to update |
2330 | + :param vals: Values to apply on list of ID |
2331 | + :param context: Context of the call |
2332 | + :return: super write() method. |
2333 | + """ |
2334 | + if context is None: |
2335 | + context = {} |
2336 | + |
2337 | + if isinstance(ids, (int, long)): |
2338 | + ids = [ids] |
2339 | + |
2340 | + if 'volume' in vals and not vals.get('volume_updated', False): |
2341 | + del vals['volume'] |
2342 | + |
2343 | + return super(product_template, self).write(cr, uid, ids, vals, context=context) |
2344 | + |
2345 | product_template() |
2346 | |
2347 | |
2348 | @@ -1112,6 +1656,31 @@ |
2349 | 'opened_object': False, |
2350 | } |
2351 | |
2352 | + def return_to_product(self, cr, uid, ids, context=None): |
2353 | + """ |
2354 | + When close the wizard view, reload the product view |
2355 | + :param cr: Cursor to the database |
2356 | + :param uid: ID of the res.users that calls the method |
2357 | + :param ids: List of ID of product.deactivation.wizard |
2358 | + :param context: Context of the call |
2359 | + :return: A dictionary with parameters to reload the view |
2360 | + """ |
2361 | + if context is None: |
2362 | + context = {} |
2363 | + |
2364 | + if isinstance(ids, (int, long)): |
2365 | + ids = [ids] |
2366 | + |
2367 | + return { |
2368 | + 'type': 'ir.actions.act_window', |
2369 | + 'res_model': 'product.product', |
2370 | + 'view_type': 'form', |
2371 | + 'view_mode': 'form,tree', |
2372 | + 'res_id': self.browse(cr, uid, ids[0], context=context).product_id.id, |
2373 | + 'target': 'test', |
2374 | + 'context': context, |
2375 | + } |
2376 | + |
2377 | product_deactivation_error() |
2378 | |
2379 | class product_deactivation_error_line(osv.osv_memory): |
2380 | |
2381 | === modified file 'bin/addons/product_attributes/product_attributes_data.xml' |
2382 | --- bin/addons/product_attributes/product_attributes_data.xml 2015-10-20 09:59:33 +0000 |
2383 | +++ bin/addons/product_attributes/product_attributes_data.xml 2016-03-24 09:31:01 +0000 |
2384 | @@ -1,6 +1,6 @@ |
2385 | <?xml version="1.0" encoding="utf-8"?> |
2386 | <openerp> |
2387 | - <data noupdate="1"> |
2388 | + <data noupdate="0"> |
2389 | |
2390 | <record model="product.status" id="status_1"> |
2391 | <field name="code">valid</field> |
2392 | @@ -77,78 +77,97 @@ |
2393 | <field name="code">temp</field> |
2394 | <field name="name">Temporary</field> |
2395 | </record> |
2396 | + <record model="product.international.status" id="int_6"> |
2397 | + <field name="code">unidata</field> |
2398 | + <field name="name">UniData</field> |
2399 | + </record> |
2400 | + |
2401 | + <record model="product.heat_sensitive" id="heat_yes"> |
2402 | + <field name="code">yes</field> |
2403 | + <field name="name">Yes</field> |
2404 | + </record> |
2405 | + <record model="product.heat_sensitive" id="heat_no"> |
2406 | + <field name="code">no</field> |
2407 | + <field name="name">No</field> |
2408 | + </record> |
2409 | + <record model="product.heat_sensitive" id="heat_no_know"> |
2410 | + <field name="code">no_know</field> |
2411 | + <field name="name">tbd</field> |
2412 | + </record> |
2413 | + <record model="product.heat_sensitive" id="heat_1"> |
2414 | + <field name="code">KR</field> |
2415 | + <field name="name">Keep refrigerated but not cold chain (+2 to +8°C) for transport')</field> |
2416 | + <field name="active" eval="False" /> |
2417 | + </record> |
2418 | + <record model="product.heat_sensitive" id="heat_2"> |
2419 | + <field name="code">*</field> |
2420 | + <field name="name">Keep Cool</field> |
2421 | + <field name="active" eval="False" /> |
2422 | + </record> |
2423 | + <record model="product.heat_sensitive" id="heat_3"> |
2424 | + <field name="code">**</field> |
2425 | + <field name="name">Keep Cool, airfreight</field> |
2426 | + <field name="active" eval="False" /> |
2427 | + </record> |
2428 | + <record model="product.heat_sensitive" id="heat_4"> |
2429 | + <field name="code">***</field> |
2430 | + <field name="name">Cold Chain, 0° to 8°C strict</field> |
2431 | + <field name="active" eval="False" /> |
2432 | + </record> |
2433 | |
2434 | - <record model="product.heat_sensitive" id="heat_1"> |
2435 | - <field name="code">KR</field> |
2436 | - <field name="name">Keep refrigerated but not cold chain (+2 to +8°C) for transport')</field> |
2437 | - </record> |
2438 | - <record model="product.heat_sensitive" id="heat_2"> |
2439 | + <record model="product.cold_chain" id="cold_1"> |
2440 | <field name="code">*</field> |
2441 | - <field name="name">Keep Cool</field> |
2442 | - </record> |
2443 | - <record model="product.heat_sensitive" id="heat_3"> |
2444 | - <field name="code">**</field> |
2445 | - <field name="name">Keep Cool, airfreight</field> |
2446 | - </record> |
2447 | - <record model="product.heat_sensitive" id="heat_4"> |
2448 | - <field name="code">***</field> |
2449 | - <field name="name">Cold chain, 0° to 8°C strict</field> |
2450 | - </record> |
2451 | - |
2452 | - <record model="product.cold_chain" id="cold_1"> |
2453 | - <field name="code">3*</field> |
2454 | - <field name="name">3* Cold Chain * - Keep Cool: used for a kit containing cold chain module or item(s)</field> |
2455 | + <field name="name">* - Keep Cool: used for a kit or article containing cold chain module or item(s)</field> |
2456 | </record> |
2457 | <record model="product.cold_chain" id="cold_2"> |
2458 | - <field name="code">6*0</field> |
2459 | - <field name="name">6*0 Cold Chain *0 - Problem if any window blue</field> |
2460 | + <field name="code">*0</field> |
2461 | + <field name="name">*0 - Problem if any window blue</field> |
2462 | </record> |
2463 | <record model="product.cold_chain" id="cold_3"> |
2464 | - <field name="code">7*0F</field> |
2465 | - <field name="name">7*0F Cold Chain *0F - Problem if any window blue or Freeze-tag = ALARM</field> |
2466 | + <field name="code">*0F</field> |
2467 | + <field name="name">*0F - Problem if any window blue or Freeze-tag = ALARM</field> |
2468 | </record> |
2469 | <record model="product.cold_chain" id="cold_4"> |
2470 | - <field name="code">8*A</field> |
2471 | - <field name="name">8*A Cold Chain *A - Problem if B, C and/or D totally blue</field> |
2472 | + <field name="code">*A</field> |
2473 | + <field name="name">*A - Problem if A, B, C and/or D blue = ALARM</field> |
2474 | </record> |
2475 | <record model="product.cold_chain" id="cold_5"> |
2476 | - <field name="code">9*AF</field> |
2477 | - <field name="name">9*AF Cold Chain *AF - Problem if B, C and/or D totally blue or Freeze-tag = ALARM</field> |
2478 | + <field name="code">*AF</field> |
2479 | + <field name="name">*AF - Problem if A, B, C and/or D blue or Freeze-tag = ALARM</field> |
2480 | </record> |
2481 | <record model="product.cold_chain" id="cold_6"> |
2482 | - <field name="code">10*B</field> |
2483 | - <field name="name">10*B Cold Chain *B - Problem if C and/or D totally blue</field> |
2484 | + <field name="code">*B</field> |
2485 | + <field name="name">*B - Problem if B, C and/or D blue = ALARM</field> |
2486 | </record> |
2487 | <record model="product.cold_chain" id="cold_7"> |
2488 | - <field name="code">11*BF</field> |
2489 | - <field name="name">11*BF Cold Chain *BF - Problem if C and/or D totally blue or Freeze-tag = ALARM</field> |
2490 | + <field name="code">*BF</field> |
2491 | + <field name="name">*BF - Problem if B, C and/or D blue or Freeze-tag = ALARM</field> |
2492 | </record> |
2493 | <record model="product.cold_chain" id="cold_8"> |
2494 | - <field name="code">12*C</field> |
2495 | - <field name="name">12*C Cold Chain *C - Problem if D totally blue</field> |
2496 | + <field name="code">*C</field> |
2497 | + <field name="name">*C - Problem if C and D blue</field> |
2498 | </record> |
2499 | <record model="product.cold_chain" id="cold_9"> |
2500 | - <field name="code">13*CF</field> |
2501 | - <field name="name">13*CF Cold Chain *CF - Problem if D totally blue or Freeze-tag = ALARM</field> |
2502 | + <field name="code">*CF</field> |
2503 | + <field name="name">*CF - Problem if C and/or D blue or Freeze-tag = ALARM</field> |
2504 | </record> |
2505 | <record model="product.cold_chain" id="cold_10"> |
2506 | - <field name="code">14*D</field> |
2507 | - <field name="name">14*D Cold Chain *D - Store and transport at -25°C (store in deepfreezer, transport with dry-ice)</field> |
2508 | + <field name="code">*D</field> |
2509 | + <field name="name">*D - Store and transport at -25°C (store in deepfreezer, transport with dry-ice)</field> |
2510 | </record> |
2511 | <record model="product.cold_chain" id="cold_11"> |
2512 | - <field name="code">15*F</field> |
2513 | - <field name="name">15*F Cold Chain *F - Cannot be frozen: check Freeze-tag</field> |
2514 | + <field name="code">*F</field> |
2515 | + <field name="name">*F - Cannot be frozen: check FreezeWatch</field> |
2516 | </record> |
2517 | <record model="product.cold_chain" id="cold_12"> |
2518 | - <field name="code">16*25</field> |
2519 | - <field name="name">16*25 Cold Chain *25 - Must be kept below 25°C (but not necesseraly in cold chain)</field> |
2520 | + <field name="code">*25</field> |
2521 | + <field name="name">*25 - Must be kept below 25°C (but not necesseraly in cold chain)</field> |
2522 | </record> |
2523 | <record model="product.cold_chain" id="cold_13"> |
2524 | - <field name="code">17*25F</field> |
2525 | - <field name="name">17*25F Cold Chain *25F - Must be kept below 25°C and cannot be frozen: check Freeze-tag</field> |
2526 | + <field name="code">*25F</field> |
2527 | + <field name="name">*25F - Must be kept below 25°C and cannot be frozen: check FreezeWatch</field> |
2528 | </record> |
2529 | |
2530 | - |
2531 | </data> |
2532 | </openerp> |
2533 | |
2534 | |
2535 | === modified file 'bin/addons/product_attributes/product_attributes_view.xml' |
2536 | --- bin/addons/product_attributes/product_attributes_view.xml 2015-05-29 15:33:12 +0000 |
2537 | +++ bin/addons/product_attributes/product_attributes_view.xml 2016-03-24 09:31:01 +0000 |
2538 | @@ -61,13 +61,13 @@ |
2539 | <separator string="Codes" colspan="2"/> |
2540 | <field name="default_code" required="1" string="Code" on_change="onchange_code(default_code)" |
2541 | attrs="{'readonly':[('duplicate_ok','=',False)]}" /> |
2542 | - <field name="old_code"/> |
2543 | + <field name="new_code"/> |
2544 | <field name="duplicate_ok" invisible="1"/> |
2545 | </group> |
2546 | <group colspan="4" col="2"> |
2547 | <separator string="Description" colspan="2"/> |
2548 | <field name="name" string="Description"/> |
2549 | - <field name="new_code"/> |
2550 | + <field name="old_code"/> |
2551 | <field name="sale_ok" invisible="1" /> |
2552 | <field name="purchase_ok" invisible="1" /> |
2553 | </group> |
2554 | @@ -94,6 +94,7 @@ |
2555 | <group colspan="2" col="2"> |
2556 | <separator string="Weights" colspan="2"/> |
2557 | <field name="volume" attrs="{'readonly':[('type','=','service')]}"/> |
2558 | + <field name="volume_updated" invisible="1" /> |
2559 | <field name="soq_volume" attrs="{'readonly':[('type','=','service')]}"/> |
2560 | <field name="weight" attrs="{'readonly':[('type','=','service')]}"/> |
2561 | <field name="soq_weight" attrs="{'readonly':[('type','=','service')]}"/> |
2562 | @@ -106,7 +107,9 @@ |
2563 | <separator string="Status" colspan="3"/> |
2564 | <field name="categ_id" readonly="1" colspan="3"/> |
2565 | <field name="international_status" required="1" widget="selection" colspan="3" /> |
2566 | + <field name="standard_ok" colspan="3" /> |
2567 | <field name="state" colspan="3" widget="selection" /> |
2568 | + <field name="state_ud" colspan="3" /> |
2569 | <field name="active" readonly="1"/> |
2570 | <group colspan="1" col="1"> |
2571 | <button name="deactivate_product" icon="gtk-execute" string="De-activate product" type="object" attrs="{'invisible': [('active', '=', False)]}" /> |
2572 | @@ -131,27 +134,25 @@ |
2573 | <field name="cold_chain" colspan="2" attrs="{'invisible': [('show_cold_chain','=',False)]}" widget="selection"/> |
2574 | <field name="sterilized" colspan="2"/> |
2575 | <field name="single_use" colspan="2"/> |
2576 | - <field name="narcotic" colspan="2"/> |
2577 | <field name="controlled_substance" colspan="2"/> |
2578 | + <separator string="Transport" colspan="2"/> |
2579 | + <field name="dangerous_goods" colspan="2"/> |
2580 | + <field name="un_code" colspan="2"/> |
2581 | + <separator string="Import restrictions" colspan="4"/> |
2582 | + <field name="restricted_country" colspan="2"/> |
2583 | + <field name="country_restriction" colspan="2" widget="selection" attrs="{'readonly':[('restricted_country','=',False)]}"/> |
2584 | </group> |
2585 | <group colspan="2" col="2"> |
2586 | <separator string="Diffusion" colspan="2"/> |
2587 | - <field name="standard_ok" colspan="2" /> |
2588 | - <field name="justification_code_id" colspan="2" widget="selection" /> |
2589 | + <field name="justification_code_id" colspan="2" /> |
2590 | <!-- uf-1544 |
2591 | <field name="med_device_class" colspan="2" /> |
2592 | <field name="gmdn_code" colspan="2" /> |
2593 | <field name="gmdn_description" colspan="2" /> |
2594 | --> |
2595 | <field name="closed_article" colspan="2"/> |
2596 | - <separator string="Import restrictions" colspan="4"/> |
2597 | - <field name="restricted_country" colspan="2"/> |
2598 | - <field name="country_restriction" colspan="2" widget="selection" attrs="{'readonly':[('restricted_country','=',False)]}"/> |
2599 | - </group> |
2600 | - <group colspan="2" col="2"> |
2601 | - <separator string="Transport" colspan="2"/> |
2602 | - <field name="dangerous_goods" colspan="2"/> |
2603 | - <field name="un_code" colspan="2"/> |
2604 | + <field name="manufacturer_ref" attrs="{'invisible': [('closed_article', '=', 'no')]}" /> |
2605 | + <field name="manufacturer_txt" attrs="{'invisible': [('closed_article', '=', 'no')]}" /> |
2606 | </group> |
2607 | <group colspan="2" col="2"> |
2608 | <separator string="Form" colspan="2" /> |
2609 | @@ -265,7 +266,7 @@ |
2610 | <separator string="Description"/> |
2611 | <!-- uf-1544 invisible--> |
2612 | <field name="product_catalog_page" invisible="1"/> |
2613 | - <field name="product_catalog_path"/> |
2614 | + <field name="product_catalog_path" widget="url"/> |
2615 | <separator string="Description"/> |
2616 | <field colspan="4" name="description" nolabel="1"/> |
2617 | <field colspan="4" name="description2" nolabel="1"/> |
2618 | @@ -368,7 +369,7 @@ |
2619 | <field name="arch" type="xml"> |
2620 | <page string="Specific info" position="before"> |
2621 | <page string="Dates"> |
2622 | - <field name="life_time" /> |
2623 | + <field name="life_time" attrs="{'required': [('short_shelf_life', '=', 'True')]}" /> |
2624 | <field name="short_shelf_life" /> |
2625 | <field name="use_time" /> |
2626 | <field name="alert_time" /> |
2627 | @@ -752,6 +753,18 @@ |
2628 | action="product_cold_chain_action" |
2629 | parent="purchase.menu_product_in_config_purchase" /> |
2630 | |
2631 | + <record id="product_justification_code_form_view" model="ir.ui.view"> |
2632 | + <field name="name">product.justification.code.form</field> |
2633 | + <field name="model">product.justification.code</field> |
2634 | + <field name="type">form</field> |
2635 | + <field name="arch" type="xml"> |
2636 | + <form string="Justification Code"> |
2637 | + <field name="code" readonly="True"/> |
2638 | + <field name="description" readonly="True"/> |
2639 | + </form> |
2640 | + </field> |
2641 | + </record> |
2642 | + |
2643 | <record id="product_justification_code_tree_view" model="ir.ui.view"> |
2644 | <field name="name">product.justification.code.tree</field> |
2645 | <field name="model">product.justification.code</field> |
2646 | @@ -813,7 +826,7 @@ |
2647 | </group> |
2648 | <separator string="Actions" colspan="4" /> |
2649 | <label colspan="3"> </label> |
2650 | - <button special="cancel" string="Close window" icon="gtk-cancel" /> |
2651 | + <button type="object" name="return_to_product" string="Close window" icon="gtk-cancel" /> |
2652 | </form> |
2653 | </field> |
2654 | </record> |
2655 | |
2656 | === modified file 'bin/addons/specific_rules/specific_rules.py' |
2657 | --- bin/addons/specific_rules/specific_rules.py 2016-02-08 10:00:07 +0000 |
2658 | +++ bin/addons/specific_rules/specific_rules.py 2016-03-24 09:31:01 +0000 |
2659 | @@ -55,10 +55,12 @@ |
2660 | |
2661 | for sol in self.browse(cr, uid, ids, context=context): |
2662 | if sol.product_id: |
2663 | - if sol.product_id.heat_sensitive_item: |
2664 | - result[sol.id] = 'KC' |
2665 | - elif sol.product_id.dangerous_goods: |
2666 | - result[sol.id] = 'DG' |
2667 | + if sol.product_id.kc_txt: |
2668 | + result[sol.id] += sol.product_id.is_kc and 'KC' or 'KC ?' |
2669 | + if sol.product_id.dg_txt: |
2670 | + if result[sol.id]: |
2671 | + result[sol.id] += ' / ' |
2672 | + result[sol.id] += sol.product_id.is_dg and 'DG' or 'DG ?' |
2673 | |
2674 | return result |
2675 | |
2676 | @@ -77,7 +79,7 @@ |
2677 | # if the product is short shelf life, display a warning |
2678 | if product: |
2679 | prod_obj = self.pool.get('product.product') |
2680 | - if prod_obj.browse(cr, uid, product).short_shelf_life: |
2681 | + if prod_obj.browse(cr, uid, product).is_ssl: |
2682 | warning = { |
2683 | 'title': 'Short Shelf Life product', |
2684 | 'message': _(SHORT_SHELF_LIFE_MESS) |
2685 | @@ -105,7 +107,7 @@ |
2686 | for obj in self.browse(cr, uid, ids, context=context): |
2687 | for line in obj.order_line: |
2688 | # log the message |
2689 | - if line.product_id.short_shelf_life: |
2690 | + if line.product_id.is_ssl: |
2691 | # log the message |
2692 | self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS)) |
2693 | |
2694 | @@ -130,30 +132,33 @@ |
2695 | |
2696 | for pol in self.browse(cr, uid, ids, context=context): |
2697 | if pol.product_id: |
2698 | - if pol.product_id.heat_sensitive_item: |
2699 | - result[pol.id] = 'KC' |
2700 | - elif pol.product_id.dangerous_goods: |
2701 | - result[pol.id] = 'DG' |
2702 | + if pol.product_id.kc_txt: |
2703 | + result[pol.id] += pol.product_id.is_kc and 'KC' or 'KC ?' |
2704 | + if pol.product_id.dg_txt: |
2705 | + if result[pol.id]: |
2706 | + result[pol.id] += ' / ' |
2707 | + result[pol.id] += pol.product_id.is_dg and 'DG' or 'DG ?' |
2708 | |
2709 | return result |
2710 | |
2711 | _columns = {'kc_dg': fields.function(_kc_dg, method=True, string='KC/DG', type='char'),} |
2712 | |
2713 | - def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, |
2714 | + def product_id_on_change(self, cr, uid, ids, pricelist, product, qty, uom, |
2715 | partner_id, date_order=False, fiscal_position=False, date_planned=False, |
2716 | - name=False, price_unit=False, notes=False): |
2717 | + name=False, price_unit=False, notes=False, state=False, old_price_unit=0.00, nomen_manda_0=False, |
2718 | + comment='', context=None): |
2719 | ''' |
2720 | if the product is short shelf life we display a warning |
2721 | ''' |
2722 | # call to super |
2723 | - result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, |
2724 | + result = super(purchase_order_line, self).product_id_on_change(cr, uid, ids, pricelist, product, qty, uom, |
2725 | partner_id, date_order, fiscal_position, date_planned, |
2726 | - name, price_unit, notes) |
2727 | + name, price_unit, notes, state, old_price_unit, nomen_manda_0, comment, context) |
2728 | |
2729 | # if the product is short shelf life, display a warning |
2730 | if product: |
2731 | prod_obj = self.pool.get('product.product') |
2732 | - if prod_obj.browse(cr, uid, product).short_shelf_life: |
2733 | + if prod_obj.browse(cr, uid, product).is_ssl: |
2734 | warning = { |
2735 | 'title': 'Short Shelf Life product', |
2736 | 'message': _(SHORT_SHELF_LIFE_MESS) |
2737 | @@ -183,7 +188,7 @@ |
2738 | for obj in self.browse(cr, uid, ids, context=context): |
2739 | for line in obj.order_line: |
2740 | # log the message |
2741 | - if line.product_id.short_shelf_life: |
2742 | + if line.product_id.is_ssl: |
2743 | # log the message |
2744 | self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS)) |
2745 | |
2746 | @@ -276,7 +281,7 @@ |
2747 | product_obj = self.pool.get('product.product') |
2748 | product_id = vals.get('product_id', False) |
2749 | if product_id: |
2750 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2751 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2752 | self.log(cr, uid, new_id, _(SHORT_SHELF_LIFE_MESS)) |
2753 | |
2754 | return new_id |
2755 | @@ -293,7 +298,7 @@ |
2756 | product_obj = self.pool.get('product.product') |
2757 | product_id = vals.get('product_id', False) |
2758 | if product_id: |
2759 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2760 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2761 | for obj in self.browse(cr, uid, ids, context=context): |
2762 | self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS)) |
2763 | |
2764 | @@ -525,7 +530,7 @@ |
2765 | product_obj = self.pool.get('product.product') |
2766 | product_id = vals.get('product_id', False) |
2767 | if product_id: |
2768 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2769 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2770 | self.log(cr, uid, new_id, _(SHORT_SHELF_LIFE_MESS)) |
2771 | |
2772 | return new_id |
2773 | @@ -542,7 +547,7 @@ |
2774 | product_obj = self.pool.get('product.product') |
2775 | product_id = vals.get('product_id', False) |
2776 | if product_id: |
2777 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2778 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2779 | for obj in self.browse(cr, uid, ids, context=context): |
2780 | self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS)) |
2781 | |
2782 | @@ -566,7 +571,7 @@ |
2783 | product_obj = self.pool.get('product.product') |
2784 | product_id = vals.get('product_id', False) |
2785 | if product_id: |
2786 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2787 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2788 | self.log(cr, uid, new_id, _(SHORT_SHELF_LIFE_MESS)) |
2789 | |
2790 | return new_id |
2791 | @@ -586,7 +591,7 @@ |
2792 | product_obj = self.pool.get('product.product') |
2793 | product_id = vals.get('product_id', False) |
2794 | if product_id: |
2795 | - if product_obj.browse(cr, uid, product_id, context=context).short_shelf_life: |
2796 | + if product_obj.browse(cr, uid, product_id, context=context).is_ssl: |
2797 | for obj in self.browse(cr, uid, ids, context=context): |
2798 | self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS)) |
2799 | |
2800 | @@ -640,10 +645,12 @@ |
2801 | |
2802 | for move in self.browse(cr, uid, ids, context=context): |
2803 | if move.product_id: |
2804 | - if move.product_id.heat_sensitive_item: |
2805 | - result[move.id] = 'KC' |
2806 | - elif move.product_id.dangerous_goods: |
2807 | - result[move.id] = 'DG' |
2808 | + if move.product_id.kc_txt: |
2809 | + result[move.id] += move.product_id.is_kc and 'KC' or 'KC ?' |
2810 | + if move.product_id.dg_txt: |
2811 | + if result[move.id]: |
2812 | + result[move.id] += ' / ' |
2813 | + result[move.id] += move.product_id.is_dg and 'DG' or 'DG ?' |
2814 | |
2815 | return result |
2816 | |
2817 | @@ -751,17 +758,13 @@ |
2818 | |
2819 | for obj in self.browse(cr, uid, ids, context=context): |
2820 | # keep cool |
2821 | - if obj.product_id.heat_sensitive_item: |
2822 | - result[obj.id]['kc_check'] = True |
2823 | + result[obj.id]['kc_check'] = obj.product_id.kc_txt |
2824 | # ssl |
2825 | - if obj.product_id.short_shelf_life: |
2826 | - result[obj.id]['ssl_check'] = True |
2827 | + result[obj.id]['ssl_check'] = obj.product_id.ssl_txt |
2828 | # dangerous goods |
2829 | - if obj.product_id.dangerous_goods: |
2830 | - result[obj.id]['dg_check'] = True |
2831 | + result[obj.id]['dg_check'] = obj.product_id.dg_txt |
2832 | # narcotic |
2833 | - if obj.product_id.narcotic: |
2834 | - result[obj.id]['np_check'] = True |
2835 | + result[obj.id]['np_check'] = obj.product_id.cs_txt |
2836 | # lot management |
2837 | if obj.product_id.batch_management: |
2838 | result[obj.id]['lot_check'] = True |
2839 | @@ -788,14 +791,75 @@ |
2840 | # if prodlot needs to be mandatory, add 'required': ['|', ('hidden_batch_management_mandatory','=',True), ('hidden_perishable_mandatory','=',True)] in attrs |
2841 | 'hidden_batch_management_mandatory': fields.boolean(string='Hidden Flag for Batch Management product',), |
2842 | 'hidden_perishable_mandatory': fields.boolean(string='Hidden Flag for Perishable product',), |
2843 | - 'kc_check': fields.function(_get_checks_all, method=True, string='KC', type='boolean', readonly=True, multi="m"), |
2844 | - 'ssl_check': fields.function(_get_checks_all, method=True, string='SSL', type='boolean', readonly=True, multi="m"), |
2845 | - 'dg_check': fields.function(_get_checks_all, method=True, string='DG', type='boolean', readonly=True, multi="m"), |
2846 | - 'np_check': fields.function(_get_checks_all, method=True, string='NP', type='boolean', readonly=True, multi="m"), |
2847 | - 'lot_check': fields.function(_get_checks_all, method=True, string='B.Num', type='boolean', readonly=True, multi="m"), |
2848 | - 'exp_check': fields.function(_get_checks_all, method=True, string='Exp', type='boolean', readonly=True, multi="m"), |
2849 | - 'kit_check': fields.function(_get_checks_all, method=True, string='Kit', type='boolean', readonly=True, multi="m"), |
2850 | - 'prodlot_id': fields.many2one('stock.production.lot', 'Batch', states={'done': [('readonly', True)]}, help="Batch number is used to put a serial number on the production", select=True), |
2851 | + 'kc_check': fields.function( |
2852 | + _get_checks_all, |
2853 | + method=True, |
2854 | + string='KC', |
2855 | + type='char', |
2856 | + size=8, |
2857 | + readonly=True, |
2858 | + multi="m", |
2859 | + ), |
2860 | + 'ssl_check': fields.function( |
2861 | + _get_checks_all, |
2862 | + method=True, |
2863 | + string='SSL', |
2864 | + type='char', |
2865 | + size=8, |
2866 | + readonly=True, |
2867 | + multi="m", |
2868 | + ), |
2869 | + 'dg_check': fields.function( |
2870 | + _get_checks_all, |
2871 | + method=True, |
2872 | + string='DG', |
2873 | + type='char', |
2874 | + size=8, |
2875 | + readonly=True, |
2876 | + multi="m", |
2877 | + ), |
2878 | + 'np_check': fields.function( |
2879 | + _get_checks_all, |
2880 | + method=True, |
2881 | + string='CS', |
2882 | + type='char', |
2883 | + size=8, |
2884 | + readonly=True, |
2885 | + multi="m", |
2886 | + ), |
2887 | + 'lot_check': fields.function( |
2888 | + _get_checks_all, |
2889 | + method=True, |
2890 | + string='B.Num', |
2891 | + type='boolean', |
2892 | + readonly=True, |
2893 | + multi="m", |
2894 | + ), |
2895 | + 'exp_check': fields.function( |
2896 | + _get_checks_all, |
2897 | + method=True, |
2898 | + string='Exp', |
2899 | + type='boolean', |
2900 | + readonly=True, |
2901 | + multi="m", |
2902 | + ), |
2903 | + 'kit_check': fields.function( |
2904 | + _get_checks_all, |
2905 | + method=True, |
2906 | + string='Kit', |
2907 | + type='boolean', |
2908 | + readonly=True, |
2909 | + multi="m", |
2910 | + ), |
2911 | + 'prodlot_id': fields.many2one( |
2912 | + 'stock.production.lot', |
2913 | + 'Batch', |
2914 | + states={ |
2915 | + 'done': [('readonly', True)], |
2916 | + }, |
2917 | + help="Batch number is used to put a serial number on the production", |
2918 | + select=True, |
2919 | + ), |
2920 | } |
2921 | |
2922 | _constraints = [ |
2923 | @@ -1074,17 +1138,13 @@ |
2924 | |
2925 | for obj in self.browse(cr, uid, ids, context=context): |
2926 | # keep cool |
2927 | - if obj.product_id.heat_sensitive_item: |
2928 | - result[obj.id]['kc_check'] = True |
2929 | + result[obj.id]['kc_check'] = obj.product_id.kc_txt |
2930 | # ssl |
2931 | - if obj.product_id.short_shelf_life: |
2932 | - result[obj.id]['ssl_check'] = True |
2933 | + result[obj.id]['ssl_check'] = obj.product_id.ssl_txt |
2934 | # dangerous goods |
2935 | - if obj.product_id.dangerous_goods: |
2936 | - result[obj.id]['dg_check'] = True |
2937 | + result[obj.id]['dg_check'] = obj.product_id.dg_txt |
2938 | # narcotic |
2939 | - if obj.product_id.narcotic: |
2940 | - result[obj.id]['np_check'] = True |
2941 | + result[obj.id]['np_check'] = obj.product_id.cs_txt |
2942 | # lot management |
2943 | if obj.product_id.batch_management: |
2944 | result[obj.id]['lot_check'] = True |
2945 | @@ -1163,30 +1223,90 @@ |
2946 | |
2947 | return res |
2948 | |
2949 | - _columns = {'check_type': fields.function(_get_false, fnct_search=search_check_type, string='Check Type', type="boolean", readonly=True, method=True), |
2950 | - # readonly is True, the user is only allowed to create standard lots - internal lots are system-created |
2951 | - 'type': fields.selection([('standard', 'Standard'),('internal', 'Internal'),], string="Type", readonly=True), |
2952 | - #'expiry_date': fields.date('Expiry Date'), |
2953 | - 'name': fields.char('Batch Number', size=1024, required=True, help="Unique batch number, will be displayed as: PREFIX/SERIAL [INT_REF]"), |
2954 | - 'date': fields.datetime('Auto Creation Date', required=True), |
2955 | - 'sequence_id': fields.many2one('ir.sequence', 'Batch Sequence', required=True,), |
2956 | - 'stock_virtual': fields.function(_get_stock_virtual, method=True, type="float", string="Available Stock", select=True, |
2957 | - help="Current available quantity of products with this Batch Numbre Number in company warehouses", |
2958 | - digits_compute=dp.get_precision('Product UoM'), readonly=True, |
2959 | - fnct_search=_stock_search_virtual,), |
2960 | - 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Real Stock", select=True, |
2961 | - help="Current real quantity of products with this Batch Number in company warehouses", |
2962 | - digits_compute=dp.get_precision('Product UoM')), |
2963 | - 'src_product_id': fields.function(_get_dummy, fnct_search=_src_product, method=True, type="boolean", string="By product"), |
2964 | - 'kc_check': fields.function(_get_checks_all, method=True, string='KC', type='boolean', readonly=True, multi="m"), |
2965 | - 'ssl_check': fields.function(_get_checks_all, method=True, string='SSL', type='boolean', readonly=True, multi="m"), |
2966 | - 'dg_check': fields.function(_get_checks_all, method=True, string='DG', type='boolean', readonly=True, multi="m"), |
2967 | - 'np_check': fields.function(_get_checks_all, method=True, string='NP', type='boolean', readonly=True, multi="m"), |
2968 | - 'lot_check': fields.function(_get_checks_all, method=True, string='B.Num', type='boolean', readonly=True, multi="m"), |
2969 | - 'exp_check': fields.function(_get_checks_all, method=True, string='Exp', type='boolean', readonly=True, multi="m"), |
2970 | - 'delete_ok': fields.function(_get_delete_ok, method=True, string='Possible deletion ?', type='boolean', readonly=True), |
2971 | - 'is_expired': fields.function(_is_expired, method=True, string='Expired ?', type='boolean', store=False, readonly=True), |
2972 | - } |
2973 | + _columns = { |
2974 | + 'check_type': fields.function(_get_false, fnct_search=search_check_type, string='Check Type', type="boolean", readonly=True, method=True), |
2975 | + # readonly is True, the user is only allowed to create standard lots - internal lots are system-created |
2976 | + 'type': fields.selection([('standard', 'Standard'),('internal', 'Internal'),], string="Type", readonly=True), |
2977 | + #'expiry_date': fields.date('Expiry Date'), |
2978 | + 'name': fields.char('Batch Number', size=1024, required=True, help="Unique batch number, will be displayed as: PREFIX/SERIAL [INT_REF]"), |
2979 | + 'date': fields.datetime('Auto Creation Date', required=True), |
2980 | + 'sequence_id': fields.many2one('ir.sequence', 'Batch Sequence', required=True,), |
2981 | + 'stock_virtual': fields.function(_get_stock_virtual, method=True, type="float", string="Available Stock", select=True, |
2982 | + help="Current available quantity of products with this Batch Numbre Number in company warehouses", |
2983 | + digits_compute=dp.get_precision('Product UoM'), readonly=True, |
2984 | + fnct_search=_stock_search_virtual,), |
2985 | + 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Real Stock", select=True, |
2986 | + help="Current real quantity of products with this Batch Number in company warehouses", |
2987 | + digits_compute=dp.get_precision('Product UoM')), |
2988 | + 'src_product_id': fields.function(_get_dummy, fnct_search=_src_product, method=True, type="boolean", string="By product"), |
2989 | + 'kc_check': fields.function( |
2990 | + _get_checks_all, |
2991 | + method=True, |
2992 | + string='KC', |
2993 | + type='char', |
2994 | + size=8, |
2995 | + readonly=True, |
2996 | + multi="m", |
2997 | + ), |
2998 | + 'ssl_check': fields.function( |
2999 | + _get_checks_all, |
3000 | + method=True, |
3001 | + string='SSL', |
3002 | + type='char', |
3003 | + size=8, |
3004 | + readonly=True, |
3005 | + multi="m", |
3006 | + ), |
3007 | + 'dg_check': fields.function( |
3008 | + _get_checks_all, |
3009 | + method=True, |
3010 | + string='DG', |
3011 | + type='char', |
3012 | + size=8, |
3013 | + readonly=True, |
3014 | + multi="m", |
3015 | + ), |
3016 | + 'np_check': fields.function( |
3017 | + _get_checks_all, |
3018 | + method=True, |
3019 | + string='CS', |
3020 | + type='char', |
3021 | + size=8, |
3022 | + readonly=True, |
3023 | + multi="m", |
3024 | + ), |
3025 | + 'lot_check': fields.function( |
3026 | + _get_checks_all, |
3027 | + method=True, |
3028 | + string='B.Num', |
3029 | + type='boolean', |
3030 | + readonly=True, |
3031 | + multi="m", |
3032 | + ), |
3033 | + 'exp_check': fields.function( |
3034 | + _get_checks_all, |
3035 | + method=True, |
3036 | + string='Exp', |
3037 | + type='boolean', |
3038 | + readonly=True, |
3039 | + multi="m", |
3040 | + ), |
3041 | + 'delete_ok': fields.function( |
3042 | + _get_delete_ok, |
3043 | + method=True, |
3044 | + string='Possible deletion ?', |
3045 | + type='boolean', |
3046 | + readonly=True, |
3047 | + ), |
3048 | + 'is_expired': fields.function( |
3049 | + _is_expired, |
3050 | + method=True, |
3051 | + string='Expired ?', |
3052 | + type='boolean', |
3053 | + store=False, |
3054 | + readonly=True, |
3055 | + ), |
3056 | + } |
3057 | |
3058 | _defaults = {'type': 'standard', |
3059 | 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'stock.production.lot', context=c), |
3060 | @@ -1705,9 +1825,9 @@ |
3061 | result.setdefault('value', {})['expiry_date'] = False |
3062 | result.setdefault('value', {})['lot_check'] = False |
3063 | result.setdefault('value', {})['exp_check'] = False |
3064 | - result.setdefault('value', {})['dg_check'] = False |
3065 | - result.setdefault('value', {})['kc_check'] = False |
3066 | - result.setdefault('value', {})['np_check'] = False |
3067 | + result.setdefault('value', {})['dg_check'] = '' |
3068 | + result.setdefault('value', {})['kc_check'] = '' |
3069 | + result.setdefault('value', {})['np_check'] = '' |
3070 | # reset the hidden flags |
3071 | result.setdefault('value', {})['hidden_batch_management_mandatory'] = False |
3072 | result.setdefault('value', {})['hidden_perishable_mandatory'] = False |
3073 | @@ -1725,17 +1845,13 @@ |
3074 | result.setdefault('value', {})['hidden_perishable_mandatory'] = True |
3075 | result.setdefault('value', {})['exp_check'] = True |
3076 | # keep cool |
3077 | - if product_obj.heat_sensitive_item: |
3078 | - result.setdefault('value', {})['kc_check'] = True |
3079 | + result.setdefault('value', {})['kc_check'] = product_obj.kc_txt |
3080 | # ssl |
3081 | - if product_obj.short_shelf_life: |
3082 | - result.setdefault('value', {})['ssl_check'] = True |
3083 | + result.setdefault('value', {})['ssl_check'] = product_obj.ssl_txt |
3084 | # dangerous goods |
3085 | - if product_obj.dangerous_goods: |
3086 | - result.setdefault('value', {})['dg_check'] = True |
3087 | + result.setdefault('value', {})['dg_check'] = product_obj.dg_txt |
3088 | # narcotic |
3089 | - if product_obj.narcotic: |
3090 | - result.setdefault('value', {})['np_check'] = True |
3091 | + result.setdefault('value', {})['np_check'] = product_obj.cs_txt |
3092 | # if not product, result is 0.0 by super |
3093 | # compute qty |
3094 | result = self.common_on_change(cr, uid, ids, location_id, product, prod_lot_id, uom, to_date, result=result) |
3095 | @@ -1802,17 +1918,13 @@ |
3096 | |
3097 | for obj in self.browse(cr, uid, ids, context=context): |
3098 | # keep cool |
3099 | - if obj.product_id.heat_sensitive_item: |
3100 | - result[obj.id]['kc_check'] = True |
3101 | + result[obj.id]['kc_check'] = obj.product_id.kc_txt |
3102 | # ssl |
3103 | - if obj.product_id.short_shelf_life: |
3104 | - result[obj.id]['ssl_check'] = True |
3105 | + result[obj.id]['ssl_check'] = obj.product_id.ssl_txt |
3106 | # dangerous goods |
3107 | - if obj.product_id.dangerous_goods: |
3108 | - result[obj.id]['dg_check'] = True |
3109 | + result[obj.id]['dg_check'] = obj.product_id.dg_txt |
3110 | # narcotic |
3111 | - if obj.product_id.narcotic: |
3112 | - result[obj.id]['np_check'] = True |
3113 | + result[obj.id]['np_check'] = obj.product_id.cs_txt |
3114 | # lot management |
3115 | if obj.product_id.batch_management: |
3116 | result[obj.id]['lot_check'] = True |
3117 | @@ -1924,15 +2036,77 @@ |
3118 | 'prod_lot_id': fields.many2one('stock.production.lot', 'Batch', domain="[('product_id','=',product_id)]"), |
3119 | 'expiry_date': fields.date(string='Expiry Date'), |
3120 | 'type_check': fields.char(string='Type Check', size=1024,), |
3121 | - 'kc_check': fields.function(_get_checks_all, method=True, string='KC', type='boolean', readonly=True, multi="m"), |
3122 | - 'ssl_check': fields.function(_get_checks_all, method=True, string='SSL', type='boolean', readonly=True, multi="m"), |
3123 | - 'dg_check': fields.function(_get_checks_all, method=True, string='DG', type='boolean', readonly=True, multi="m"), |
3124 | - 'np_check': fields.function(_get_checks_all, method=True, string='NP', type='boolean', readonly=True, multi="m"), |
3125 | - 'lot_check': fields.function(_get_checks_all, method=True, string='B.Num', type='boolean', readonly=True, multi="m"), |
3126 | - 'exp_check': fields.function(_get_checks_all, method=True, string='Exp', type='boolean', readonly=True, multi="m"), |
3127 | - 'has_problem': fields.function(_get_checks_all, method=True, string='Has problem', type='boolean', readonly=True, multi="m"), |
3128 | - 'duplicate_line': fields.function(_get_checks_all, method=True, string='Duplicate line', type='boolean', readonly=True, multi="m"), |
3129 | - 'dont_move': fields.boolean(string='Don\'t create stock.move for this line'), |
3130 | + 'kc_check': fields.function( |
3131 | + _get_checks_all, |
3132 | + method=True, |
3133 | + string='KC', |
3134 | + type='char', |
3135 | + size=8, |
3136 | + readonly=True, |
3137 | + multi="m", |
3138 | + ), |
3139 | + 'ssl_check': fields.function( |
3140 | + _get_checks_all, |
3141 | + method=True, |
3142 | + string='SSL', |
3143 | + type='char', |
3144 | + size=8, |
3145 | + readonly=True, |
3146 | + multi="m", |
3147 | + ), |
3148 | + 'dg_check': fields.function( |
3149 | + _get_checks_all, |
3150 | + method=True, |
3151 | + string='DG', |
3152 | + type='char', |
3153 | + size=8, |
3154 | + readonly=True, |
3155 | + multi="m", |
3156 | + ), |
3157 | + 'np_check': fields.function( |
3158 | + _get_checks_all, |
3159 | + method=True, |
3160 | + string='CS', |
3161 | + type='char', |
3162 | + size=8, |
3163 | + readonly=True, |
3164 | + multi="m", |
3165 | + ), |
3166 | + 'lot_check': fields.function( |
3167 | + _get_checks_all, |
3168 | + method=True, |
3169 | + string='B.Num', |
3170 | + type='boolean', |
3171 | + readonly=True, |
3172 | + multi="m", |
3173 | + ), |
3174 | + 'exp_check': fields.function( |
3175 | + _get_checks_all, |
3176 | + method=True, |
3177 | + string='Exp', |
3178 | + type='boolean', |
3179 | + readonly=True, |
3180 | + multi="m", |
3181 | + ), |
3182 | + 'has_problem': fields.function( |
3183 | + _get_checks_all, |
3184 | + method=True, |
3185 | + string='Has problem', |
3186 | + type='boolean', |
3187 | + readonly=True, |
3188 | + multi="m", |
3189 | + ), |
3190 | + 'duplicate_line': fields.function( |
3191 | + _get_checks_all, |
3192 | + method=True, |
3193 | + string='Duplicate line', |
3194 | + type='boolean', |
3195 | + readonly=True, |
3196 | + multi="m", |
3197 | + ), |
3198 | + 'dont_move': fields.boolean( |
3199 | + string='Don\'t create stock.move for this line', |
3200 | + ), |
3201 | } |
3202 | |
3203 | _defaults = {# in is used, meaning a new prod lot will be created if the specified expiry date does not exist |
3204 | |
3205 | === modified file 'bin/addons/specific_rules/specific_rules_view.xml' |
3206 | --- bin/addons/specific_rules/specific_rules_view.xml 2015-10-13 12:25:48 +0000 |
3207 | +++ bin/addons/specific_rules/specific_rules_view.xml 2016-03-24 09:31:01 +0000 |
3208 | @@ -55,7 +55,7 @@ |
3209 | <data> |
3210 | |
3211 | <field name="life_time" position="replace"> |
3212 | - <field name="life_time" attrs="{'required':[('short_shelf_life', '=', True)]}" /> |
3213 | + <field name="life_time" attrs="{'required':[('short_shelf_life', '=', 'True')]}" /> |
3214 | </field> |
3215 | </data> |
3216 | </field> |
3217 | @@ -250,10 +250,10 @@ |
3218 | <field name="expired_date" attrs="{'readonly': [('state', 'not in', ['draft', 'waiting', 'confirmed', 'assigned'])]}" /> |
3219 | <field name="lot_check" /> |
3220 | <field name="exp_check" /> |
3221 | - <field name="kc_check" /> |
3222 | - <field name="ssl_check" invisible="True" /> |
3223 | - <field name="dg_check" /> |
3224 | - <field name="np_check" /> |
3225 | + <field name="kc_check" widget="null_boolean" /> |
3226 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3227 | + <field name="dg_check" widget="null_boolean" /> |
3228 | + <field name="np_check" widget="null_boolean" /> |
3229 | |
3230 | </field> |
3231 | |
3232 | @@ -297,10 +297,10 @@ |
3233 | <field name="expired_date" attrs="{'readonly': [('state', 'not in', ['draft', 'waiting', 'confirmed', 'assigned'])]}" /> |
3234 | <field name="lot_check" /> |
3235 | <field name="exp_check" /> |
3236 | - <field name="kc_check" /> |
3237 | - <field name="ssl_check" invisible="True" /> |
3238 | - <field name="dg_check" /> |
3239 | - <field name="np_check" /> |
3240 | + <field name="kc_check" widget="null_boolean" /> |
3241 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3242 | + <field name="dg_check" widget="null_boolean" /> |
3243 | + <field name="np_check" widget="null_boolean" /> |
3244 | </field> |
3245 | |
3246 | <button name="action_confirm" position="attributes"> |
3247 | @@ -332,10 +332,10 @@ |
3248 | <button name="action_done" position="after"> |
3249 | <field name="lot_check" /> |
3250 | <field name="exp_check" /> |
3251 | - <field name="kc_check" /> |
3252 | - <field name="ssl_check" invisible="True" /> |
3253 | - <field name="dg_check" /> |
3254 | - <field name="np_check" /> |
3255 | + <field name="kc_check" widget="null_boolean" /> |
3256 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3257 | + <field name="dg_check" widget="null_boolean" /> |
3258 | + <field name="np_check" widget="null_boolean" /> |
3259 | </button> |
3260 | |
3261 | <button name="action_done" position="attributes"> |
3262 | @@ -362,10 +362,10 @@ |
3263 | <field name="state" position="after"> |
3264 | <field name="lot_check" /> |
3265 | <field name="exp_check" /> |
3266 | - <field name="kc_check" /> |
3267 | - <field name="ssl_check" invisible="True" /> |
3268 | - <field name="dg_check" /> |
3269 | - <field name="np_check" /> |
3270 | + <field name="kc_check" widget="null_boolean" /> |
3271 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3272 | + <field name="dg_check" widget="null_boolean" /> |
3273 | + <field name="np_check" widget="null_boolean" /> |
3274 | </field> |
3275 | |
3276 | </data> |
3277 | @@ -390,10 +390,10 @@ |
3278 | <button name="action_done" position="after"> |
3279 | <field name="lot_check" /> |
3280 | <field name="exp_check" /> |
3281 | - <field name="kc_check" /> |
3282 | - <field name="ssl_check" invisible="True" /> |
3283 | - <field name="dg_check" /> |
3284 | - <field name="np_check" /> |
3285 | + <field name="kc_check" widget="null_boolean" /> |
3286 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3287 | + <field name="dg_check" widget="null_boolean" /> |
3288 | + <field name="np_check" widget="null_boolean" /> |
3289 | </button> |
3290 | |
3291 | <button name="action_done" position="attributes"> |
3292 | @@ -420,10 +420,10 @@ |
3293 | <button name="action_assign" position="after"> |
3294 | <field name="lot_check" /> |
3295 | <field name="exp_check" /> |
3296 | - <field name="kc_check" /> |
3297 | - <field name="ssl_check" invisible="True" /> |
3298 | - <field name="dg_check" /> |
3299 | - <field name="np_check" /> |
3300 | + <field name="kc_check" widget="null_boolean" /> |
3301 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3302 | + <field name="dg_check" widget="null_boolean" /> |
3303 | + <field name="np_check" widget="null_boolean" /> |
3304 | </button> |
3305 | |
3306 | <button name="action_assign" position="attributes"> |
3307 | @@ -487,10 +487,10 @@ |
3308 | <field name="type_check" invisible="True" /> |
3309 | <field name="lot_check" /> |
3310 | <field name="exp_check" /> |
3311 | - <field name="kc_check" /> |
3312 | - <field name="ssl_check" invisible="True" /> |
3313 | - <field name="dg_check" /> |
3314 | - <field name="np_check" /> |
3315 | + <field name="kc_check" widget="null_boolean" /> |
3316 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3317 | + <field name="dg_check" widget="null_boolean" /> |
3318 | + <field name="np_check" widget="null_boolean" /> |
3319 | <button name="btn_dl" type="object" string="Line is duplicated" icon="gtk-dialog-warning" attrs="{'invisible': [('duplicate_line', '=', False)]}" /> |
3320 | <field name="duplicate_line" invisible="True" /> |
3321 | <field name="has_problem" invisible="True" /> |
3322 | @@ -522,10 +522,10 @@ |
3323 | <field name="type_check" invisible="True" /> |
3324 | <field name="lot_check" /> |
3325 | <field name="exp_check" /> |
3326 | - <field name="kc_check" /> |
3327 | - <field name="ssl_check" invisible="True" /> |
3328 | - <field name="dg_check" /> |
3329 | - <field name="np_check" /> |
3330 | + <field name="kc_check" widget="null_boolean" /> |
3331 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3332 | + <field name="dg_check" widget="null_boolean" /> |
3333 | + <field name="np_check" widget="null_boolean" /> |
3334 | </field> |
3335 | |
3336 | </data> |
3337 | |
3338 | === modified file 'bin/addons/specific_rules/wizard/stock_partial_move.py' |
3339 | --- bin/addons/specific_rules/wizard/stock_partial_move.py 2013-11-22 15:06:16 +0000 |
3340 | +++ bin/addons/specific_rules/wizard/stock_partial_move.py 2016-03-24 09:31:01 +0000 |
3341 | @@ -84,17 +84,13 @@ |
3342 | result[obj.id]['batch_number_check'] = obj.product_id.batch_management |
3343 | result[obj.id]['expiry_date_check'] = obj.product_id.perishable |
3344 | # keep cool |
3345 | - if obj.product_id.heat_sensitive_item: |
3346 | - result[obj.id]['kc_check'] = True |
3347 | + result[obj.id]['kc_check'] = obj.product_id.kc_txt |
3348 | # ssl |
3349 | - if obj.product_id.short_shelf_life: |
3350 | - result[obj.id]['ssl_check'] = True |
3351 | + result[obj.id]['ssl_check'] = obj.product_id.ssl_txt |
3352 | # dangerous goods |
3353 | - if obj.product_id.dangerous_goods: |
3354 | - result[obj.id]['dg_check'] = True |
3355 | + result[obj.id]['dg_check'] = obj.product_id.dg_txt |
3356 | # narcotic |
3357 | - if obj.product_id.narcotic: |
3358 | - result[obj.id]['np_check'] = True |
3359 | + result[obj.id]['np_check'] = obj.product_id.cs_txt |
3360 | # type of picking |
3361 | result[obj.id]['type_check'] = obj.move_id.type |
3362 | # lot management |
3363 | @@ -188,16 +184,80 @@ |
3364 | 'expiry_date_check': fields.function(_get_checks_all, method=True, string='Expiry Date Check', type='boolean', readonly=True, multi="m"), |
3365 | 'type_check': fields.function(_get_checks_all, method=True, string='Picking Type Check', type='char', readonly=True, multi="m"), |
3366 | 'expiry_date': fields.date('Expiry Date'), |
3367 | - 'kc_check': fields.function(_get_checks_all, method=True, string='KC', type='boolean', readonly=True, multi="m"), |
3368 | - 'ssl_check': fields.function(_get_checks_all, method=True, string='SSL', type='boolean', readonly=True, multi="m"), |
3369 | - 'dg_check': fields.function(_get_checks_all, method=True, string='DG', type='boolean', readonly=True, multi="m"), |
3370 | - 'np_check': fields.function(_get_checks_all, method=True, string='NP', type='boolean', readonly=True, multi="m"), |
3371 | - 'lot_check': fields.function(_get_checks_all, method=True, string='B.Num', type='boolean', readonly=True, multi="m"), |
3372 | - 'exp_check': fields.function(_get_checks_all, method=True, string='Exp', type='boolean', readonly=True, multi="m"), |
3373 | - 'location_id': fields.related('move_id', 'location_id', type='many2one', relation='stock.location', string='Source Location', readonly=True), |
3374 | - 'quantity_ordered': fields.float('Quantity ordered'), |
3375 | - 'uom_ordered': fields.many2one('product.uom', string='UoM ordered', readonly=True), |
3376 | - 'uom_category': fields.related('uom_ordered', 'category_id', type='many2one', relation='product.uom.categ'), |
3377 | + 'kc_check': fields.function( |
3378 | + _get_checks_all, |
3379 | + method=True, |
3380 | + string='KC', |
3381 | + type='char', |
3382 | + size=8, |
3383 | + readonly=True, |
3384 | + multi="m", |
3385 | + ), |
3386 | + 'ssl_check': fields.function( |
3387 | + _get_checks_all, |
3388 | + method=True, |
3389 | + string='SSL', |
3390 | + type='char', |
3391 | + size=8, |
3392 | + readonly=True, |
3393 | + multi="m", |
3394 | + ), |
3395 | + 'dg_check': fields.function( |
3396 | + _get_checks_all, |
3397 | + method=True, |
3398 | + string='DG', |
3399 | + type='char', |
3400 | + size=8, |
3401 | + readonly=True, |
3402 | + multi="m", |
3403 | + ), |
3404 | + 'np_check': fields.function( |
3405 | + _get_checks_all, |
3406 | + method=True, |
3407 | + string='CS', |
3408 | + type='char', |
3409 | + size=8, |
3410 | + readonly=True, |
3411 | + multi="m", |
3412 | + ), |
3413 | + 'lot_check': fields.function( |
3414 | + _get_checks_all, |
3415 | + method=True, |
3416 | + string='B.Num', |
3417 | + type='boolean', |
3418 | + readonly=True, |
3419 | + multi="m", |
3420 | + ), |
3421 | + 'exp_check': fields.function( |
3422 | + _get_checks_all, |
3423 | + method=True, |
3424 | + string='Exp', |
3425 | + type='boolean', |
3426 | + readonly=True, |
3427 | + multi="m", |
3428 | + ), |
3429 | + 'location_id': fields.related( |
3430 | + 'move_id', |
3431 | + 'location_id', |
3432 | + type='many2one', |
3433 | + relation='stock.location', |
3434 | + string='Source Location', |
3435 | + readonly=True, |
3436 | + ), |
3437 | + 'quantity_ordered': fields.float( |
3438 | + 'Quantity ordered', |
3439 | + ), |
3440 | + 'uom_ordered': fields.many2one( |
3441 | + 'product.uom', |
3442 | + string='UoM ordered', |
3443 | + readonly=True, |
3444 | + ), |
3445 | + 'uom_category': fields.related( |
3446 | + 'uom_ordered', |
3447 | + 'category_id', |
3448 | + type='many2one', |
3449 | + relation='product.uom.categ', |
3450 | + ), |
3451 | } |
3452 | |
3453 | stock_partial_move_memory_out() |
3454 | |
3455 | === modified file 'bin/addons/specific_rules/wizard/stock_partial_move_view.xml' |
3456 | --- bin/addons/specific_rules/wizard/stock_partial_move_view.xml 2013-04-26 13:41:39 +0000 |
3457 | +++ bin/addons/specific_rules/wizard/stock_partial_move_view.xml 2016-03-24 09:31:01 +0000 |
3458 | @@ -31,10 +31,10 @@ |
3459 | <field name="type_check" invisible="True" /> |
3460 | <field name="lot_check" /> |
3461 | <field name="exp_check" /> |
3462 | - <field name="kc_check" /> |
3463 | - <field name="ssl_check" invisible="True" /> |
3464 | - <field name="dg_check" /> |
3465 | - <field name="np_check" /> |
3466 | + <field name="kc_check" widget="null_boolean" /> |
3467 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3468 | + <field name="dg_check" widget="null_boolean" /> |
3469 | + <field name="np_check" widget="null_boolean" /> |
3470 | <field name="integrity_status" invisible="False" /> |
3471 | <field name="location_id" invisible="1" /> |
3472 | </field> |
3473 | @@ -68,10 +68,10 @@ |
3474 | <field name="type_check" invisible="True" /> |
3475 | <field name="lot_check" /> |
3476 | <field name="exp_check" /> |
3477 | - <field name="kc_check" /> |
3478 | - <field name="ssl_check" invisible="True" /> |
3479 | - <field name="dg_check" /> |
3480 | - <field name="np_check" /> |
3481 | + <field name="kc_check" widget="null_boolean" /> |
3482 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3483 | + <field name="dg_check" widget="null_boolean" /> |
3484 | + <field name="np_check" widget="null_boolean" /> |
3485 | <field name="integrity_status" invisible="False" /> |
3486 | <field name="location_id" invisible="1" /> |
3487 | </field> |
3488 | |
3489 | === modified file 'bin/addons/specific_rules/wizard/stock_partial_picking.py' |
3490 | --- bin/addons/specific_rules/wizard/stock_partial_picking.py 2014-02-24 15:41:57 +0000 |
3491 | +++ bin/addons/specific_rules/wizard/stock_partial_picking.py 2016-03-24 09:31:01 +0000 |
3492 | @@ -48,13 +48,13 @@ |
3493 | type = False |
3494 | contains_kc = False |
3495 | contains_dg = False |
3496 | - |
3497 | + |
3498 | for pick in pick_obj.browse(cr, uid, picking_ids, context=context): |
3499 | type = pick.type |
3500 | for m in pick.move_lines: |
3501 | - if m.product_id.heat_sensitive_item: |
3502 | + if m.product_id.is_kc: |
3503 | contains_kc = True |
3504 | - if m.product_id.dangerous_goods: |
3505 | + if m.product_id.is_dg: |
3506 | contains_dg = True |
3507 | |
3508 | if contains_kc and contains_dg: |
3509 | |
3510 | === modified file 'bin/addons/stock_forecast/wizard/stock_forecast.py' |
3511 | --- bin/addons/stock_forecast/wizard/stock_forecast.py 2015-02-05 16:24:37 +0000 |
3512 | +++ bin/addons/stock_forecast/wizard/stock_forecast.py 2016-03-24 09:31:01 +0000 |
3513 | @@ -130,10 +130,9 @@ |
3514 | values['product_family_info_id'] = wiz.product_id.nomen_manda_2.id |
3515 | values['procurement_method'] = wiz.product_id.procure_method |
3516 | values['supply_method'] = wiz.product_id.supply_method |
3517 | - if wiz.product_id.heat_sensitive_item: |
3518 | - values['keep_cool'] = True |
3519 | - values['short_shelf_life'] = wiz.product_id.short_shelf_life |
3520 | - values['dangerous_goods'] = wiz.product_id.dangerous_goods |
3521 | + values['keep_cool'] = wiz.product_id.is_kc |
3522 | + values['short_shelf_life'] = wiz.product_id.is_ssl |
3523 | + values['dangerous_goods'] = wiz.product_id.is_dg |
3524 | values['justification_code_id'] = wiz.product_id.justification_code_id.id |
3525 | return result |
3526 | |
3527 | |
3528 | === modified file 'bin/addons/stock_override/report/destruction_location.rml' |
3529 | --- bin/addons/stock_override/report/destruction_location.rml 2011-12-29 11:02:26 +0000 |
3530 | +++ bin/addons/stock_override/report/destruction_location.rml 2016-03-24 09:31:01 +0000 |
3531 | @@ -195,7 +195,7 @@ |
3532 | <para style="P8">DG</para> |
3533 | </td> |
3534 | <td> |
3535 | - <para style="P8">NP</para> |
3536 | + <para style="P8">CS</para> |
3537 | </td> |
3538 | <td> |
3539 | <para style="P8">Qty</para> |
3540 | |
3541 | === modified file 'bin/addons/stock_override/stock.py' |
3542 | --- bin/addons/stock_override/stock.py 2016-03-17 13:00:29 +0000 |
3543 | +++ bin/addons/stock_override/stock.py 2016-03-24 09:31:01 +0000 |
3544 | @@ -2159,13 +2159,6 @@ |
3545 | result = [] |
3546 | for move in self.browse(cr, uid, ids, context=context): |
3547 | # add this move into the list of result |
3548 | - dg_check_flag = '' |
3549 | - if move.dg_check: |
3550 | - dg_check_flag = 'x' |
3551 | - |
3552 | - np_check_flag = '' |
3553 | - if move.np_check: |
3554 | - np_check_flag = 'x' |
3555 | sub_total = move.product_qty * move.product_id.standard_price |
3556 | |
3557 | currency = '' |
3558 | @@ -2183,8 +2176,8 @@ |
3559 | 'origin': move.origin, |
3560 | 'expired_date': move.expired_date, |
3561 | 'prodlot_id': move.prodlot_id.name, |
3562 | - 'dg_check': dg_check_flag, |
3563 | - 'np_check': np_check_flag, |
3564 | + 'dg_check': move.product_id and move.product_id.dg_txt or '', |
3565 | + 'np_check': move.product_id and move.product_id.cs_txt or '', |
3566 | 'uom': move.product_uom.name, |
3567 | 'prod_qty': move.product_qty, |
3568 | }) |
3569 | |
3570 | === modified file 'bin/addons/stock_override/stock_view.xml' |
3571 | --- bin/addons/stock_override/stock_view.xml 2016-03-10 11:12:16 +0000 |
3572 | +++ bin/addons/stock_override/stock_view.xml 2016-03-24 09:31:01 +0000 |
3573 | @@ -358,10 +358,10 @@ |
3574 | <button name="action_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/> |
3575 | <field name="lot_check"/> |
3576 | <field name="exp_check"/> |
3577 | - <field name="kc_check"/> |
3578 | - <field name="ssl_check" invisible="True"/> |
3579 | - <field name="dg_check"/> |
3580 | - <field name="np_check"/> |
3581 | + <field name="kc_check" widget="null_boolean" /> |
3582 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3583 | + <field name="dg_check" widget="null_boolean" /> |
3584 | + <field name="np_check" widget="null_boolean" /> |
3585 | <field name="expired_lot" invisible="1" /> |
3586 | <field name="inactive_product" invisible="1" /> |
3587 | <field name="to_correct_ok" invisible="1" /> |
3588 | @@ -436,10 +436,10 @@ |
3589 | <group colspan="4" col="10"> |
3590 | <field name="lot_check" /> |
3591 | <field name="exp_check" /> |
3592 | - <field name="kc_check" /> |
3593 | - <field name="ssl_check" invisible="True" /> |
3594 | - <field name="dg_check" /> |
3595 | - <field name="np_check" /> |
3596 | + <field name="kc_check" widget="null_boolean" /> |
3597 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3598 | + <field name="dg_check" widget="null_boolean" /> |
3599 | + <field name="np_check" widget="null_boolean" /> |
3600 | </group> |
3601 | <field name="reason_type_id" widget="selection" |
3602 | domain="[('internal_ok', '=', True)]" |
3603 | @@ -609,10 +609,10 @@ |
3604 | <button name="in_action_confirm" states="draft,confirmed" string="Confirm" type="object" icon="gtk-apply"/> |
3605 | <field name="lot_check"/> |
3606 | <field name="exp_check"/> |
3607 | - <field name="kc_check"/> |
3608 | - <field name="ssl_check" invisible="True"/> |
3609 | - <field name="dg_check"/> |
3610 | - <field name="np_check"/> |
3611 | + <field name="kc_check" widget="null_boolean" /> |
3612 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3613 | + <field name="dg_check" widget="null_boolean" /> |
3614 | + <field name="np_check" widget="null_boolean" /> |
3615 | <field name="to_correct_ok" invisible="1" /> |
3616 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
3617 | <field name="price_changed" invisible="1" /> |
3618 | @@ -676,10 +676,10 @@ |
3619 | <group colspan="4" col="10"> |
3620 | <field name="lot_check"/> |
3621 | <field name="exp_check"/> |
3622 | - <field name="kc_check"/> |
3623 | - <field name="ssl_check" invisible="True"/> |
3624 | - <field name="dg_check"/> |
3625 | - <field name="np_check"/> |
3626 | + <field name="kc_check" widget="null_boolean" /> |
3627 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3628 | + <field name="dg_check" widget="null_boolean" /> |
3629 | + <field name="np_check" widget="null_boolean" /> |
3630 | </group> |
3631 | <field name="reason_type_id" widget="selection" attrs="{'readonly': [('state', 'not in', ('draft', 'confirmed', 'assigned'))]}" |
3632 | domain="[('incoming_ok', '=', True)]" /> |
3633 | @@ -902,10 +902,10 @@ |
3634 | <button name="action_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/> |
3635 | <field name="lot_check"/> |
3636 | <field name="exp_check"/> |
3637 | - <field name="kc_check"/> |
3638 | - <field name="ssl_check" invisible="True"/> |
3639 | - <field name="dg_check"/> |
3640 | - <field name="np_check"/> |
3641 | + <field name="kc_check" widget="null_boolean" /> |
3642 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3643 | + <field name="dg_check" widget="null_boolean" /> |
3644 | + <field name="np_check" widget="null_boolean" /> |
3645 | <field name="inactive_product" invisible="1" /> |
3646 | <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" /> |
3647 | <button name="%(stock.action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward" invisible="1"/> |
3648 | @@ -967,10 +967,10 @@ |
3649 | <group colspan="4" col="10"> |
3650 | <field name="lot_check"/> |
3651 | <field name="exp_check"/> |
3652 | - <field name="kc_check"/> |
3653 | - <field name="ssl_check" invisible="True"/> |
3654 | - <field name="dg_check"/> |
3655 | - <field name="np_check"/> |
3656 | + <field name="kc_check" widget="null_boolean" /> |
3657 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3658 | + <field name="dg_check" widget="null_boolean" /> |
3659 | + <field name="np_check" widget="null_boolean" /> |
3660 | </group> |
3661 | <field name="reason_type_id" widget="selection" |
3662 | domain="[('outgoing_ok', '=', True)]" |
3663 | @@ -1095,10 +1095,10 @@ |
3664 | <field name="type_check" invisible="True" /> |
3665 | <field name="lot_check" /> |
3666 | <field name="exp_check" /> |
3667 | - <field name="kc_check" /> |
3668 | - <field name="ssl_check" invisible="True" /> |
3669 | - <field name="dg_check" /> |
3670 | - <field name="np_check" /> |
3671 | + <field name="kc_check" widget="null_boolean" /> |
3672 | + <field name="ssl_check" invisible="True" widget="null_boolean" /> |
3673 | + <field name="dg_check" widget="null_boolean" /> |
3674 | + <field name="np_check" widget="null_boolean" /> |
3675 | <field name="comment" /> |
3676 | <button name="btn_dl" type="object" string="Line is duplicated" icon="gtk-dialog-warning" attrs="{'invisible': [('duplicate_line', '=', False)]}" /> |
3677 | <field name="duplicate_line" invisible="True" /> |
3678 | |
3679 | === modified file 'bin/addons/sync_client/update.py' |
3680 | --- bin/addons/sync_client/update.py 2016-03-14 08:32:31 +0000 |
3681 | +++ bin/addons/sync_client/update.py 2016-03-24 09:31:01 +0000 |
3682 | @@ -518,7 +518,7 @@ |
3683 | try: |
3684 | res = secure_import_data(obj, import_fields, values) |
3685 | except Exception, import_error: |
3686 | - import_error = "Error during importation in model %s!\nUpdate ids: %s\nReason: %s\nData imported:\n%s\n" % (obj._name, update_ids, str(import_error), "\n".join([str(v) for v in values])) |
3687 | + import_error = "Error during importation in model %s!\nUpdate ids: %s\nReason: %s\nData imported:\n%s\n" % (obj._name, update_ids, tools.ustr(import_error), "\n".join([tools.ustr(v) for v in values])) |
3688 | # Rare Exception: import_data raised an Exception |
3689 | self.write(cr, uid, update_ids, { |
3690 | 'execution_date': datetime.now(), |
3691 | |
3692 | === modified file 'bin/addons/sync_so/sale.py' |
3693 | --- bin/addons/sync_so/sale.py 2016-03-03 11:05:04 +0000 |
3694 | +++ bin/addons/sync_so/sale.py 2016-03-24 09:31:01 +0000 |
3695 | @@ -382,6 +382,7 @@ |
3696 | |
3697 | if original_id: |
3698 | orig_partner_name = self.browse(cr, uid, original_id, context=context).partner_id.name |
3699 | +<<<<<<< TREE |
3700 | |
3701 | # Generate messages for cancel lines |
3702 | available_solc_ids = solc_obj.search(cr, uid, eval(solccl_rule.domain), |
3703 | @@ -398,6 +399,13 @@ |
3704 | order='NO_ORDER', context=context) |
3705 | if nfo_model_obj and nfo_rule and original_id in available_nfo_ids: |
3706 | generate_msg_to_send(nfo_rule, nfo_model_obj, original_id, orig_partner_name) |
3707 | +======= |
3708 | + if nfo_model_obj and nfo_rule: |
3709 | + available_nfo_ids = self.search(cr, uid, eval(nfo_rule.domain), |
3710 | + order='NO_ORDER', context=context) |
3711 | + if original_id in available_nfo_ids: |
3712 | + generate_msg_to_send(nfo_rule, nfo_model_obj, original_id, orig_partner_name) |
3713 | +>>>>>>> MERGE-SOURCE |
3714 | if vfo_model_obj and vfo_rule: |
3715 | generate_msg_to_send(vfo_rule, vfo_model_obj, original_id, orig_partner_name) |
3716 | |
3717 | |
3718 | === modified file 'bin/osv/orm.py' |
3719 | --- bin/osv/orm.py 2016-02-24 10:21:02 +0000 |
3720 | +++ bin/osv/orm.py 2016-03-24 09:31:01 +0000 |
3721 | @@ -783,7 +783,7 @@ |
3722 | ir_model_data_obj = self.pool.get('ir.model.data') |
3723 | |
3724 | # mode: id (XML id) or .id (database id) or False for name_get |
3725 | - def _get_id(model_name, id, current_module=False, mode='id'): |
3726 | + def _get_id(model_name, id, current_module=False, mode='id', context=None): |
3727 | if mode=='.id': |
3728 | id = int(id) |
3729 | obj_model = self.pool.get(model_name) |
3730 | @@ -803,7 +803,7 @@ |
3731 | id = ir_model_data[0]['res_id'] |
3732 | else: |
3733 | obj_model = self.pool.get(model_name) |
3734 | - ids = obj_model.name_search(cr, uid, id, operator='=') |
3735 | + ids = obj_model.name_search(cr, uid, id, operator='=', context=context) |
3736 | if not ids: |
3737 | raise ValueError('No record found for %s' % (id,)) |
3738 | id = ids[0][0] |
3739 | @@ -888,7 +888,7 @@ |
3740 | mode = False |
3741 | else: |
3742 | mode = field[len(prefix)+1] |
3743 | - res = value and _get_id(relation, value, current_module, mode) |
3744 | + res = value and _get_id(relation, value, current_module, mode, context=context) |
3745 | |
3746 | elif field_type=='many2many': |
3747 | relation = fields_def[field[len(prefix)]]['relation'] |
3748 | @@ -901,7 +901,7 @@ |
3749 | res = [] |
3750 | if value: |
3751 | for db_id in value.split(config.get('csv_internal_sep')) or []: |
3752 | - res.append( _get_id(relation, db_id, current_module, mode) ) |
3753 | + res.append( _get_id(relation, db_id, current_module, mode, context=context) ) |
3754 | res = [(6,0,res)] |
3755 | |
3756 | elif field_type == 'integer': |
3757 | @@ -912,7 +912,8 @@ |
3758 | res = value and float(value.replace(',','.')) or 0.0 |
3759 | elif field_type == 'selection': |
3760 | for key, val in fields_def[field[len(prefix)]]['selection']: |
3761 | - if value in [tools.ustr(key), tools.ustr(val)]: |
3762 | + if value in [tools.ustr(key), tools.ustr(val)] or \ |
3763 | + tools.ustr(value) in [tools.ustr(key), tools.ustr(val)]: |
3764 | res = key |
3765 | break |
3766 | if not value: |
3767 | @@ -939,7 +940,7 @@ |
3768 | (module, model, ref_xml_id) = (field_value[0], field_value[1], field_value[2]) |
3769 | ir_model_data_obj = self.pool.get('ir.model.data') |
3770 | try: |
3771 | - ir_model_data_id = ir_model_data_obj._get_id(cr, 1, module, ref_xml_id) |
3772 | + ir_model_data_id = ir_model_data_obj._get_id(cr, 1, module, ref_xml_id, context=context) |
3773 | ref_db_id = ir_model_data_obj.browse(cr, uid, ir_model_data_id).res_id |
3774 | except: |
3775 | ref_db_id = None |
3776 | @@ -2663,6 +2664,18 @@ |
3777 | self.__schema.debug("Table '%s': column '%s': dropped NOT NULL constraint", |
3778 | self._table, column['attname']) |
3779 | |
3780 | + def execute_migration(self, cr, moved_column, new_column): |
3781 | + """ |
3782 | + On change type of column, make a migration of data. The old values |
3783 | + are moved to a new column suffixed by _movedX. |
3784 | + This method must be overriden on needed objects. |
3785 | + :param cr: Cursor to the database |
3786 | + :param moved_column: The renamed old column |
3787 | + :param new_column: The column with the new type |
3788 | + :return: Nothing |
3789 | + """ |
3790 | + pass |
3791 | + |
3792 | def _auto_init(self, cr, context=None): |
3793 | if context is None: |
3794 | context = {} |
3795 | @@ -2670,6 +2683,7 @@ |
3796 | create = False |
3797 | todo_end = [] |
3798 | self._field_create(cr, context=context) |
3799 | + to_migrate = [] |
3800 | if getattr(self, '_auto', True): |
3801 | cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) |
3802 | if not cr.rowcount: |
3803 | @@ -2867,6 +2881,7 @@ |
3804 | cr.execute("COMMENT ON COLUMN %s.%s IS '%s'" % (self._table, k, f.string.replace("'", "''"))) |
3805 | self.__schema.debug("Table '%s': column '%s' has changed type (DB=%s, def=%s), data moved to column %s !", |
3806 | self._table, k, f_pg_type, f._type, newname) |
3807 | + to_migrate.append((newname, k)) |
3808 | |
3809 | # if the field is required and hasn't got a NOT NULL constraint |
3810 | if f.required and f_pg_notnull == 0: |
3811 | @@ -3007,6 +3022,9 @@ |
3812 | else: |
3813 | cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (self._table,)) |
3814 | create = not bool(cr.fetchone()) |
3815 | + |
3816 | + for t in to_migrate: |
3817 | + self.execute_migration(cr, t[0], t[1]) |
3818 | |
3819 | cr.commit() # start a new transaction |
3820 |