Merge lp:~unifield-team/unifield-wm/utp-1216-1217-uf-2176 into lp:unifield-wm

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
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+238672@code.launchpad.net
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
=== modified file 'analytic_distribution/account_commitment.py'
--- analytic_distribution/account_commitment.py 2014-03-31 07:18:04 +0000
+++ analytic_distribution/account_commitment.py 2014-10-17 07:47:31 +0000
@@ -526,7 +526,7 @@
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!"))
527 # Verify amount validity527 # Verify amount validity
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:
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!'))
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:
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!'))
532 if 'initial_amount' in vals and 'amount' in vals:532 if 'initial_amount' in vals and 'amount' in vals:
533533
=== modified file 'msf_doc_import/wizard/wizard_po_simulation_screen.py'
--- msf_doc_import/wizard/wizard_po_simulation_screen.py 2014-04-11 12:12:57 +0000
+++ msf_doc_import/wizard/wizard_po_simulation_screen.py 2014-10-17 07:47:31 +0000
@@ -920,19 +920,25 @@
920 screen. This message is a merge between all errors.920 screen. This message is a merge between all errors.
921 '''921 '''
922 # Generate the message922 # Generate the message
923 import_error_ok = False
923 if len(values_header_errors):924 if len(values_header_errors):
925 import_error_ok = True
924 message += '\n## Error on header values ##\n\n'926 message += '\n## Error on header values ##\n\n'
925 for err in values_header_errors:927 for err in values_header_errors:
926 message += '%s\n' % err928 message += '%s\n' % err
927929
928 if len(values_line_errors):930 if len(values_line_errors):
931 import_error_ok = True
929 message += '\n## Error on line values ##\n\n'932 message += '\n## Error on line values ##\n\n'
930 for err in values_line_errors:933 for err in values_line_errors:
931 message += '%s\n' % err934 message += '%s\n' % err
932935
933 header_values['message'] = message936 header_values.update({
934 header_values['state'] = 'simu_done'937 'message': message,
935 header_values['percent_completed'] = 100.0938 'state': 'simu_done',
939 'percent_completed': 100.0,
940 'import_error_ok': import_error_ok,
941 })
936 self.write(cr, uid, [wiz.id], header_values, context=context)942 self.write(cr, uid, [wiz.id], header_values, context=context)
937943
938 # res = self.go_to_simulation(cr, uid, [wiz.id], context=context)944 # res = self.go_to_simulation(cr, uid, [wiz.id], context=context)
939945
=== modified file 'msf_doc_import/wizard/wizard_po_simulation_screen_view.xml'
--- msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2014-04-08 09:42:43 +0000
+++ msf_doc_import/wizard/wizard_po_simulation_screen_view.xml 2014-10-17 07:47:31 +0000
@@ -31,6 +31,14 @@
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" />
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" />
33 </group>33 </group>
34 <group name="errors" colspan="4" attrs="{'invisible': [('import_error_ok', '=', False)]}">
35 <html>
36 <p id="view_error_msg"
37 style="text-align:center; color:red; font-weight: bold; font-size: 1.2.em;">
38 WARNING: There are problems with the import file. Please see the 'Information' tab.
39 </p>
40 </html>
41 </group>
34 <notebook colspan="4">42 <notebook colspan="4">
35 <page string="Purchase Order">43 <page string="Purchase Order">
36 <field name="in_dest_addr" />44 <field name="in_dest_addr" />
3745
=== modified file 'msf_outgoing/msf_outgoing.py'
--- msf_outgoing/msf_outgoing.py 2014-09-26 13:09:16 +0000
+++ msf_outgoing/msf_outgoing.py 2014-10-17 07:47:31 +0000
@@ -187,9 +187,9 @@
187 values['backshipment_id'] = backshipment_id187 values['backshipment_id'] = backshipment_id
188188
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]
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']):
191 # taken only into account if not done (done means returned packs)191 # taken only into account if not done (done means returned packs)
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',)):
193 # num of packs193 # num of packs
194 num_of_packs = memory_family['num_of_packs']194 num_of_packs = memory_family['num_of_packs']
195 values['num_of_packs'] += int(num_of_packs)195 values['num_of_packs'] += int(num_of_packs)
@@ -835,6 +835,7 @@
835 'product_qty': new_qty,835 'product_qty': new_qty,
836 'location_id': move.picking_id.warehouse_id.lot_distribution_id.id,836 'location_id': move.picking_id.warehouse_id.lot_distribution_id.id,
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,
838 'not_shipped': True,
838 'state': 'done',839 'state': 'done',
839 }840 }
840841
@@ -854,6 +855,7 @@
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,
855 'picking_id': draft_packing.id,856 'picking_id': draft_packing.id,
856 'state': 'assigned',857 'state': 'assigned',
858 'not_shipped': False,
857 })859 })
858860
859 context['non_stock_noupdate'] = True861 context['non_stock_noupdate'] = True
@@ -4103,6 +4105,7 @@
4103 'location_output_id': fields.many2one('stock.location', string='Output location'),4105 'location_output_id': fields.many2one('stock.location', string='Output location'),
4104 'invoice_line_id': fields.many2one('account.invoice.line', string='Invoice line'),4106 'invoice_line_id': fields.many2one('account.invoice.line', string='Invoice line'),
4105 'pt_created': fields.boolean(string='PT created'),4107 'pt_created': fields.boolean(string='PT created'),
4108 'not_shipped': fields.boolean(string='Not shipped'),
4106 }4109 }
41074110
4108 def copy(self, cr, uid, copy_id, values=None, context=None):4111 def copy(self, cr, uid, copy_id, values=None, context=None):
@@ -4241,7 +4244,8 @@
4241 p.description_ppl as description_ppl,4244 p.description_ppl as description_ppl,
4242 '_name'::varchar(5) as name,4245 '_name'::varchar(5) as name,
4243 min(pl.currency_id) as currency_id,4246 min(pl.currency_id) as currency_id,
4244 sum(sol.price_unit * m.product_qty) as total_amount4247 sum(sol.price_unit * m.product_qty) as total_amount,
4248 bool_and(m.not_shipped) as not_shipped
4245 from stock_picking p4249 from stock_picking p
4246 inner join stock_move m on m.picking_id = p.id and m.state != 'cancel' and m.product_qty > 04250 inner join stock_move m on m.picking_id = p.id and m.state != 'cancel' and m.product_qty > 0
4247 left join sale_order so on so.id = p.sale_id4251 left join sale_order so on so.id = p.sale_id
@@ -4314,6 +4318,7 @@
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',),
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',),
4316 'description_ppl': fields.char('Description', size=256),4320 'description_ppl': fields.char('Description', size=256),
4321 'not_shipped': fields.boolean(string='Not shipped'),
4317 }4322 }
43184323
4319 _defaults = {4324 _defaults = {
43204325
=== modified file 'msf_outgoing/msf_outgoing_view.xml'
--- msf_outgoing/msf_outgoing_view.xml 2014-10-03 09:54:33 +0000
+++ msf_outgoing/msf_outgoing_view.xml 2014-10-17 07:47:31 +0000
@@ -1206,7 +1206,7 @@
1206 <notebook colspan="4">1206 <notebook colspan="4">
1207 <page string="Pack Families">1207 <page string="Pack Families">
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">
1209 <tree string="Pack Families">1209 <tree string="Pack Families" colors="red: not_shipped">
1210 <field name="sale_order_id"/>1210 <field name="sale_order_id"/>
1211 <field name="ppl_id" />1211 <field name="ppl_id" />
1212 <field name="description_ppl" />1212 <field name="description_ppl" />
@@ -1221,7 +1221,8 @@
1221 <field name="total_amount" />1221 <field name="total_amount" />
1222 <field name="currency_id" />1222 <field name="currency_id" />
1223 <field name="location_id" />1223 <field name="location_id" />
1224 <field name="state" />1224 <field name="state" />
1225 <field name="not_shipped" invisible="1" />
1225 </tree>1226 </tree>
1226 <form>1227 <form>
1227 <field name="sale_order_id"/>1228 <field name="sale_order_id"/>
@@ -1401,7 +1402,7 @@
1401 <field name="model">stock.move</field>1402 <field name="model">stock.move</field>
1402 <field name="type">tree</field>1403 <field name="type">tree</field>
1403 <field name="arch" type="xml">1404 <field name="arch" type="xml">
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">
1405 <field name="origin"/>1406 <field name="origin"/>
1406 <field name="picking_id" string="Pack"/>1407 <field name="picking_id" string="Pack"/>
1407 <field name="line_number"/>1408 <field name="line_number"/>
@@ -1413,6 +1414,7 @@
1413 <field name="asset_id"/>1414 <field name="asset_id"/>
1414 <field name="partner_id"/>1415 <field name="partner_id"/>
1415 <field name="date"/>1416 <field name="date"/>
1417 <field name="not_shipped" invisible="1" />
1416 </tree>1418 </tree>
1417 </field>1419 </field>
1418 </record>1420 </record>
14191421
=== modified file 'purchase_override/purchase.py'
--- purchase_override/purchase.py 2014-10-10 12:26:59 +0000
+++ purchase_override/purchase.py 2014-10-17 07:47:31 +0000
@@ -1097,7 +1097,7 @@
1097 is_regular = po.order_type == 'regular' # True if order_type is regular, else False1097 is_regular = po.order_type == 'regular' # True if order_type is regular, else False
1098 line_error = []1098 line_error = []
1099 # msf_order_date checks1099 # msf_order_date checks
1100 if not po.delivery_confirmed_date:1100 if po.state == 'approved' and not po.delivery_confirmed_date:
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.'))
1102 # for all lines, if the confirmed date is not filled, we copy the header value1102 # for all lines, if the confirmed date is not filled, we copy the header value
1103 if is_regular:1103 if is_regular:
@@ -2325,6 +2325,11 @@
2325 _name = 'purchase.order.line'2325 _name = 'purchase.order.line'
2326 _inherit = 'purchase.order.line'2326 _inherit = 'purchase.order.line'
23272327
2328 _sql_constraints = [
2329 ('product_qty', 'CHECK (product_qty > 0)',
2330 'You can not have an order line with a negative or zero quantity'),
2331 ]
2332
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):
2329 '''2334 '''
2330 Check if a merged line exist. If not, create a new one and attach them to the Po line2335 Check if a merged line exist. If not, create a new one and attach them to the Po line
23312336
=== modified file 'sale_override/sale.py'
--- sale_override/sale.py 2014-10-08 09:53:24 +0000
+++ sale_override/sale.py 2014-10-17 07:47:31 +0000
@@ -2133,6 +2133,11 @@
2133 _name = 'sale.order.line'2133 _name = 'sale.order.line'
2134 _inherit = 'sale.order.line'2134 _inherit = 'sale.order.line'
21352135
2136 _sql_constraints = [
2137 ('product_uom_qty', 'CHECK (product_uom_qty > 0)',
2138 'You can not have an order line with a negative or zero quantity'),
2139 ]
2140
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):
2137 '''2142 '''
2138 Return True if the system configuration VAT management is set to True2143 Return True if the system configuration VAT management is set to True

Subscribers

People subscribed via source and target branches