Merge lp:~unifield-team/unifield-wm/utp-1216-1217-uf-2176 into lp:unifield-wm
- utp-1216-1217-uf-2176
- Merge into trunk
Proposed by
jftempo
Status: | Needs review |
---|---|
Proposed branch: | lp:~unifield-team/unifield-wm/utp-1216-1217-uf-2176 |
Merge into: | lp:unifield-wm |
Diff against target: |
203 lines (+42/-11) 7 files modified
analytic_distribution/account_commitment.py (+1/-1) msf_doc_import/wizard/wizard_po_simulation_screen.py (+9/-3) msf_doc_import/wizard/wizard_po_simulation_screen_view.xml (+8/-0) msf_outgoing/msf_outgoing.py (+8/-3) msf_outgoing/msf_outgoing_view.xml (+5/-3) purchase_override/purchase.py (+6/-1) sale_override/sale.py (+5/-0) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-wm/utp-1216-1217-uf-2176 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+238672@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 2302. By Vincent GREINER
-
UTP-1217 [MERGE] lp:~unifield-team/unifield-wm/utp-1217
- 2301. By Quentin THEURET @Amaris
-
UF-2176 [FIX] Shipment: If parcels are returned to draft shipment, on the closed shipment, compute the number of parcels, the total weight, etc. only on non-returned pack families. For returned pack families, they are displayed in red
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'analytic_distribution/account_commitment.py' | |||
2 | --- analytic_distribution/account_commitment.py 2014-03-31 07:18:04 +0000 | |||
3 | +++ analytic_distribution/account_commitment.py 2014-10-17 07:47:31 +0000 | |||
4 | @@ -526,7 +526,7 @@ | |||
5 | 526 | raise osv.except_osv(_('Error'), _("You cannot create a commitment voucher line on a 'view' account type!")) | 526 | raise osv.except_osv(_('Error'), _("You cannot create a commitment voucher line on a 'view' account type!")) |
6 | 527 | # Verify amount validity | 527 | # Verify amount validity |
7 | 528 | if 'amount' in vals and vals.get('amount', 0.0) < 0.0: | 528 | if 'amount' in vals and vals.get('amount', 0.0) < 0.0: |
9 | 529 | raise osv.except_osv(_('Warning'), _('Amount Left should be equal or superior to 0!')) | 529 | raise osv.except_osv(_('Warning'), _('Total amount should be equal or superior to 0!')) |
10 | 530 | if 'initial_amount' in vals and vals.get('initial_amount', 0.0) <= 0.0: | 530 | if 'initial_amount' in vals and vals.get('initial_amount', 0.0) <= 0.0: |
11 | 531 | raise osv.except_osv(_('Warning'), _('Initial Amount should be superior to 0!')) | 531 | raise osv.except_osv(_('Warning'), _('Initial Amount should be superior to 0!')) |
12 | 532 | if 'initial_amount' in vals and 'amount' in vals: | 532 | if 'initial_amount' in vals and 'amount' in vals: |
13 | 533 | 533 | ||
14 | === modified file 'msf_doc_import/wizard/wizard_po_simulation_screen.py' | |||
15 | --- msf_doc_import/wizard/wizard_po_simulation_screen.py 2014-04-11 12:12:57 +0000 | |||
16 | +++ msf_doc_import/wizard/wizard_po_simulation_screen.py 2014-10-17 07:47:31 +0000 | |||
17 | @@ -920,19 +920,25 @@ | |||
18 | 920 | screen. This message is a merge between all errors. | 920 | screen. This message is a merge between all errors. |
19 | 921 | ''' | 921 | ''' |
20 | 922 | # Generate the message | 922 | # Generate the message |
21 | 923 | import_error_ok = False | ||
22 | 923 | if len(values_header_errors): | 924 | if len(values_header_errors): |
23 | 925 | import_error_ok = True | ||
24 | 924 | message += '\n## Error on header values ##\n\n' | 926 | message += '\n## Error on header values ##\n\n' |
25 | 925 | for err in values_header_errors: | 927 | for err in values_header_errors: |
26 | 926 | message += '%s\n' % err | 928 | message += '%s\n' % err |
27 | 927 | 929 | ||
28 | 928 | if len(values_line_errors): | 930 | if len(values_line_errors): |
29 | 931 | import_error_ok = True | ||
30 | 929 | message += '\n## Error on line values ##\n\n' | 932 | message += '\n## Error on line values ##\n\n' |
31 | 930 | for err in values_line_errors: | 933 | for err in values_line_errors: |
32 | 931 | message += '%s\n' % err | 934 | message += '%s\n' % err |
33 | 932 | 935 | ||
37 | 933 | header_values['message'] = message | 936 | header_values.update({ |
38 | 934 | header_values['state'] = 'simu_done' | 937 | 'message': message, |
39 | 935 | header_values['percent_completed'] = 100.0 | 938 | 'state': 'simu_done', |
40 | 939 | 'percent_completed': 100.0, | ||
41 | 940 | 'import_error_ok': import_error_ok, | ||
42 | 941 | }) | ||
43 | 936 | self.write(cr, uid, [wiz.id], header_values, context=context) | 942 | self.write(cr, uid, [wiz.id], header_values, context=context) |
44 | 937 | 943 | ||
45 | 938 | # res = self.go_to_simulation(cr, uid, [wiz.id], context=context) | 944 | # res = self.go_to_simulation(cr, uid, [wiz.id], context=context) |
46 | 939 | 945 | ||
47 | === modified file 'msf_doc_import/wizard/wizard_po_simulation_screen_view.xml' | |||
48 | --- msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2014-04-08 09:42:43 +0000 | |||
49 | +++ msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2014-10-17 07:47:31 +0000 | |||
50 | @@ -31,6 +31,14 @@ | |||
51 | 31 | <button name="go_to_simulation" string="Update" icon="gtk-execute" type="object" states="simu_progress,import_progress" /> | 31 | <button name="go_to_simulation" string="Update" icon="gtk-execute" type="object" states="simu_progress,import_progress" /> |
52 | 32 | <button name="print_simulation_report" string="Print report" icon="gtk-print" type="object" states="simu_done,import_progress,done" /> | 32 | <button name="print_simulation_report" string="Print report" icon="gtk-print" type="object" states="simu_done,import_progress,done" /> |
53 | 33 | </group> | 33 | </group> |
54 | 34 | <group name="errors" colspan="4" attrs="{'invisible': [('import_error_ok', '=', False)]}"> | ||
55 | 35 | <html> | ||
56 | 36 | <p id="view_error_msg" | ||
57 | 37 | style="text-align:center; color:red; font-weight: bold; font-size: 1.2.em;"> | ||
58 | 38 | WARNING: There are problems with the import file. Please see the 'Information' tab. | ||
59 | 39 | </p> | ||
60 | 40 | </html> | ||
61 | 41 | </group> | ||
62 | 34 | <notebook colspan="4"> | 42 | <notebook colspan="4"> |
63 | 35 | <page string="Purchase Order"> | 43 | <page string="Purchase Order"> |
64 | 36 | <field name="in_dest_addr" /> | 44 | <field name="in_dest_addr" /> |
65 | 37 | 45 | ||
66 | === modified file 'msf_outgoing/msf_outgoing.py' | |||
67 | --- msf_outgoing/msf_outgoing.py 2014-09-26 13:09:16 +0000 | |||
68 | +++ msf_outgoing/msf_outgoing.py 2014-10-17 07:47:31 +0000 | |||
69 | @@ -187,9 +187,9 @@ | |||
70 | 187 | values['backshipment_id'] = backshipment_id | 187 | values['backshipment_id'] = backshipment_id |
71 | 188 | 188 | ||
72 | 189 | pack_fam_ids = [x.id for x in shipment.pack_family_memory_ids] | 189 | pack_fam_ids = [x.id for x in shipment.pack_family_memory_ids] |
74 | 190 | for memory_family in self.pool.get('pack.family.memory').read(cr, uid, pack_fam_ids, ['state', 'num_of_packs', 'total_weight', 'total_volume', 'total_amount', 'currency_id']): | 190 | for memory_family in self.pool.get('pack.family.memory').read(cr, uid, pack_fam_ids, ['not_shipped', 'state', 'num_of_packs', 'total_weight', 'total_volume', 'total_amount', 'currency_id']): |
75 | 191 | # taken only into account if not done (done means returned packs) | 191 | # taken only into account if not done (done means returned packs) |
77 | 192 | if shipment.state in ('delivered', 'done') or memory_family['state'] not in ('done',) : | 192 | if not memory_family['not_shipped'] and (shipment.state in ('delivered', 'done') or memory_family['state'] not in ('done',)): |
78 | 193 | # num of packs | 193 | # num of packs |
79 | 194 | num_of_packs = memory_family['num_of_packs'] | 194 | num_of_packs = memory_family['num_of_packs'] |
80 | 195 | values['num_of_packs'] += int(num_of_packs) | 195 | values['num_of_packs'] += int(num_of_packs) |
81 | @@ -835,6 +835,7 @@ | |||
82 | 835 | 'product_qty': new_qty, | 835 | 'product_qty': new_qty, |
83 | 836 | 'location_id': move.picking_id.warehouse_id.lot_distribution_id.id, | 836 | 'location_id': move.picking_id.warehouse_id.lot_distribution_id.id, |
84 | 837 | 'location_dest_id': move.picking_id.warehouse_id.lot_dispatch_id.id, | 837 | 'location_dest_id': move.picking_id.warehouse_id.lot_dispatch_id.id, |
85 | 838 | 'not_shipped': True, | ||
86 | 838 | 'state': 'done', | 839 | 'state': 'done', |
87 | 839 | } | 840 | } |
88 | 840 | 841 | ||
89 | @@ -854,6 +855,7 @@ | |||
90 | 854 | 'location_dest_id': move.picking_id.warehouse_id.lot_distribution_id.id, | 855 | 'location_dest_id': move.picking_id.warehouse_id.lot_distribution_id.id, |
91 | 855 | 'picking_id': draft_packing.id, | 856 | 'picking_id': draft_packing.id, |
92 | 856 | 'state': 'assigned', | 857 | 'state': 'assigned', |
93 | 858 | 'not_shipped': False, | ||
94 | 857 | }) | 859 | }) |
95 | 858 | 860 | ||
96 | 859 | context['non_stock_noupdate'] = True | 861 | context['non_stock_noupdate'] = True |
97 | @@ -4103,6 +4105,7 @@ | |||
98 | 4103 | 'location_output_id': fields.many2one('stock.location', string='Output location'), | 4105 | 'location_output_id': fields.many2one('stock.location', string='Output location'), |
99 | 4104 | 'invoice_line_id': fields.many2one('account.invoice.line', string='Invoice line'), | 4106 | 'invoice_line_id': fields.many2one('account.invoice.line', string='Invoice line'), |
100 | 4105 | 'pt_created': fields.boolean(string='PT created'), | 4107 | 'pt_created': fields.boolean(string='PT created'), |
101 | 4108 | 'not_shipped': fields.boolean(string='Not shipped'), | ||
102 | 4106 | } | 4109 | } |
103 | 4107 | 4110 | ||
104 | 4108 | def copy(self, cr, uid, copy_id, values=None, context=None): | 4111 | def copy(self, cr, uid, copy_id, values=None, context=None): |
105 | @@ -4241,7 +4244,8 @@ | |||
106 | 4241 | p.description_ppl as description_ppl, | 4244 | p.description_ppl as description_ppl, |
107 | 4242 | '_name'::varchar(5) as name, | 4245 | '_name'::varchar(5) as name, |
108 | 4243 | min(pl.currency_id) as currency_id, | 4246 | min(pl.currency_id) as currency_id, |
110 | 4244 | sum(sol.price_unit * m.product_qty) as total_amount | 4247 | sum(sol.price_unit * m.product_qty) as total_amount, |
111 | 4248 | bool_and(m.not_shipped) as not_shipped | ||
112 | 4245 | from stock_picking p | 4249 | from stock_picking p |
113 | 4246 | inner join stock_move m on m.picking_id = p.id and m.state != 'cancel' and m.product_qty > 0 | 4250 | inner join stock_move m on m.picking_id = p.id and m.state != 'cancel' and m.product_qty > 0 |
114 | 4247 | left join sale_order so on so.id = p.sale_id | 4251 | left join sale_order so on so.id = p.sale_id |
115 | @@ -4314,6 +4318,7 @@ | |||
116 | 4314 | 'total_weight': fields.function(_vals_get, method=True, type='float', string='Total Weight[kg]', multi='get_vals',), | 4318 | 'total_weight': fields.function(_vals_get, method=True, type='float', string='Total Weight[kg]', multi='get_vals',), |
117 | 4315 | 'total_volume': fields.function(_vals_get, method=True, type='float', string=u'Total Volume[dm³]', multi='get_vals',), | 4319 | 'total_volume': fields.function(_vals_get, method=True, type='float', string=u'Total Volume[dm³]', multi='get_vals',), |
118 | 4316 | 'description_ppl': fields.char('Description', size=256), | 4320 | 'description_ppl': fields.char('Description', size=256), |
119 | 4321 | 'not_shipped': fields.boolean(string='Not shipped'), | ||
120 | 4317 | } | 4322 | } |
121 | 4318 | 4323 | ||
122 | 4319 | _defaults = { | 4324 | _defaults = { |
123 | 4320 | 4325 | ||
124 | === modified file 'msf_outgoing/msf_outgoing_view.xml' | |||
125 | --- msf_outgoing/msf_outgoing_view.xml 2014-10-03 09:54:33 +0000 | |||
126 | +++ msf_outgoing/msf_outgoing_view.xml 2014-10-17 07:47:31 +0000 | |||
127 | @@ -1206,7 +1206,7 @@ | |||
128 | 1206 | <notebook colspan="4"> | 1206 | <notebook colspan="4"> |
129 | 1207 | <page string="Pack Families"> | 1207 | <page string="Pack Families"> |
130 | 1208 | <field colspan="4" name="pack_family_memory_ids" nolabel="1" widget="one2many_list" readonly="True"> | 1208 | <field colspan="4" name="pack_family_memory_ids" nolabel="1" widget="one2many_list" readonly="True"> |
132 | 1209 | <tree string="Pack Families"> | 1209 | <tree string="Pack Families" colors="red: not_shipped"> |
133 | 1210 | <field name="sale_order_id"/> | 1210 | <field name="sale_order_id"/> |
134 | 1211 | <field name="ppl_id" /> | 1211 | <field name="ppl_id" /> |
135 | 1212 | <field name="description_ppl" /> | 1212 | <field name="description_ppl" /> |
136 | @@ -1221,7 +1221,8 @@ | |||
137 | 1221 | <field name="total_amount" /> | 1221 | <field name="total_amount" /> |
138 | 1222 | <field name="currency_id" /> | 1222 | <field name="currency_id" /> |
139 | 1223 | <field name="location_id" /> | 1223 | <field name="location_id" /> |
141 | 1224 | <field name="state" /> | 1224 | <field name="state" /> |
142 | 1225 | <field name="not_shipped" invisible="1" /> | ||
143 | 1225 | </tree> | 1226 | </tree> |
144 | 1226 | <form> | 1227 | <form> |
145 | 1227 | <field name="sale_order_id"/> | 1228 | <field name="sale_order_id"/> |
146 | @@ -1401,7 +1402,7 @@ | |||
147 | 1401 | <field name="model">stock.move</field> | 1402 | <field name="model">stock.move</field> |
148 | 1402 | <field name="type">tree</field> | 1403 | <field name="type">tree</field> |
149 | 1403 | <field name="arch" type="xml"> | 1404 | <field name="arch" type="xml"> |
151 | 1404 | <tree string="Closed shipped lines" editable="top" noteditable="1" hide_delete_button="1" hide_new_button="1"> | 1405 | <tree string="Closed shipped lines" editable="top" noteditable="1" hide_delete_button="1" hide_new_button="1" colors="red: not_shipped"> |
152 | 1405 | <field name="origin"/> | 1406 | <field name="origin"/> |
153 | 1406 | <field name="picking_id" string="Pack"/> | 1407 | <field name="picking_id" string="Pack"/> |
154 | 1407 | <field name="line_number"/> | 1408 | <field name="line_number"/> |
155 | @@ -1413,6 +1414,7 @@ | |||
156 | 1413 | <field name="asset_id"/> | 1414 | <field name="asset_id"/> |
157 | 1414 | <field name="partner_id"/> | 1415 | <field name="partner_id"/> |
158 | 1415 | <field name="date"/> | 1416 | <field name="date"/> |
159 | 1417 | <field name="not_shipped" invisible="1" /> | ||
160 | 1416 | </tree> | 1418 | </tree> |
161 | 1417 | </field> | 1419 | </field> |
162 | 1418 | </record> | 1420 | </record> |
163 | 1419 | 1421 | ||
164 | === modified file 'purchase_override/purchase.py' | |||
165 | --- purchase_override/purchase.py 2014-10-10 12:26:59 +0000 | |||
166 | +++ purchase_override/purchase.py 2014-10-17 07:47:31 +0000 | |||
167 | @@ -1097,7 +1097,7 @@ | |||
168 | 1097 | is_regular = po.order_type == 'regular' # True if order_type is regular, else False | 1097 | is_regular = po.order_type == 'regular' # True if order_type is regular, else False |
169 | 1098 | line_error = [] | 1098 | line_error = [] |
170 | 1099 | # msf_order_date checks | 1099 | # msf_order_date checks |
172 | 1100 | if not po.delivery_confirmed_date: | 1100 | if po.state == 'approved' and not po.delivery_confirmed_date: |
173 | 1101 | raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.')) | 1101 | raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.')) |
174 | 1102 | # for all lines, if the confirmed date is not filled, we copy the header value | 1102 | # for all lines, if the confirmed date is not filled, we copy the header value |
175 | 1103 | if is_regular: | 1103 | if is_regular: |
176 | @@ -2325,6 +2325,11 @@ | |||
177 | 2325 | _name = 'purchase.order.line' | 2325 | _name = 'purchase.order.line' |
178 | 2326 | _inherit = 'purchase.order.line' | 2326 | _inherit = 'purchase.order.line' |
179 | 2327 | 2327 | ||
180 | 2328 | _sql_constraints = [ | ||
181 | 2329 | ('product_qty', 'CHECK (product_qty > 0)', | ||
182 | 2330 | 'You can not have an order line with a negative or zero quantity'), | ||
183 | 2331 | ] | ||
184 | 2332 | |||
185 | 2328 | def link_merged_line(self, cr, uid, vals, product_id, order_id, product_qty, uom_id, price_unit=0.00, context=None): | 2333 | def link_merged_line(self, cr, uid, vals, product_id, order_id, product_qty, uom_id, price_unit=0.00, context=None): |
186 | 2329 | ''' | 2334 | ''' |
187 | 2330 | Check if a merged line exist. If not, create a new one and attach them to the Po line | 2335 | Check if a merged line exist. If not, create a new one and attach them to the Po line |
188 | 2331 | 2336 | ||
189 | === modified file 'sale_override/sale.py' | |||
190 | --- sale_override/sale.py 2014-10-08 09:53:24 +0000 | |||
191 | +++ sale_override/sale.py 2014-10-17 07:47:31 +0000 | |||
192 | @@ -2133,6 +2133,11 @@ | |||
193 | 2133 | _name = 'sale.order.line' | 2133 | _name = 'sale.order.line' |
194 | 2134 | _inherit = 'sale.order.line' | 2134 | _inherit = 'sale.order.line' |
195 | 2135 | 2135 | ||
196 | 2136 | _sql_constraints = [ | ||
197 | 2137 | ('product_uom_qty', 'CHECK (product_uom_qty > 0)', | ||
198 | 2138 | 'You can not have an order line with a negative or zero quantity'), | ||
199 | 2139 | ] | ||
200 | 2140 | |||
201 | 2136 | def _get_vat_ok(self, cr, uid, ids, field_name, args, context=None): | 2141 | def _get_vat_ok(self, cr, uid, ids, field_name, args, context=None): |
202 | 2137 | ''' | 2142 | ''' |
203 | 2138 | Return True if the system configuration VAT management is set to True | 2143 | Return True if the system configuration VAT management is set to True |