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
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 raise osv.except_osv(_('Error'), _("You cannot create a commitment voucher line on a 'view' account type!"))
6 # Verify amount validity
7 if 'amount' in vals and vals.get('amount', 0.0) < 0.0:
8- raise osv.except_osv(_('Warning'), _('Amount Left should be equal or superior to 0!'))
9+ raise osv.except_osv(_('Warning'), _('Total amount should be equal or superior to 0!'))
10 if 'initial_amount' in vals and vals.get('initial_amount', 0.0) <= 0.0:
11 raise osv.except_osv(_('Warning'), _('Initial Amount should be superior to 0!'))
12 if 'initial_amount' in vals and 'amount' in vals:
13
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 screen. This message is a merge between all errors.
19 '''
20 # Generate the message
21+ import_error_ok = False
22 if len(values_header_errors):
23+ import_error_ok = True
24 message += '\n## Error on header values ##\n\n'
25 for err in values_header_errors:
26 message += '%s\n' % err
27
28 if len(values_line_errors):
29+ import_error_ok = True
30 message += '\n## Error on line values ##\n\n'
31 for err in values_line_errors:
32 message += '%s\n' % err
33
34- header_values['message'] = message
35- header_values['state'] = 'simu_done'
36- header_values['percent_completed'] = 100.0
37+ header_values.update({
38+ 'message': message,
39+ 'state': 'simu_done',
40+ 'percent_completed': 100.0,
41+ 'import_error_ok': import_error_ok,
42+ })
43 self.write(cr, uid, [wiz.id], header_values, context=context)
44
45 # res = self.go_to_simulation(cr, uid, [wiz.id], context=context)
46
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 <button name="go_to_simulation" string="Update" icon="gtk-execute" type="object" states="simu_progress,import_progress" />
52 <button name="print_simulation_report" string="Print report" icon="gtk-print" type="object" states="simu_done,import_progress,done" />
53 </group>
54+ <group name="errors" colspan="4" attrs="{'invisible': [('import_error_ok', '=', False)]}">
55+ <html>
56+ <p id="view_error_msg"
57+ style="text-align:center; color:red; font-weight: bold; font-size: 1.2.em;">
58+ WARNING: There are problems with the import file. Please see the 'Information' tab.
59+ </p>
60+ </html>
61+ </group>
62 <notebook colspan="4">
63 <page string="Purchase Order">
64 <field name="in_dest_addr" />
65
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 values['backshipment_id'] = backshipment_id
71
72 pack_fam_ids = [x.id for x in shipment.pack_family_memory_ids]
73- 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']):
74+ 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 # taken only into account if not done (done means returned packs)
76- if shipment.state in ('delivered', 'done') or memory_family['state'] not in ('done',) :
77+ if not memory_family['not_shipped'] and (shipment.state in ('delivered', 'done') or memory_family['state'] not in ('done',)):
78 # num of packs
79 num_of_packs = memory_family['num_of_packs']
80 values['num_of_packs'] += int(num_of_packs)
81@@ -835,6 +835,7 @@
82 'product_qty': new_qty,
83 'location_id': move.picking_id.warehouse_id.lot_distribution_id.id,
84 'location_dest_id': move.picking_id.warehouse_id.lot_dispatch_id.id,
85+ 'not_shipped': True,
86 'state': 'done',
87 }
88
89@@ -854,6 +855,7 @@
90 'location_dest_id': move.picking_id.warehouse_id.lot_distribution_id.id,
91 'picking_id': draft_packing.id,
92 'state': 'assigned',
93+ 'not_shipped': False,
94 })
95
96 context['non_stock_noupdate'] = True
97@@ -4103,6 +4105,7 @@
98 'location_output_id': fields.many2one('stock.location', string='Output location'),
99 'invoice_line_id': fields.many2one('account.invoice.line', string='Invoice line'),
100 'pt_created': fields.boolean(string='PT created'),
101+ 'not_shipped': fields.boolean(string='Not shipped'),
102 }
103
104 def copy(self, cr, uid, copy_id, values=None, context=None):
105@@ -4241,7 +4244,8 @@
106 p.description_ppl as description_ppl,
107 '_name'::varchar(5) as name,
108 min(pl.currency_id) as currency_id,
109- sum(sol.price_unit * m.product_qty) as total_amount
110+ sum(sol.price_unit * m.product_qty) as total_amount,
111+ bool_and(m.not_shipped) as not_shipped
112 from stock_picking p
113 inner join stock_move m on m.picking_id = p.id and m.state != 'cancel' and m.product_qty > 0
114 left join sale_order so on so.id = p.sale_id
115@@ -4314,6 +4318,7 @@
116 'total_weight': fields.function(_vals_get, method=True, type='float', string='Total Weight[kg]', multi='get_vals',),
117 'total_volume': fields.function(_vals_get, method=True, type='float', string=u'Total Volume[dmĀ³]', multi='get_vals',),
118 'description_ppl': fields.char('Description', size=256),
119+ 'not_shipped': fields.boolean(string='Not shipped'),
120 }
121
122 _defaults = {
123
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 <notebook colspan="4">
129 <page string="Pack Families">
130 <field colspan="4" name="pack_family_memory_ids" nolabel="1" widget="one2many_list" readonly="True">
131- <tree string="Pack Families">
132+ <tree string="Pack Families" colors="red: not_shipped">
133 <field name="sale_order_id"/>
134 <field name="ppl_id" />
135 <field name="description_ppl" />
136@@ -1221,7 +1221,8 @@
137 <field name="total_amount" />
138 <field name="currency_id" />
139 <field name="location_id" />
140- <field name="state" />
141+ <field name="state" />
142+ <field name="not_shipped" invisible="1" />
143 </tree>
144 <form>
145 <field name="sale_order_id"/>
146@@ -1401,7 +1402,7 @@
147 <field name="model">stock.move</field>
148 <field name="type">tree</field>
149 <field name="arch" type="xml">
150- <tree string="Closed shipped lines" editable="top" noteditable="1" hide_delete_button="1" hide_new_button="1">
151+ <tree string="Closed shipped lines" editable="top" noteditable="1" hide_delete_button="1" hide_new_button="1" colors="red: not_shipped">
152 <field name="origin"/>
153 <field name="picking_id" string="Pack"/>
154 <field name="line_number"/>
155@@ -1413,6 +1414,7 @@
156 <field name="asset_id"/>
157 <field name="partner_id"/>
158 <field name="date"/>
159+ <field name="not_shipped" invisible="1" />
160 </tree>
161 </field>
162 </record>
163
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 is_regular = po.order_type == 'regular' # True if order_type is regular, else False
169 line_error = []
170 # msf_order_date checks
171- if not po.delivery_confirmed_date:
172+ if po.state == 'approved' and not po.delivery_confirmed_date:
173 raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.'))
174 # for all lines, if the confirmed date is not filled, we copy the header value
175 if is_regular:
176@@ -2325,6 +2325,11 @@
177 _name = 'purchase.order.line'
178 _inherit = 'purchase.order.line'
179
180+ _sql_constraints = [
181+ ('product_qty', 'CHECK (product_qty > 0)',
182+ 'You can not have an order line with a negative or zero quantity'),
183+ ]
184+
185 def link_merged_line(self, cr, uid, vals, product_id, order_id, product_qty, uom_id, price_unit=0.00, context=None):
186 '''
187 Check if a merged line exist. If not, create a new one and attach them to the Po line
188
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 _name = 'sale.order.line'
194 _inherit = 'sale.order.line'
195
196+ _sql_constraints = [
197+ ('product_uom_qty', 'CHECK (product_uom_qty > 0)',
198+ 'You can not have an order line with a negative or zero quantity'),
199+ ]
200+
201 def _get_vat_ok(self, cr, uid, ids, field_name, args, context=None):
202 '''
203 Return True if the system configuration VAT management is set to True

Subscribers

People subscribed via source and target branches