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 | 323 | res_model="account.invoice" | 323 | res_model="account.invoice" |
6 | 324 | src_model="crm.claim"/> | 324 | src_model="crm.claim"/> |
7 | 325 | <!-- Right side link to picking in --> | 325 | <!-- Right side link to picking in --> |
10 | 326 | <act_window | 326 | <act_window |
11 | 327 | domain="[('type', '=', 'in'),('partner_id', 'in', [partner_id])]" | 327 | context="{'search_default_partner_id': [partner_id]}" |
12 | 328 | domain="[('type', '=', 'in')]" | ||
13 | 328 | id="act_crm_claim_rma_picking_in" | 329 | id="act_crm_claim_rma_picking_in" |
14 | 329 | name="Partner picking IN" | 330 | name="Partner picking IN" |
15 | 330 | res_model="stock.picking" | 331 | res_model="stock.picking" |
16 | 331 | src_model="crm.claim"/> | 332 | src_model="crm.claim"/> |
17 | 332 | <!-- Right side link to picking out --> | 333 | <!-- Right side link to picking out --> |
18 | 333 | <act_window | 334 | <act_window |
20 | 334 | domain="[('type', '=', 'out'),('partner_id', 'in', [partner_id])]" | 335 | context="{'search_default_partner_id': [partner_id]}" |
21 | 336 | domain="[('type', '=', 'out')]" | ||
22 | 335 | id="act_crm_claim_rma_picking_out" | 337 | id="act_crm_claim_rma_picking_out" |
23 | 336 | name="Partner picking OUT" | 338 | name="Partner picking OUT" |
24 | 337 | res_model="stock.picking" | 339 | res_model="stock.picking" |
25 | 338 | 340 | ||
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 | 116 | view_name = 'stock.picking.in.form' | 116 | view_name = 'stock.picking.in.form' |
31 | 117 | view_id = view_obj.search(cr, uid, [ | 117 | view_id = view_obj.search(cr, uid, [ |
32 | 118 | ('xml_id', '=', view_xml_id), | 118 | ('xml_id', '=', view_xml_id), |
33 | 119 | ('model', '=', 'stock.picking'), | ||
34 | 120 | ('type', '=', 'form'), | 119 | ('type', '=', 'form'), |
35 | 121 | ('name', '=', view_name) | 120 | ('name', '=', view_name) |
36 | 122 | ], context=context)[0] | 121 | ], context=context)[0] |
37 | @@ -130,7 +129,7 @@ | |||
38 | 130 | 'move_type': 'one', # direct | 129 | 'move_type': 'one', # direct |
39 | 131 | 'state': 'draft', | 130 | 'state': 'draft', |
40 | 132 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), | 131 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), |
42 | 133 | 'address_id': claim.partner_address_id.id, | 132 | 'partner_id': claim.partner_id.id, |
43 | 134 | 'invoice_state': "none", | 133 | 'invoice_state': "none", |
44 | 135 | 'company_id': claim.company_id.id, | 134 | 'company_id': claim.company_id.id, |
45 | 136 | 'location_id': wizard.claim_line_source_location.id, | 135 | 'location_id': wizard.claim_line_source_location.id, |
46 | @@ -150,7 +149,7 @@ | |||
47 | 150 | 'product_id': wizard_claim_line.product_id.id, | 149 | 'product_id': wizard_claim_line.product_id.id, |
48 | 151 | 'product_qty': wizard_claim_line.product_returned_quantity, | 150 | 'product_qty': wizard_claim_line.product_returned_quantity, |
49 | 152 | 'product_uom': wizard_claim_line.product_id.uom_id.id, | 151 | 'product_uom': wizard_claim_line.product_id.uom_id.id, |
51 | 153 | 'address_id': claim.partner_address_id.id, | 152 | 'partner_id': claim.partner_id.id, |
52 | 154 | 'prodlot_id': wizard_claim_line.prodlot_id.id, | 153 | 'prodlot_id': wizard_claim_line.prodlot_id.id, |
53 | 155 | # 'tracking_id': | 154 | # 'tracking_id': |
54 | 156 | 'picking_id': picking_id, | 155 | 'picking_id': picking_id, |
55 | 157 | 156 | ||
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 | 93 | 'move_type': 'one', # direct | 93 | 'move_type': 'one', # direct |
61 | 94 | 'state': 'draft', | 94 | 'state': 'draft', |
62 | 95 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), | 95 | 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), |
64 | 96 | 'address_id': prev_picking.address_id.id, | 96 | 'partner_id': prev_picking.partner_id.id, |
65 | 97 | 'invoice_state': "none", | 97 | 'invoice_state': "none", |
66 | 98 | 'company_id': prev_picking.company_id.id, | 98 | 'company_id': prev_picking.company_id.id, |
67 | 99 | 'location_id': wizard.picking_line_source_location.id, | 99 | 'location_id': wizard.picking_line_source_location.id, |
68 | @@ -112,7 +112,7 @@ | |||
69 | 112 | 'product_id': wizard_picking_line.product_id.id, | 112 | 'product_id': wizard_picking_line.product_id.id, |
70 | 113 | 'product_qty': wizard_picking_line.product_qty, | 113 | 'product_qty': wizard_picking_line.product_qty, |
71 | 114 | 'product_uom': wizard_picking_line.product_uom.id, | 114 | 'product_uom': wizard_picking_line.product_uom.id, |
73 | 115 | 'address_id': prev_picking.address_id.id, | 115 | 'partner_id': prev_picking.partner_id.id, |
74 | 116 | 'prodlot_id': wizard_picking_line.prodlot_id.id, | 116 | 'prodlot_id': wizard_picking_line.prodlot_id.id, |
75 | 117 | # 'tracking_id': | 117 | # 'tracking_id': |
76 | 118 | 'picking_id': picking_id, | 118 | 'picking_id': picking_id, |
77 | 119 | 119 | ||
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 | 31 | _columns = { | 31 | _columns = { |
83 | 32 | 'exchange_line_ids' : fields.many2many('temp.exchange.line', string='Selected exchange lines'), | 32 | 'exchange_line_ids' : fields.many2many('temp.exchange.line', string='Selected exchange lines'), |
84 | 33 | } | 33 | } |
86 | 34 | 34 | ||
87 | 35 | # Get selected lines to add to picking in | 35 | # Get selected lines to add to picking in |
88 | 36 | def _get_selected_lines(self, cr, uid,context): | 36 | def _get_selected_lines(self, cr, uid,context): |
89 | 37 | exchange_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['product_exchange_ids'])['product_exchange_ids'] | 37 | 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 | 46 | 'returned_prodlot_id' : line.returned_product_serial.id, | 46 | 'returned_prodlot_id' : line.returned_product_serial.id, |
92 | 47 | 'replacement_product_id': line.replacement_product.id, | 47 | 'replacement_product_id': line.replacement_product.id, |
93 | 48 | 'replacement_product_quantity' : line.replacement_product_qty, | 48 | 'replacement_product_quantity' : line.replacement_product_qty, |
95 | 49 | 'replacement_prodlot_id': line.replacement_product_serial.id, | 49 | 'replacement_prodlot_id': line.replacement_product_serial.id, |
96 | 50 | })) | 50 | })) |
99 | 51 | return M2M | 51 | return M2M |
100 | 52 | 52 | ||
101 | 53 | _defaults = { | 53 | _defaults = { |
102 | 54 | 'exchange_line_ids': _get_selected_lines, | 54 | 'exchange_line_ids': _get_selected_lines, |
104 | 55 | } | 55 | } |
105 | 56 | 56 | ||
106 | 57 | # If "Cancel" button pressed | 57 | # If "Cancel" button pressed |
107 | 58 | def action_cancel(self,cr,uid,ids,conect=None): | 58 | def action_cancel(self,cr,uid,ids,conect=None): |
108 | @@ -70,13 +70,13 @@ | |||
109 | 70 | 'move_type': 'one', # direct | 70 | 'move_type': 'one', # direct |
110 | 71 | 'state': 'draft', | 71 | 'state': 'draft', |
111 | 72 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), | 72 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
113 | 73 | 'address_id': claim_id.partner_address_id.id, | 73 | 'partner_id': claim_id.partner_id.id, |
114 | 74 | 'invoice_state': "none", | 74 | 'invoice_state': "none", |
115 | 75 | 'company_id': claim_id.company_id.id, | 75 | 'company_id': claim_id.company_id.id, |
116 | 76 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), | 76 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), |
117 | 77 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], | 77 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], |
118 | 78 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, | 78 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, |
120 | 79 | 'note' : 'RMA picking in', | 79 | 'note' : 'RMA picking in', |
121 | 80 | }) | 80 | }) |
122 | 81 | # Create picking lines | 81 | # Create picking lines |
123 | 82 | for exchange_line in exchange_lines.exchange_line_ids: | 82 | for exchange_line in exchange_lines.exchange_line_ids: |
124 | @@ -89,7 +89,7 @@ | |||
125 | 89 | 'product_id': exchange_line.replacement_product_id.id, | 89 | 'product_id': exchange_line.replacement_product_id.id, |
126 | 90 | 'product_qty': exchange_line.replacement_product_quantity, | 90 | 'product_qty': exchange_line.replacement_product_quantity, |
127 | 91 | 'product_uom': exchange_line.replacement_product_id.uom_id.id, | 91 | 'product_uom': exchange_line.replacement_product_id.uom_id.id, |
129 | 92 | 'address_id': claim_id.partner_address_id.id, | 92 | 'partner_id': claim_id.partner_id.id, |
130 | 93 | 'prodlot_id': exchange_line.replacement_prodlot_id, | 93 | 'prodlot_id': exchange_line.replacement_prodlot_id, |
131 | 94 | # 'tracking_id': | 94 | # 'tracking_id': |
132 | 95 | 'picking_id': picking_id, | 95 | 'picking_id': picking_id, |
133 | @@ -99,7 +99,7 @@ | |||
134 | 99 | 'company_id': claim_id.company_id.id, | 99 | 'company_id': claim_id.company_id.id, |
135 | 100 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], | 100 | 'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0], |
136 | 101 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, | 101 | 'location_dest_id': claim_id.partner_id.property_stock_customer.id, |
138 | 102 | 'note': 'RMA Refound', | 102 | 'note': 'RMA Refound', |
139 | 103 | }) | 103 | }) |
140 | 104 | view = { | 104 | view = { |
141 | 105 | 'name': 'Customer Picking OUT', | 105 | 'name': 'Customer Picking OUT', |
142 | @@ -110,7 +110,7 @@ | |||
143 | 110 | 'type': 'ir.actions.act_window', | 110 | 'type': 'ir.actions.act_window', |
144 | 111 | } | 111 | } |
145 | 112 | return view | 112 | return view |
147 | 113 | 113 | ||
148 | 114 | picking_out_from_exchange_lines() | 114 | picking_out_from_exchange_lines() |
149 | 115 | 115 | ||
150 | 116 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 116 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
151 | 117 | 117 | ||
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 | 32 | 'claim_line_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", select=True), | 32 | 'claim_line_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", select=True), |
157 | 33 | 'claim_line_ids' : fields.many2many('temp.claim.line',string='Selected return lines'), | 33 | 'claim_line_ids' : fields.many2many('temp.claim.line',string='Selected return lines'), |
158 | 34 | } | 34 | } |
160 | 35 | 35 | ||
161 | 36 | # Get selected lines to add to picking in | 36 | # Get selected lines to add to picking in |
162 | 37 | def _get_selected_lines(self, cr, uid,context): | 37 | def _get_selected_lines(self, cr, uid,context): |
163 | 38 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] | 38 | 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 | 53 | # Get default destination location | 53 | # Get default destination location |
166 | 54 | def _get_dest_loc(self, cr, uid,context): | 54 | def _get_dest_loc(self, cr, uid,context): |
167 | 55 | return self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0] | 55 | return self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0] |
169 | 56 | 56 | ||
170 | 57 | _defaults = { | 57 | _defaults = { |
171 | 58 | 'claim_line_ids': _get_selected_lines, | 58 | 'claim_line_ids': _get_selected_lines, |
172 | 59 | 'claim_line_location' : _get_dest_loc, | 59 | 'claim_line_location' : _get_dest_loc, |
175 | 60 | } | 60 | } |
176 | 61 | 61 | ||
177 | 62 | # If "Cancel" button pressed | 62 | # If "Cancel" button pressed |
178 | 63 | def action_cancel(self,cr,uid,ids,conect=None): | 63 | def action_cancel(self,cr,uid,ids,conect=None): |
179 | 64 | return {'type': 'ir.actions.act_window_close',} | 64 | return {'type': 'ir.actions.act_window_close',} |
180 | @@ -84,7 +84,7 @@ | |||
181 | 84 | 'move_type': 'one', # direct | 84 | 'move_type': 'one', # direct |
182 | 85 | 'state': 'draft', | 85 | 'state': 'draft', |
183 | 86 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), | 86 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
185 | 87 | 'address_id': claim_id.partner_address_id.id, | 87 | 'partner_id': claim_id.partner_id.id, |
186 | 88 | 'invoice_state': "none", | 88 | 'invoice_state': "none", |
187 | 89 | 'company_id': claim_id.company_id.id, | 89 | 'company_id': claim_id.company_id.id, |
188 | 90 | 'location_id': location, | 90 | 'location_id': location, |
189 | @@ -103,7 +103,7 @@ | |||
190 | 103 | 'product_id': picking_line.product_id.id, | 103 | 'product_id': picking_line.product_id.id, |
191 | 104 | 'product_qty': picking_line.product_returned_quantity, | 104 | 'product_qty': picking_line.product_returned_quantity, |
192 | 105 | 'product_uom': picking_line.product_id.uom_id.id, | 105 | 'product_uom': picking_line.product_id.uom_id.id, |
194 | 106 | 'address_id': claim_id.partner_address_id.id, | 106 | 'partner_id': claim_id.partner_id.id, |
195 | 107 | 'prodlot_id': picking_line.prodlot_id.id, | 107 | 'prodlot_id': picking_line.prodlot_id.id, |
196 | 108 | # 'tracking_id': | 108 | # 'tracking_id': |
197 | 109 | 'picking_id': picking_id, | 109 | 'picking_id': picking_id, |
198 | @@ -125,7 +125,7 @@ | |||
199 | 125 | 'res_model': 'stock.picking', | 125 | 'res_model': 'stock.picking', |
200 | 126 | 'type': 'ir.actions.act_window', | 126 | 'type': 'ir.actions.act_window', |
201 | 127 | } | 127 | } |
203 | 128 | 128 | ||
204 | 129 | picking_in_from_returned_lines() | 129 | picking_in_from_returned_lines() |
205 | 130 | 130 | ||
206 | 131 | # Class to create a picking out from selected return lines | 131 | # Class to create a picking out from selected return lines |
207 | @@ -135,7 +135,7 @@ | |||
208 | 135 | _columns = { | 135 | _columns = { |
209 | 136 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), | 136 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), |
210 | 137 | } | 137 | } |
212 | 138 | 138 | ||
213 | 139 | # Get selected lines to add to picking in | 139 | # Get selected lines to add to picking in |
214 | 140 | def _get_selected_lines(self, cr, uid,context): | 140 | def _get_selected_lines(self, cr, uid,context): |
215 | 141 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] | 141 | 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 | 151 | 'prodlot_id' : line.prodlot_id.id, | 151 | 'prodlot_id' : line.prodlot_id.id, |
218 | 152 | 'price_unit' : line.unit_sale_price, | 152 | 'price_unit' : line.unit_sale_price, |
219 | 153 | })) | 153 | })) |
222 | 154 | return M2M | 154 | return M2M |
223 | 155 | 155 | ||
224 | 156 | _defaults = { | 156 | _defaults = { |
225 | 157 | 'claim_line_ids': _get_selected_lines, | 157 | 'claim_line_ids': _get_selected_lines, |
227 | 158 | } | 158 | } |
228 | 159 | 159 | ||
229 | 160 | # If "Cancel" button pressed | 160 | # If "Cancel" button pressed |
230 | 161 | def action_cancel(self,cr,uid,ids,context=None): | 161 | def action_cancel(self,cr,uid,ids,context=None): |
231 | @@ -180,7 +180,7 @@ | |||
232 | 180 | 'move_type': 'one', # direct | 180 | 'move_type': 'one', # direct |
233 | 181 | 'state': 'draft', | 181 | 'state': 'draft', |
234 | 182 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), | 182 | 'date': time.strftime('%Y-%m-%d %H:%M:%S'), |
236 | 183 | 'address_id': claim_id.partner_address_id.id, | 183 | 'partner_id': claim_id.partner_id.id, |
237 | 184 | 'invoice_state': "none", | 184 | 'invoice_state': "none", |
238 | 185 | 'company_id': claim_id.company_id.id, | 185 | 'company_id': claim_id.company_id.id, |
239 | 186 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), | 186 | # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True), |
240 | @@ -200,7 +200,7 @@ | |||
241 | 200 | 'product_id': picking_line.product_id.id, | 200 | 'product_id': picking_line.product_id.id, |
242 | 201 | 'product_qty': picking_line.product_returned_quantity, | 201 | 'product_qty': picking_line.product_returned_quantity, |
243 | 202 | 'product_uom': picking_line.product_id.uom_id.id, | 202 | 'product_uom': picking_line.product_id.uom_id.id, |
245 | 203 | 'address_id': claim_id.partner_address_id.id, | 203 | 'partner_id': claim_id.partner_id.id, |
246 | 204 | 'prodlot_id': picking_line.prodlot_id.id, | 204 | 'prodlot_id': picking_line.prodlot_id.id, |
247 | 205 | # 'tracking_id': | 205 | # 'tracking_id': |
248 | 206 | 'picking_id': picking_id, | 206 | 'picking_id': picking_id, |
249 | 207 | 207 | ||
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 | 31 | 'refund_journal' : fields.many2one('account.journal', 'Refund journal', select=True), | 31 | 'refund_journal' : fields.many2one('account.journal', 'Refund journal', select=True), |
255 | 32 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), | 32 | 'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'), |
256 | 33 | } | 33 | } |
258 | 34 | 34 | ||
259 | 35 | # Get selected lines to add to picking in | 35 | # Get selected lines to add to picking in |
260 | 36 | def _get_selected_lines(self, cr, uid,context): | 36 | def _get_selected_lines(self, cr, uid,context): |
261 | 37 | returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] | 37 | 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 | 47 | 'prodlot_id' : line.prodlot_id.id, | 47 | 'prodlot_id' : line.prodlot_id.id, |
264 | 48 | 'price_unit' : line.unit_sale_price, | 48 | 'price_unit' : line.unit_sale_price, |
265 | 49 | })) | 49 | })) |
267 | 50 | return M2M | 50 | return M2M |
268 | 51 | 51 | ||
269 | 52 | # Get default journal | 52 | # Get default journal |
270 | 53 | def _get_journal(self, cr, uid,context): | 53 | def _get_journal(self, cr, uid,context): |
271 | 54 | #('company_id','=',claim_id.company_id.id) | 54 | #('company_id','=',claim_id.company_id.id) |
272 | 55 | # ,('refund_journal','=','True') | 55 | # ,('refund_journal','=','True') |
273 | 56 | return self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')],limit=1)[0] | 56 | return self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')],limit=1)[0] |
275 | 57 | 57 | ||
276 | 58 | _defaults = { | 58 | _defaults = { |
277 | 59 | 'claim_line_ids': _get_selected_lines, | 59 | 'claim_line_ids': _get_selected_lines, |
278 | 60 | 'refund_journal' : _get_journal, | 60 | 'refund_journal' : _get_journal, |
280 | 61 | } | 61 | } |
281 | 62 | 62 | ||
282 | 63 | # On "Cancel" button | 63 | # On "Cancel" button |
283 | 64 | def action_cancel(self,cr,uid,ids,context=None): | 64 | def action_cancel(self,cr,uid,ids,context=None): |
284 | @@ -85,22 +85,22 @@ | |||
285 | 85 | 'reference_type': 'none', | 85 | 'reference_type': 'none', |
286 | 86 | 'date_invoice': time.strftime('%Y-%m-%d %H:%M:%S'), | 86 | 'date_invoice': time.strftime('%Y-%m-%d %H:%M:%S'), |
287 | 87 | # 'date_due': | 87 | # 'date_due': |
290 | 88 | 'address_contact_id' : claim_id.partner_address_id.id, | 88 | 'partner_id' : claim_id.partner_id.id, |
291 | 89 | 'address_invoice_id' : claim_id.partner_address_id.id, | 89 | 'commercial_partner_id' : claim_id.partner_id.id, |
292 | 90 | 'account_id' : claim_id.partner_id.property_account_receivable.id, | 90 | 'account_id' : claim_id.partner_id.property_account_receivable.id, |
293 | 91 | 'currency_id' : claim_id.company_id.currency_id.id, # from invoice ??? | 91 | 'currency_id' : claim_id.company_id.currency_id.id, # from invoice ??? |
294 | 92 | 'journal_id' : refund.refund_journal.id, | 92 | 'journal_id' : refund.refund_journal.id, |
295 | 93 | 'company_id' : claim_id.company_id.id, | 93 | 'company_id' : claim_id.company_id.id, |
296 | 94 | 'comment' : 'RMA Refund', | 94 | 'comment' : 'RMA Refund', |
297 | 95 | 'claim_id': claim_id.id, | 95 | 'claim_id': claim_id.id, |
301 | 96 | }) | 96 | }) |
302 | 97 | # Create invoice lines | 97 | # Create invoice lines |
303 | 98 | for refund_line in refund.claim_line_ids: | 98 | for refund_line in refund.claim_line_ids: |
304 | 99 | if refund_line.invoice_id: | 99 | if refund_line.invoice_id: |
305 | 100 | invoice_line_id = self.pool.get('account.invoice.line').create(cr, uid, { | 100 | invoice_line_id = self.pool.get('account.invoice.line').create(cr, uid, { |
306 | 101 | 'name' : refund_line.product_id.name_template, | 101 | 'name' : refund_line.product_id.name_template, |
309 | 102 | 'origin' : claim_id.sequence, | 102 | 'origin' : claim_id.sequence, |
310 | 103 | 'invoice_id' : invoice_id, | 103 | 'invoice_id' : invoice_id, |
311 | 104 | 'uos_id' : refund_line.product_id.uom_id.id, | 104 | 'uos_id' : refund_line.product_id.uom_id.id, |
312 | 105 | 'product_id':refund_line.product_id.id, | 105 | 'product_id':refund_line.product_id.id, |
313 | 106 | 'account_id': claim_id.partner_id.property_account_receivable.id, # refund_line.product_id.property_account_expense.id, | 106 | 'account_id': claim_id.partner_id.property_account_receivable.id, # refund_line.product_id.property_account_expense.id, |
314 | @@ -111,7 +111,7 @@ | |||
315 | 111 | # 'account_analytic_id': | 111 | # 'account_analytic_id': |
316 | 112 | 'company_id' : claim_id.company_id.id, | 112 | 'company_id' : claim_id.company_id.id, |
317 | 113 | 'partner_id' : refund_line.invoice_id.partner_id.id, | 113 | 'partner_id' : refund_line.invoice_id.partner_id.id, |
319 | 114 | 'note': 'RMA Refund', | 114 | 'note': 'RMA Refund', |
320 | 115 | }) | 115 | }) |
321 | 116 | else: | 116 | else: |
322 | 117 | raise osv.except_osv(_('Error !'), _('Cannot find any invoice for the return line!')) | 117 | raise osv.except_osv(_('Error !'), _('Cannot find any invoice for the return line!')) |
323 | @@ -123,7 +123,7 @@ | |||
324 | 123 | 'res_model': 'account.invoice', | 123 | 'res_model': 'account.invoice', |
325 | 124 | 'type': 'ir.actions.act_window', | 124 | 'type': 'ir.actions.act_window', |
326 | 125 | } | 125 | } |
328 | 126 | 126 | ||
329 | 127 | refund_from_returned_lines() | 127 | refund_from_returned_lines() |
330 | 128 | 128 | ||
331 | 129 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 129 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
+ some fixes about views links.