Merge lp:~unifield-team/unifield-wm/pilot-27-supply-bugs into lp:unifield-wm
- pilot-27-supply-bugs
- Merge into trunk
Proposed by
jftempo
Status: | Needs review |
---|---|
Proposed branch: | lp:~unifield-team/unifield-wm/pilot-27-supply-bugs |
Merge into: | lp:unifield-wm |
Diff against target: |
258 lines (+70/-19) 8 files modified
consumption_calculation/history_consumption.py (+2/-1) kit/kit_creation.py (+44/-6) kit/kit_creation_view.xml (+4/-2) msf_doc_import/initial_stock_inventory.py (+1/-1) msf_outgoing/msf_outgoing.py (+7/-3) msf_supply_doc_export/msf_supply_doc_export.py (+4/-4) specific_rules/specific_rules_view.xml (+1/-1) stock_override/report/report_stock_move.py (+7/-1) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-wm/pilot-27-supply-bugs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email: mp+196101@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 1859. By Quentin THEURET @Amaris
-
UF-2207 [FIX] Picking Ticket : Display the good actions report
- 1858. By Quentin THEURET @Amaris
-
UF-2207 [MERGE] Merge UF-2207 branch
lp:~unifield-team/unifield-wm/uf-2207 - 1857. By Quentin THEURET @Amaris
-
UF-2210 [MERGE] Merge UF-2210 branch
lp:~unifield-team/unifield-wm/uf-2210 - 1856. By Quentin THEURET @Amaris
-
UF-2209 [MERGE] Merge UF-2209 branch
lp:~unifield-team/unifield-wm/uf-2209 - 1855. By Quentin THEURET @Amaris
-
UF-2206 [MERGE] Merge UF-2206 branch
lp:~unifield-team/unifield-wm/uf-2206 - 1854. By Quentin THEURET @Amaris
-
UF-2204 [MERGE] Merge UF-2204 branch
lp:~unifield-team/unifield-wm/uf-2204 - 1853. By Quentin THEURET @Amaris
-
UF-2191 [MERGE] Merge UF-2191 branch
lp:~unifield-team/unifield-wm/uf-2191
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'consumption_calculation/history_consumption.py' | |||
2 | --- consumption_calculation/history_consumption.py 2013-11-05 15:44:32 +0000 | |||
3 | +++ consumption_calculation/history_consumption.py 2013-11-21 13:07:07 +0000 | |||
4 | @@ -66,7 +66,7 @@ | |||
5 | 66 | _defaults = { | 66 | _defaults = { |
6 | 67 | 'date_to': lambda *a: (DateFrom(time.strftime('%Y-%m-%d')) + RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'), | 67 | 'date_to': lambda *a: (DateFrom(time.strftime('%Y-%m-%d')) + RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'), |
7 | 68 | 'requestor_id': lambda obj, cr, uid, c: uid, | 68 | 'requestor_id': lambda obj, cr, uid, c: uid, |
9 | 69 | 'requestor_date': time.strftime('%Y-%m-%d %H:%M:%S'), | 69 | 'requestor_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
10 | 70 | 'status': 'draft', | 70 | 'status': 'draft', |
11 | 71 | } | 71 | } |
12 | 72 | 72 | ||
13 | @@ -222,6 +222,7 @@ | |||
14 | 222 | 222 | ||
15 | 223 | import threading | 223 | import threading |
16 | 224 | self.write(cr, uid, ids, {'status': 'in_progress'}, context=context) | 224 | self.write(cr, uid, ids, {'status': 'in_progress'}, context=context) |
17 | 225 | cr.commit() | ||
18 | 225 | new_thread = threading.Thread(target=self._create_lines, args=(cr, uid, ids, product_ids, new_context)) | 226 | new_thread = threading.Thread(target=self._create_lines, args=(cr, uid, ids, product_ids, new_context)) |
19 | 226 | new_thread.start() | 227 | new_thread.start() |
20 | 227 | new_thread.join(10.0) | 228 | new_thread.join(10.0) |
21 | 228 | 229 | ||
22 | === modified file 'kit/kit_creation.py' | |||
23 | --- kit/kit_creation.py 2013-10-07 14:53:32 +0000 | |||
24 | +++ kit/kit_creation.py 2013-11-21 13:07:07 +0000 | |||
25 | @@ -473,10 +473,11 @@ | |||
26 | 473 | data = {} | 473 | data = {} |
27 | 474 | # moves consolidated | 474 | # moves consolidated |
28 | 475 | move_list = [] | 475 | move_list = [] |
29 | 476 | move_manual = [] | ||
30 | 476 | 477 | ||
31 | 477 | for move in obj.consumed_ids_kit_creation: | 478 | for move in obj.consumed_ids_kit_creation: |
32 | 478 | # the stock move should not be canceled, but... we recycle them in case. | 479 | # the stock move should not be canceled, but... we recycle them in case. |
34 | 479 | if move.state in ['confirmed', 'cancel']: | 480 | if move.state in ['confirmed', 'cancel'] and not move.kol_lot_manual: |
35 | 480 | move_list.append(move.id) | 481 | move_list.append(move.id) |
36 | 481 | # consolidate the moves qty | 482 | # consolidate the moves qty |
37 | 482 | qty = data.setdefault(move.product_id.id, {}).setdefault('uoms', {}).setdefault(move.product_uom.id, {}).setdefault('qty', 0.0) | 483 | qty = data.setdefault(move.product_id.id, {}).setdefault('uoms', {}).setdefault(move.product_uom.id, {}).setdefault('qty', 0.0) |
38 | @@ -489,8 +490,10 @@ | |||
39 | 489 | data.setdefault(move.product_id.id, {}).setdefault('uoms', {})[move.product_uom.id]['qty'] = qty | 490 | data.setdefault(move.product_id.id, {}).setdefault('uoms', {})[move.product_uom.id]['qty'] = qty |
40 | 490 | # save object for efficiency | 491 | # save object for efficiency |
41 | 491 | data.setdefault(move.product_id.id, {}).setdefault('object', move.product_id) | 492 | data.setdefault(move.product_id.id, {}).setdefault('object', move.product_id) |
42 | 493 | elif move.kol_lot_manual: | ||
43 | 494 | move_manual.append(move.id) | ||
44 | 492 | 495 | ||
46 | 493 | return data, move_list | 496 | return data, move_list, move_manual |
47 | 494 | 497 | ||
48 | 495 | def consolidate_lines(self, cr, uid, ids, context=None): | 498 | def consolidate_lines(self, cr, uid, ids, context=None): |
49 | 496 | ''' | 499 | ''' |
50 | @@ -510,7 +513,7 @@ | |||
51 | 510 | 513 | ||
52 | 511 | for obj in self.browse(cr, uid, ids, context=context): | 514 | for obj in self.browse(cr, uid, ids, context=context): |
53 | 512 | # consolidate data | 515 | # consolidate data |
55 | 513 | data, move_list = self._consolidate_data(cr, uid, obj.id, context=context) | 516 | data, move_list, move_manual = self._consolidate_data(cr, uid, obj.id, context=context) |
56 | 514 | # delete stock moves | 517 | # delete stock moves |
57 | 515 | move_obj.unlink(cr, uid, move_list, context=dict(context, call_unlink=True)) | 518 | move_obj.unlink(cr, uid, move_list, context=dict(context, call_unlink=True)) |
58 | 516 | # default location | 519 | # default location |
59 | @@ -561,16 +564,41 @@ | |||
60 | 561 | loc_obj = self.pool.get('stock.location') | 564 | loc_obj = self.pool.get('stock.location') |
61 | 562 | prodlot_obj = self.pool.get('stock.production.lot') | 565 | prodlot_obj = self.pool.get('stock.production.lot') |
62 | 563 | data_tools_obj = self.pool.get('data.tools') | 566 | data_tools_obj = self.pool.get('data.tools') |
63 | 567 | uom_obj = self.pool.get('product.uom') | ||
64 | 564 | # load data into the context | 568 | # load data into the context |
65 | 565 | data_tools_obj.load_common_data(cr, uid, ids, context=context) | 569 | data_tools_obj.load_common_data(cr, uid, ids, context=context) |
66 | 566 | 570 | ||
67 | 567 | for obj in self.browse(cr, uid, ids, context=context): | 571 | for obj in self.browse(cr, uid, ids, context=context): |
68 | 568 | # consolidate data | 572 | # consolidate data |
70 | 569 | data, move_list = self._consolidate_data(cr, uid, obj.id, context=context) | 573 | data, move_list, move_manual = self._consolidate_data(cr, uid, obj.id, context=context) |
71 | 574 | # default location | ||
72 | 575 | default_location_id = obj.default_location_src_id_kit_creation.id | ||
73 | 576 | |||
74 | 577 | # Check availability of manual moves | ||
75 | 578 | for move in move_obj.browse(cr, uid, move_manual, context=context): | ||
76 | 579 | if move.state != 'confirmed' or not move.prodlot_id: | ||
77 | 580 | continue | ||
78 | 581 | |||
79 | 582 | location_ids = loc_obj.search(cr, uid, [('location_id', 'child_of', move.location_id.id)], context=context) | ||
80 | 583 | needed_qty = move.product_qty | ||
81 | 584 | for loc in location_ids: | ||
82 | 585 | available_qty = prodlot_obj.browse(cr, uid, move.prodlot_id.id, context=dict(context, location_id=loc)).stock_virtual | ||
83 | 586 | diff_qty = available_qty - uom_obj._compute_qty(cr, uid, move.product_uom.id, needed_qty, move.product_id.uom_id.id) | ||
84 | 587 | if diff_qty >= 0: | ||
85 | 588 | move_obj.write(cr, uid, [move.id], {'state': 'assigned'}, context=context) | ||
86 | 589 | break | ||
87 | 590 | else: | ||
88 | 591 | if available_qty: | ||
89 | 592 | move_obj.copy(cr, uid, move.id, {'product_qty': available_qty, 'state': 'assigned'}, context=context) | ||
90 | 593 | needed_qty -= available_qty | ||
91 | 594 | move_obj.write(cr, uid, [move.id], {'product_qty': needed_qty}, context=context) | ||
92 | 595 | else: | ||
93 | 596 | move_obj.write(cr, uid, [move.id], {'prodlot_id': False, 'kol_lot_manual': False}, context=context) | ||
94 | 597 | |||
95 | 598 | data, move_list, move_manual = self._consolidate_data(cr, uid, obj.id, context=context) | ||
96 | 570 | # delete stock moves | 599 | # delete stock moves |
97 | 571 | move_obj.unlink(cr, uid, move_list, context=dict(context, call_unlink=True)) | 600 | move_obj.unlink(cr, uid, move_list, context=dict(context, call_unlink=True)) |
100 | 572 | # default location | 601 | |
99 | 573 | default_location_id = obj.default_location_src_id_kit_creation.id | ||
101 | 574 | # create consolidated stock moves | 602 | # create consolidated stock moves |
102 | 575 | for product_id in data.keys(): | 603 | for product_id in data.keys(): |
103 | 576 | for uom_id in data[product_id]['uoms'].keys(): | 604 | for uom_id in data[product_id]['uoms'].keys(): |
104 | @@ -1250,6 +1278,7 @@ | |||
105 | 1250 | 'hidden_creation_state': fields.function(_vals_get_kit_creation, method=True, type='selection', selection=KIT_CREATION_STATE, string='Hidden Creation State', multi='get_vals_kit_creation', store=False, readonly=True), | 1278 | 'hidden_creation_state': fields.function(_vals_get_kit_creation, method=True, type='selection', selection=KIT_CREATION_STATE, string='Hidden Creation State', multi='get_vals_kit_creation', store=False, readonly=True), |
106 | 1251 | 'assigned_qty_stock_move': fields.function(_vals_get_kit_creation, method=True, type='float', string='Assigned Qty', multi='get_vals_kit_creation', store=False, readonly=True), | 1279 | 'assigned_qty_stock_move': fields.function(_vals_get_kit_creation, method=True, type='float', string='Assigned Qty', multi='get_vals_kit_creation', store=False, readonly=True), |
107 | 1252 | 'hidden_creation_qty_stock_move': fields.function(_vals_get_kit_creation, method=True, type='integer', string='Hidden Creation Qty', multi='get_vals_kit_creation', store=False, readonly=True), | 1280 | 'hidden_creation_qty_stock_move': fields.function(_vals_get_kit_creation, method=True, type='integer', string='Hidden Creation Qty', multi='get_vals_kit_creation', store=False, readonly=True), |
108 | 1281 | 'kol_lot_manual': fields.boolean(string='The batch is set manually'), | ||
109 | 1253 | } | 1282 | } |
110 | 1254 | 1283 | ||
111 | 1255 | _defaults = {'to_consume_id_stock_move': False, | 1284 | _defaults = {'to_consume_id_stock_move': False, |
112 | @@ -1273,6 +1302,15 @@ | |||
113 | 1273 | # open the selected wizard | 1302 | # open the selected wizard |
114 | 1274 | res = wiz_obj.open_wizard(cr, uid, ids, name=name, model=model, step=step, context=dict(context)) | 1303 | res = wiz_obj.open_wizard(cr, uid, ids, name=name, model=model, step=step, context=dict(context)) |
115 | 1275 | return res | 1304 | return res |
116 | 1305 | |||
117 | 1306 | def kol_prodlot_change(self, cr, uid, ids, prodlot_id, context=None): | ||
118 | 1307 | ''' | ||
119 | 1308 | Set a new attribute on stock move if the prodolt is change manually in the Kit order creation | ||
120 | 1309 | ''' | ||
121 | 1310 | if prodlot_id: | ||
122 | 1311 | return {'value': {'kol_lot_manual': True}} | ||
123 | 1312 | |||
124 | 1313 | return {'value': {'kol_lot_manual': False}} | ||
125 | 1276 | 1314 | ||
126 | 1277 | def automatic_assignment(self, cr, uid, ids, context=None): | 1315 | def automatic_assignment(self, cr, uid, ids, context=None): |
127 | 1278 | ''' | 1316 | ''' |
128 | 1279 | 1317 | ||
129 | === modified file 'kit/kit_creation_view.xml' | |||
130 | --- kit/kit_creation_view.xml 2013-10-07 14:53:32 +0000 | |||
131 | +++ kit/kit_creation_view.xml 2013-11-21 13:07:07 +0000 | |||
132 | @@ -77,7 +77,8 @@ | |||
133 | 77 | attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_asset_check', '=', False)]}" /> | 77 | attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_asset_check', '=', False)]}" /> |
134 | 78 | <field name="prodlot_id" | 78 | <field name="prodlot_id" |
135 | 79 | context="{'location_id':location_id, 'product_id':product_id, 'hidden_perishable_mandatory': hidden_perishable_mandatory, | 79 | context="{'location_id':location_id, 'product_id':product_id, 'hidden_perishable_mandatory': hidden_perishable_mandatory, |
137 | 80 | 'search_default_real': True}" | 80 | 'search_default_real': True}" |
138 | 81 | on_change="kol_prodlot_change(prodlot_id)" | ||
139 | 81 | domain="[('product_id', '=', product_id),('check_type','=', True)]" | 82 | domain="[('product_id', '=', product_id),('check_type','=', True)]" |
140 | 82 | attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_exp_check', '=', False)], | 83 | attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_exp_check', '=', False)], |
141 | 83 | 'required': [('hidden_exp_check', '=', True)]}" /> | 84 | 'required': [('hidden_exp_check', '=', True)]}" /> |
142 | @@ -88,7 +89,8 @@ | |||
143 | 88 | domain="[('usage', '=', 'internal')]" /> | 89 | domain="[('usage', '=', 'internal')]" /> |
144 | 89 | <field name="state" /> | 90 | <field name="state" /> |
145 | 90 | <field name="lot_check" /> | 91 | <field name="lot_check" /> |
147 | 91 | <field name="exp_check" /> | 92 | <field name="exp_check" /> |
148 | 93 | <field name="kol_lot_manual" invisible="True" /> | ||
149 | 92 | <field name="hidden_perishable_mandatory" invisible="True" /> | 94 | <field name="hidden_perishable_mandatory" invisible="True" /> |
150 | 93 | <field name="hidden_exp_check" invisible="True" /> | 95 | <field name="hidden_exp_check" invisible="True" /> |
151 | 94 | <field name="hidden_state" invisible="True" /> | 96 | <field name="hidden_state" invisible="True" /> |
152 | 95 | 97 | ||
153 | === modified file 'msf_doc_import/initial_stock_inventory.py' | |||
154 | --- msf_doc_import/initial_stock_inventory.py 2013-10-04 14:01:53 +0000 | |||
155 | +++ msf_doc_import/initial_stock_inventory.py 2013-11-21 13:07:07 +0000 | |||
156 | @@ -250,7 +250,7 @@ | |||
157 | 250 | product = product_obj.browse(cr, uid, product_id) | 250 | product = product_obj.browse(cr, uid, product_id) |
158 | 251 | product_uom = product.uom_id.id | 251 | product_uom = product.uom_id.id |
159 | 252 | hidden_batch_management_mandatory = product.batch_management | 252 | hidden_batch_management_mandatory = product.batch_management |
161 | 253 | hidden_perishable_mandatory = product.perishable | 253 | hidden_perishable_mandatory = product.perishable and not product.batch_management |
162 | 254 | if hidden_batch_management_mandatory and not batch: | 254 | if hidden_batch_management_mandatory and not batch: |
163 | 255 | comment += _('Batch is missing.\n') | 255 | comment += _('Batch is missing.\n') |
164 | 256 | if hidden_perishable_mandatory and not expiry: | 256 | if hidden_perishable_mandatory and not expiry: |
165 | 257 | 257 | ||
166 | === modified file 'msf_outgoing/msf_outgoing.py' | |||
167 | --- msf_outgoing/msf_outgoing.py 2013-11-07 17:06:54 +0000 | |||
168 | +++ msf_outgoing/msf_outgoing.py 2013-11-21 13:07:07 +0000 | |||
169 | @@ -497,7 +497,8 @@ | |||
170 | 497 | self.log(cr, uid, draft_shipment_id, _("Packs from the draft Shipment (%s) have been returned to stock.")%(draft_shipment_name,)) | 497 | self.log(cr, uid, draft_shipment_id, _("Packs from the draft Shipment (%s) have been returned to stock.")%(draft_shipment_name,)) |
171 | 498 | log_flag = True | 498 | log_flag = True |
172 | 499 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] | 499 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
174 | 500 | self.pool.get('stock.picking').log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(draft_picking.name,), context={'view_id': res,}) | 500 | context.update({'view_id': res, 'picking_type': 'picking.ticket'}) |
175 | 501 | self.pool.get('stock.picking').log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(draft_picking.name,), context=context) | ||
176 | 501 | 502 | ||
177 | 502 | # call complete_finished on the shipment object | 503 | # call complete_finished on the shipment object |
178 | 503 | # if everything is alright (all draft packing are finished) the shipment is done also | 504 | # if everything is alright (all draft packing are finished) the shipment is done also |
179 | @@ -517,6 +518,7 @@ | |||
180 | 517 | 'res_id': draft_picking_id , | 518 | 'res_id': draft_picking_id , |
181 | 518 | 'type': 'ir.actions.act_window', | 519 | 'type': 'ir.actions.act_window', |
182 | 519 | 'target': 'crush', | 520 | 'target': 'crush', |
183 | 521 | 'context': context | ||
184 | 520 | } | 522 | } |
185 | 521 | 523 | ||
186 | 522 | def return_packs_from_shipment(self, cr, uid, ids, context=None): | 524 | def return_packs_from_shipment(self, cr, uid, ids, context=None): |
187 | @@ -2849,7 +2851,8 @@ | |||
188 | 2849 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_ppl_form')[1] | 2851 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_ppl_form')[1] |
189 | 2850 | self.log(cr, uid, picking.id, _("Products from Pre-Packing List (%s) have been returned to stock.")%(picking.name,), context={'view_id': res,}) | 2852 | self.log(cr, uid, picking.id, _("Products from Pre-Packing List (%s) have been returned to stock.")%(picking.name,), context={'view_id': res,}) |
190 | 2851 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] | 2853 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
192 | 2852 | self.log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(picking.previous_step_id.backorder_id.name,), context={'view_id': res,}) | 2854 | context.update({'view_id': res, 'picking_type': 'picking_ticket'}) |
193 | 2855 | self.log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(picking.previous_step_id.backorder_id.name,), context=context) | ||
194 | 2853 | # if all moves are done or canceled, the ppl is canceled | 2856 | # if all moves are done or canceled, the ppl is canceled |
195 | 2854 | cancel_ppl = True | 2857 | cancel_ppl = True |
196 | 2855 | for move in picking.move_lines: | 2858 | for move in picking.move_lines: |
197 | @@ -2935,7 +2938,8 @@ | |||
198 | 2935 | # TODO refactoring needed | 2938 | # TODO refactoring needed |
199 | 2936 | obj_data = self.pool.get('ir.model.data') | 2939 | obj_data = self.pool.get('ir.model.data') |
200 | 2937 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] | 2940 | res = obj_data.get_object_reference(cr, uid, 'msf_outgoing', 'view_picking_ticket_form')[1] |
202 | 2938 | self.log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(picking.backorder_id.name,), context={'view_id': res,}) | 2941 | context.update({'view_id': res, 'picking_type': 'picking_ticket'}) |
203 | 2942 | self.log(cr, uid, draft_picking_id, _("The corresponding Draft Picking Ticket (%s) has been updated.")%(picking.backorder_id.name,), context=context) | ||
204 | 2939 | 2943 | ||
205 | 2940 | if picking.subtype == 'packing': | 2944 | if picking.subtype == 'packing': |
206 | 2941 | # for each packing we get the draft packing | 2945 | # for each packing we get the draft packing |
207 | 2942 | 2946 | ||
208 | === modified file 'msf_supply_doc_export/msf_supply_doc_export.py' | |||
209 | --- msf_supply_doc_export/msf_supply_doc_export.py 2013-10-30 16:03:55 +0000 | |||
210 | +++ msf_supply_doc_export/msf_supply_doc_export.py 2013-11-21 13:07:07 +0000 | |||
211 | @@ -299,11 +299,11 @@ | |||
212 | 299 | Delivery_Order = trans_obj.tr_view(cr, 'Delivery Order', context) | 299 | Delivery_Order = trans_obj.tr_view(cr, 'Delivery Order', context) |
213 | 300 | Internal_Moves = trans_obj.tr_view(cr, 'Internal Moves', context) | 300 | Internal_Moves = trans_obj.tr_view(cr, 'Internal Moves', context) |
214 | 301 | for v in values: | 301 | for v in values: |
218 | 302 | if '_terp_view_name' in context and v[2]['report_name'] == 'picking.ticket' and context['_terp_view_name'] in (Picking_Tickets, Picking_Ticket) and context.get('picking_screen', False)\ | 302 | if v[2]['report_name'] == 'picking.ticket' and (context.get('_terp_view_name') in (Picking_Tickets, Picking_Ticket) or context.get('picking_type') == 'picking_ticket') and context.get('picking_screen', False)\ |
219 | 303 | or '_terp_view_name' in context and v[2]['report_name'] == 'pre.packing.list' and context['_terp_view_name'] in (Pre_Packing_Lists, Pre_Packing_List) and context.get('ppl_screen', False)\ | 303 | or v[2]['report_name'] == 'pre.packing.list' and context.get('_terp_view_name') in (Pre_Packing_Lists, Pre_Packing_List) and context.get('ppl_screen', False)\ |
220 | 304 | or '_terp_view_name' in context and v[2]['report_name'] == 'labels' and context['_terp_view_name'] in [Picking_Ticket, Picking_Tickets, Pre_Packing_List, Pre_Packing_Lists, Delivery_Orders, Delivery_Order]\ | 304 | or v[2]['report_name'] == 'labels' and (context.get('_terp_view_name') in [Picking_Ticket, Picking_Tickets, Pre_Packing_List, Pre_Packing_Lists, Delivery_Orders, Delivery_Order] or context.get('picking_type', False) in ('delivery_order', 'picking_ticket'))\ |
221 | 305 | or v[2]['report_name'] in ('internal.move.xls', 'internal.move') and (('_terp_view_name' in context and context['_terp_view_name'] in [Internal_Moves]) or context.get('picking_type') == 'internal_move') \ | 305 | or v[2]['report_name'] in ('internal.move.xls', 'internal.move') and (('_terp_view_name' in context and context['_terp_view_name'] in [Internal_Moves]) or context.get('picking_type') == 'internal_move') \ |
223 | 306 | or v[2]['report_name'] == 'delivery.order' and context.get('_terp_view_name') in [Delivery_Orders, Delivery_Order]: | 306 | or v[2]['report_name'] == 'delivery.order' and (context.get('_terp_view_name') in [Delivery_Orders, Delivery_Order] or context.get('picking_type', False) == 'delivery_order'): |
224 | 307 | new_act.append(v) | 307 | new_act.append(v) |
225 | 308 | values = new_act | 308 | values = new_act |
226 | 309 | elif context.get('_terp_view_name') and key == 'action' and key2 == 'client_print_multi' and 'shipment' in [x[0] for x in models]: | 309 | elif context.get('_terp_view_name') and key == 'action' and key2 == 'client_print_multi' and 'shipment' in [x[0] for x in models]: |
227 | 310 | 310 | ||
228 | === modified file 'specific_rules/specific_rules_view.xml' | |||
229 | --- specific_rules/specific_rules_view.xml 2013-10-04 15:24:12 +0000 | |||
230 | +++ specific_rules/specific_rules_view.xml 2013-11-21 13:07:07 +0000 | |||
231 | @@ -144,7 +144,7 @@ | |||
232 | 144 | <field name="type">tree</field> | 144 | <field name="type">tree</field> |
233 | 145 | <field name="priority" eval="200" /> | 145 | <field name="priority" eval="200" /> |
234 | 146 | <field name="arch" type="xml"> | 146 | <field name="arch" type="xml"> |
236 | 147 | <tree string="Expiry Dates" hide_new_button="True" hide_delete_button="True"> | 147 | <tree string="Expiry Dates" hide_new_button="True" hide_delete_button="True" colors="red:life_date < current_date"> |
237 | 148 | <field name="prefix" invisible="True" /> | 148 | <field name="prefix" invisible="True" /> |
238 | 149 | <field name="type" invisible="True" /> | 149 | <field name="type" invisible="True" /> |
239 | 150 | <field name="life_date" /> | 150 | <field name="life_date" /> |
240 | 151 | 151 | ||
241 | === modified file 'stock_override/report/report_stock_move.py' | |||
242 | --- stock_override/report/report_stock_move.py 2013-09-03 08:27:31 +0000 | |||
243 | +++ stock_override/report/report_stock_move.py 2013-11-21 13:07:07 +0000 | |||
244 | @@ -163,7 +163,13 @@ | |||
245 | 163 | sm.prodlot_id as prodlot_id, | 163 | sm.prodlot_id as prodlot_id, |
246 | 164 | sm.comment as comment, | 164 | sm.comment as comment, |
247 | 165 | sm.tracking_id as tracking_id, | 165 | sm.tracking_id as tracking_id, |
249 | 166 | sum((sm.product_qty / pu.factor) * u.factor) as product_qty, | 166 | CASE |
250 | 167 | WHEN sp.type in ('out') THEN | ||
251 | 168 | sum((-sm.product_qty / pu.factor) * u.factor) | ||
252 | 169 | WHEN sp.type in ('in') THEN | ||
253 | 170 | sum((sm.product_qty / pu.factor) * u.factor) | ||
254 | 171 | ELSE 0.0 | ||
255 | 172 | END AS product_qty, | ||
256 | 167 | pt.nomen_manda_2 as categ_id, | 173 | pt.nomen_manda_2 as categ_id, |
257 | 168 | sp.partner_id2 as partner_id, | 174 | sp.partner_id2 as partner_id, |
258 | 169 | sm.product_id as product_id, | 175 | sm.product_id as product_id, |