Merge lp:~camptocamp/openerp-rma/7.0-updates into lp:~savoirfairelinux-openerp/openerp-rma/7.0-fix-reference-to-res-partner-address
- 7.0-updates
- Merge into 7.0-fix-reference-to-res-p...
Proposed by
Romain Deheele - Camptocamp
Status: | Merged |
---|---|
Merged at revision: | 69 |
Proposed branch: | lp:~camptocamp/openerp-rma/7.0-updates |
Merge into: | lp:~savoirfairelinux-openerp/openerp-rma/7.0-fix-reference-to-res-partner-address |
Diff against target: |
331 lines (+45/-44) 6 files modified
crm_claim_rma/crm_claim_rma_view.xml (+5/-3) crm_claim_rma/wizard/claim_make_picking.py (+2/-3) crm_claim_rma/wizard/claim_make_picking_from_picking.py (+2/-2) crm_claim_rma/wizard/picking_from_exchange_lines.py (+10/-10) crm_claim_rma/wizard/picking_from_returned_lines.py (+13/-13) crm_claim_rma/wizard/refund_from_returned_lines.py (+13/-13) |
To merge this branch: | bzr merge lp:~camptocamp/openerp-rma/7.0-updates |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maxime Chambreuil (http://www.savoirfairelinux.com) | Approve | ||
Review via email: mp+180854@code.launchpad.net |
Commit message
Description of the change
Hello Maxime,
I see your branch with v7 port updates.
I find other v7 port needs about res.partner.address in wizard.
I propose you to merge it in your branch.
Best regards,
Romain
To post a comment you must log in.
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote : | # |
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'crm_claim_rma/crm_claim_rma_view.xml' |
2 | --- crm_claim_rma/crm_claim_rma_view.xml 2013-05-01 20:32:16 +0000 |
3 | +++ crm_claim_rma/crm_claim_rma_view.xml 2013-08-19 12:18:10 +0000 |
4 | @@ -323,15 +323,17 @@ |
5 | res_model="account.invoice" |
6 | src_model="crm.claim"/> |
7 | <!-- Right side link to picking in --> |
8 | - <act_window |
9 | - domain="[('type', '=', 'in'),('partner_id', 'in', [partner_id])]" |
10 | + <act_window |
11 | + context="{'search_default_partner_id': [partner_id]}" |
12 | + domain="[('type', '=', 'in')]" |
13 | id="act_crm_claim_rma_picking_in" |
14 | name="Partner picking IN" |
15 | res_model="stock.picking" |
16 | src_model="crm.claim"/> |
17 | <!-- Right side link to picking out --> |
18 | <act_window |
19 | - domain="[('type', '=', 'out'),('partner_id', 'in', [partner_id])]" |
20 | + context="{'search_default_partner_id': [partner_id]}" |
21 | + domain="[('type', '=', 'out')]" |
22 | id="act_crm_claim_rma_picking_out" |
23 | name="Partner picking OUT" |
24 | res_model="stock.picking" |
25 | |
26 | === modified file 'crm_claim_rma/wizard/claim_make_picking.py' |
27 | --- crm_claim_rma/wizard/claim_make_picking.py 2012-10-11 18:31:50 +0000 |
28 | +++ crm_claim_rma/wizard/claim_make_picking.py 2013-08-19 12:18:10 +0000 |
29 | @@ -116,7 +116,6 @@ |
30 | view_name = 'stock.picking.in.form' |
31 | view_id = view_obj.search(cr, uid, [ |
32 | ('xml_id', '=', view_xml_id), |
33 | - ('model', '=', 'stock.picking'), |
34 | ('type', '=', 'form'), |
35 | ('name', '=', view_name) |
36 | ], context=context)[0] |
37 | @@ -130,7 +129,7 @@ |
38 | 'move_type': 'one', # direct |
39 | 'state': 'draft', |
40 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), |
41 | - 'address_id': claim.partner_address_id.id, |
42 | + 'partner_id': claim.partner_id.id, |
43 | 'invoice_state': "none", |
44 | 'company_id': claim.company_id.id, |
45 | 'location_id': wizard.claim_line_source_location.id, |
46 | @@ -150,7 +149,7 @@ |
47 | 'product_id': wizard_claim_line.product_id.id, |
48 | 'product_qty': wizard_claim_line.product_returned_quantity, |
49 | 'product_uom': wizard_claim_line.product_id.uom_id.id, |
50 | - 'address_id': claim.partner_address_id.id, |
51 | + 'partner_id': claim.partner_id.id, |
52 | 'prodlot_id': wizard_claim_line.prodlot_id.id, |
53 | # 'tracking_id': |
54 | 'picking_id': picking_id, |
55 | |
56 | === modified file 'crm_claim_rma/wizard/claim_make_picking_from_picking.py' |
57 | --- crm_claim_rma/wizard/claim_make_picking_from_picking.py 2012-09-19 16:25:16 +0000 |
58 | +++ crm_claim_rma/wizard/claim_make_picking_from_picking.py 2013-08-19 12:18:10 +0000 |
59 | @@ -93,7 +93,7 @@ |
60 | 'move_type': 'one', # direct |
61 | 'state': 'draft', |
62 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), |
63 | - 'address_id': prev_picking.address_id.id, |
64 | + 'partner_id': prev_picking.partner_id.id, |
65 | 'invoice_state': "none", |
66 | 'company_id': prev_picking.company_id.id, |
67 | 'location_id': wizard.picking_line_source_location.id, |
68 | @@ -112,7 +112,7 @@ |
69 | 'product_id': wizard_picking_line.product_id.id, |
70 | 'product_qty': wizard_picking_line.product_qty, |
71 | 'product_uom': wizard_picking_line.product_uom.id, |
72 | - 'address_id': prev_picking.address_id.id, |
73 | + 'partner_id': prev_picking.partner_id.id, |
74 | 'prodlot_id': wizard_picking_line.prodlot_id.id, |
75 | # 'tracking_id': |
76 | 'picking_id': picking_id, |
77 | |
78 | === modified file 'crm_claim_rma/wizard/picking_from_exchange_lines.py' |
79 | --- crm_claim_rma/wizard/picking_from_exchange_lines.py 2012-08-28 12:57:05 +0000 |
80 | +++ crm_claim_rma/wizard/picking_from_exchange_lines.py 2013-08-19 12:18:10 +0000 |
81 | @@ -31,7 +31,7 @@ |
82 | _columns = { |
83 | 'exchange_line_ids' : fields.many2many('temp.exchange.line', string='Selected exchange lines'), |
84 | } |
85 | - |
86 | + |
87 | # Get selected lines to add to picking in |
88 | def _get_selected_lines(self, cr, uid,context): |
89 | exchange_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['product_exchange_ids'])['product_exchange_ids'] |
90 | @@ -46,13 +46,13 @@ |
91 | 'returned_prodlot_id' : line.returned_product_serial.id, |
92 | 'replacement_product_id': line.replacement_product.id, |
93 | 'replacement_product_quantity' : line.replacement_product_qty, |
94 | - 'replacement_prodlot_id': line.replacement_product_serial.id, |
95 | + 'replacement_prodlot_id': line.replacement_product_serial.id, |
96 | })) |
97 | - return M2M |
98 | - |
99 | + return M2M |
100 | + |
101 | _defaults = { |
102 | 'exchange_line_ids': _get_selected_lines, |
103 | - } |
104 | + } |
105 | |
106 | # If "Cancel" button pressed |
107 | def action_cancel(self,cr,uid,ids,conect=None): |
108 | @@ -70,13 +70,13 @@ |
109 | 'move_type': 'one', # direct |
110 | 'state': 'draft', |
111 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
112 | - 'address_id': claim_id.partner_address_id.id, |
113 | + 'partner_id': claim_id.partner_id.id, |
114 | 'invoice_state': "none", |
115 | 'company_id': claim_id.company_id.id, |
116 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), |
117 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], |
118 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, |
119 | - 'note' : 'RMA picking in', |
120 | + 'note' : 'RMA picking in', |
121 | }) |
122 | # Create picking lines |
123 | for exchange_line in exchange_lines.exchange_line_ids: |
124 | @@ -89,7 +89,7 @@ |
125 | 'product_id': exchange_line.replacement_product_id.id, |
126 | 'product_qty': exchange_line.replacement_product_quantity, |
127 | 'product_uom': exchange_line.replacement_product_id.uom_id.id, |
128 | - 'address_id': claim_id.partner_address_id.id, |
129 | + 'partner_id': claim_id.partner_id.id, |
130 | 'prodlot_id': exchange_line.replacement_prodlot_id, |
131 | # 'tracking_id': |
132 | 'picking_id': picking_id, |
133 | @@ -99,7 +99,7 @@ |
134 | 'company_id': claim_id.company_id.id, |
135 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], |
136 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, |
137 | - 'note': 'RMA Refound', |
138 | + 'note': 'RMA Refound', |
139 | }) |
140 | view = { |
141 | 'name': 'Customer Picking OUT', |
142 | @@ -110,7 +110,7 @@ |
143 | 'type': 'ir.actions.act_window', |
144 | } |
145 | return view |
146 | - |
147 | + |
148 | picking_out_from_exchange_lines() |
149 | |
150 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
151 | |
152 | === modified file 'crm_claim_rma/wizard/picking_from_returned_lines.py' |
153 | --- crm_claim_rma/wizard/picking_from_returned_lines.py 2012-09-12 09:29:21 +0000 |
154 | +++ crm_claim_rma/wizard/picking_from_returned_lines.py 2013-08-19 12:18:10 +0000 |
155 | @@ -32,7 +32,7 @@ |
156 | 'claim_line_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", select=True), |
157 | 'claim_line_ids' : fields.many2many('temp.claim.line',string='Selected return lines'), |
158 | } |
159 | - |
160 | + |
161 | # Get selected lines to add to picking in |
162 | def _get_selected_lines(self, cr, uid,context): |
163 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] |
164 | @@ -53,12 +53,12 @@ |
165 | # Get default destination location |
166 | def _get_dest_loc(self, cr, uid,context): |
167 | return self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0] |
168 | - |
169 | + |
170 | _defaults = { |
171 | 'claim_line_ids': _get_selected_lines, |
172 | 'claim_line_location' : _get_dest_loc, |
173 | - } |
174 | - |
175 | + } |
176 | + |
177 | # If "Cancel" button pressed |
178 | def action_cancel(self,cr,uid,ids,conect=None): |
179 | return {'type': 'ir.actions.act_window_close',} |
180 | @@ -84,7 +84,7 @@ |
181 | 'move_type': 'one', # direct |
182 | 'state': 'draft', |
183 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
184 | - 'address_id': claim_id.partner_address_id.id, |
185 | + 'partner_id': claim_id.partner_id.id, |
186 | 'invoice_state': "none", |
187 | 'company_id': claim_id.company_id.id, |
188 | 'location_id': location, |
189 | @@ -103,7 +103,7 @@ |
190 | 'product_id': picking_line.product_id.id, |
191 | 'product_qty': picking_line.product_returned_quantity, |
192 | 'product_uom': picking_line.product_id.uom_id.id, |
193 | - 'address_id': claim_id.partner_address_id.id, |
194 | + 'partner_id': claim_id.partner_id.id, |
195 | 'prodlot_id': picking_line.prodlot_id.id, |
196 | # 'tracking_id': |
197 | 'picking_id': picking_id, |
198 | @@ -125,7 +125,7 @@ |
199 | 'res_model': 'stock.picking', |
200 | 'type': 'ir.actions.act_window', |
201 | } |
202 | - |
203 | + |
204 | picking_in_from_returned_lines() |
205 | |
206 | # Class to create a picking out from selected return lines |
207 | @@ -135,7 +135,7 @@ |
208 | _columns = { |
209 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), |
210 | } |
211 | - |
212 | + |
213 | # Get selected lines to add to picking in |
214 | def _get_selected_lines(self, cr, uid,context): |
215 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] |
216 | @@ -151,11 +151,11 @@ |
217 | 'prodlot_id' : line.prodlot_id.id, |
218 | 'price_unit' : line.unit_sale_price, |
219 | })) |
220 | - return M2M |
221 | - |
222 | + return M2M |
223 | + |
224 | _defaults = { |
225 | 'claim_line_ids': _get_selected_lines, |
226 | - } |
227 | + } |
228 | |
229 | # If "Cancel" button pressed |
230 | def action_cancel(self,cr,uid,ids,context=None): |
231 | @@ -180,7 +180,7 @@ |
232 | 'move_type': 'one', # direct |
233 | 'state': 'draft', |
234 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
235 | - 'address_id': claim_id.partner_address_id.id, |
236 | + 'partner_id': claim_id.partner_id.id, |
237 | 'invoice_state': "none", |
238 | 'company_id': claim_id.company_id.id, |
239 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), |
240 | @@ -200,7 +200,7 @@ |
241 | 'product_id': picking_line.product_id.id, |
242 | 'product_qty': picking_line.product_returned_quantity, |
243 | 'product_uom': picking_line.product_id.uom_id.id, |
244 | - 'address_id': claim_id.partner_address_id.id, |
245 | + 'partner_id': claim_id.partner_id.id, |
246 | 'prodlot_id': picking_line.prodlot_id.id, |
247 | # 'tracking_id': |
248 | 'picking_id': picking_id, |
249 | |
250 | === modified file 'crm_claim_rma/wizard/refund_from_returned_lines.py' |
251 | --- crm_claim_rma/wizard/refund_from_returned_lines.py 2012-09-03 10:06:46 +0000 |
252 | +++ crm_claim_rma/wizard/refund_from_returned_lines.py 2013-08-19 12:18:10 +0000 |
253 | @@ -31,7 +31,7 @@ |
254 | 'refund_journal' : fields.many2one('account.journal', 'Refund journal', select=True), |
255 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), |
256 | } |
257 | - |
258 | + |
259 | # Get selected lines to add to picking in |
260 | def _get_selected_lines(self, cr, uid,context): |
261 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] |
262 | @@ -47,18 +47,18 @@ |
263 | 'prodlot_id' : line.prodlot_id.id, |
264 | 'price_unit' : line.unit_sale_price, |
265 | })) |
266 | - return M2M |
267 | + return M2M |
268 | |
269 | # Get default journal |
270 | def _get_journal(self, cr, uid,context): |
271 | #('company_id','=',claim_id.company_id.id) |
272 | # ,('refund_journal','=','True') |
273 | return self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')],limit=1)[0] |
274 | - |
275 | + |
276 | _defaults = { |
277 | 'claim_line_ids': _get_selected_lines, |
278 | 'refund_journal' : _get_journal, |
279 | - } |
280 | + } |
281 | |
282 | # On "Cancel" button |
283 | def action_cancel(self,cr,uid,ids,context=None): |
284 | @@ -85,22 +85,22 @@ |
285 | 'reference_type': 'none', |
286 | 'date_invoice': time.strftime('%Y-%m-%d %H:%M:%S'), |
287 | # 'date_due': |
288 | - 'address_contact_id' : claim_id.partner_address_id.id, |
289 | - 'address_invoice_id' : claim_id.partner_address_id.id, |
290 | + 'partner_id' : claim_id.partner_id.id, |
291 | + 'commercial_partner_id' : claim_id.partner_id.id, |
292 | 'account_id' : claim_id.partner_id.property_account_receivable.id, |
293 | 'currency_id' : claim_id.company_id.currency_id.id, # from invoice ??? |
294 | 'journal_id' : refund.refund_journal.id, |
295 | 'company_id' : claim_id.company_id.id, |
296 | 'comment' : 'RMA Refund', |
297 | 'claim_id': claim_id.id, |
298 | - }) |
299 | - # Create invoice lines |
300 | - for refund_line in refund.claim_line_ids: |
301 | + }) |
302 | + # Create invoice lines |
303 | + for refund_line in refund.claim_line_ids: |
304 | if refund_line.invoice_id: |
305 | invoice_line_id = self.pool.get('account.invoice.line').create(cr, uid, { |
306 | 'name' : refund_line.product_id.name_template, |
307 | - 'origin' : claim_id.sequence, |
308 | - 'invoice_id' : invoice_id, |
309 | + 'origin' : claim_id.sequence, |
310 | + 'invoice_id' : invoice_id, |
311 | 'uos_id' : refund_line.product_id.uom_id.id, |
312 | 'product_id':refund_line.product_id.id, |
313 | 'account_id': claim_id.partner_id.property_account_receivable.id, # refund_line.product_id.property_account_expense.id, |
314 | @@ -111,7 +111,7 @@ |
315 | # 'account_analytic_id': |
316 | 'company_id' : claim_id.company_id.id, |
317 | 'partner_id' : refund_line.invoice_id.partner_id.id, |
318 | - 'note': 'RMA Refund', |
319 | + 'note': 'RMA Refund', |
320 | }) |
321 | else: |
322 | raise osv.except_osv(_('Error !'), _('Cannot find any invoice for the return line!')) |
323 | @@ -123,7 +123,7 @@ |
324 | 'res_model': 'account.invoice', |
325 | 'type': 'ir.actions.act_window', |
326 | } |
327 | - |
328 | + |
329 | refund_from_returned_lines() |
330 | |
331 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
+ some fixes about views links.