← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~camptocamp/openerp-rma/7.0-updates into lp:~savoirfairelinux-openerp/openerp-rma/7.0-fix-reference-to-res-partner-address

 

Romain Deheele - Camptocamp has proposed merging lp:~camptocamp/openerp-rma/7.0-updates into lp:~savoirfairelinux-openerp/openerp-rma/7.0-fix-reference-to-res-partner-address.

Requested reviews:
  Savoir-faire Linux' OpenERP (savoirfairelinux-openerp)

For more details, see:
https://code.launchpad.net/~camptocamp/openerp-rma/7.0-updates/+merge/180854

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
-- 
https://code.launchpad.net/~camptocamp/openerp-rma/7.0-updates/+merge/180854
Your team Savoir-faire Linux' OpenERP is requested to review the proposed merge of lp:~camptocamp/openerp-rma/7.0-updates into lp:~savoirfairelinux-openerp/openerp-rma/7.0-fix-reference-to-res-partner-address.
=== modified file 'crm_claim_rma/crm_claim_rma_view.xml'
--- crm_claim_rma/crm_claim_rma_view.xml	2013-05-01 20:32:16 +0000
+++ crm_claim_rma/crm_claim_rma_view.xml	2013-08-19 12:18:10 +0000
@@ -323,15 +323,17 @@
         res_model="account.invoice" 
         src_model="crm.claim"/> 
 <!-- Right side link to picking in --> 
-        <act_window  
-        domain="[('type', '=', 'in'),('partner_id', 'in', [partner_id])]"
+        <act_window
+        context="{'search_default_partner_id': [partner_id]}"
+        domain="[('type', '=', 'in')]"
         id="act_crm_claim_rma_picking_in" 
         name="Partner picking IN" 
         res_model="stock.picking" 
         src_model="crm.claim"/>  
 <!-- Right side link to picking out -->
         <act_window 
-        domain="[('type', '=', 'out'),('partner_id', 'in', [partner_id])]"
+        context="{'search_default_partner_id': [partner_id]}"
+        domain="[('type', '=', 'out')]"
         id="act_crm_claim_rma_picking_out" 
         name="Partner picking OUT" 
         res_model="stock.picking" 

=== modified file 'crm_claim_rma/wizard/claim_make_picking.py'
--- crm_claim_rma/wizard/claim_make_picking.py	2012-10-11 18:31:50 +0000
+++ crm_claim_rma/wizard/claim_make_picking.py	2013-08-19 12:18:10 +0000
@@ -116,7 +116,6 @@
             view_name = 'stock.picking.in.form'
         view_id = view_obj.search(cr, uid, [
                                             ('xml_id', '=', view_xml_id),
-                                            ('model', '=', 'stock.picking'),
                                             ('type', '=', 'form'),
                                             ('name', '=', view_name)
                                             ], context=context)[0]
@@ -130,7 +129,7 @@
                     'move_type': 'one', # direct
                     'state': 'draft',
                     'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
-                    'address_id': claim.partner_address_id.id,
+                    'partner_id': claim.partner_id.id,
                     'invoice_state': "none",
                     'company_id': claim.company_id.id,
                     'location_id': wizard.claim_line_source_location.id,
@@ -150,7 +149,7 @@
                     'product_id': wizard_claim_line.product_id.id,
                     'product_qty': wizard_claim_line.product_returned_quantity,
                     'product_uom': wizard_claim_line.product_id.uom_id.id,
-                    'address_id': claim.partner_address_id.id,
+                    'partner_id': claim.partner_id.id,
                     'prodlot_id': wizard_claim_line.prodlot_id.id,
                     # 'tracking_id':
                     'picking_id': picking_id,

=== modified file 'crm_claim_rma/wizard/claim_make_picking_from_picking.py'
--- crm_claim_rma/wizard/claim_make_picking_from_picking.py	2012-09-19 16:25:16 +0000
+++ crm_claim_rma/wizard/claim_make_picking_from_picking.py	2013-08-19 12:18:10 +0000
@@ -93,7 +93,7 @@
                     'move_type': 'one', # direct
                     'state': 'draft',
                     'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
-                    'address_id': prev_picking.address_id.id,
+                    'partner_id': prev_picking.partner_id.id,
                     'invoice_state': "none",
                     'company_id': prev_picking.company_id.id,
                     'location_id': wizard.picking_line_source_location.id,
@@ -112,7 +112,7 @@
                     'product_id': wizard_picking_line.product_id.id,
                     'product_qty': wizard_picking_line.product_qty,
                     'product_uom': wizard_picking_line.product_uom.id,
-                    'address_id': prev_picking.address_id.id,
+                    'partner_id': prev_picking.partner_id.id,
                     'prodlot_id': wizard_picking_line.prodlot_id.id,
                     # 'tracking_id':
                     'picking_id': picking_id,

=== modified file 'crm_claim_rma/wizard/picking_from_exchange_lines.py'
--- crm_claim_rma/wizard/picking_from_exchange_lines.py	2012-08-28 12:57:05 +0000
+++ crm_claim_rma/wizard/picking_from_exchange_lines.py	2013-08-19 12:18:10 +0000
@@ -31,7 +31,7 @@
     _columns = {
         'exchange_line_ids' : fields.many2many('temp.exchange.line', string='Selected exchange lines'),
     }
-    
+
     # Get selected lines to add to picking in
     def _get_selected_lines(self, cr, uid,context):
         exchange_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['product_exchange_ids'])['product_exchange_ids'] 
@@ -46,13 +46,13 @@
 					    'returned_prodlot_id' : line.returned_product_serial.id,
 					    'replacement_product_id': line.replacement_product.id,
                         'replacement_product_quantity' : line.replacement_product_qty,
-                        'replacement_prodlot_id': line.replacement_product_serial.id,        
+                        'replacement_prodlot_id': line.replacement_product_serial.id,
 				    }))
-        return M2M    
-   
+        return M2M
+
     _defaults = {
         'exchange_line_ids': _get_selected_lines,
-    }    
+    }
 
     # If "Cancel" button pressed
     def action_cancel(self,cr,uid,ids,conect=None):
@@ -70,13 +70,13 @@
                         'move_type': 'one', # direct
                         'state': 'draft',
                         'date': time.strftime('%Y-%m-%d %H:%M:%S'),
-                        'address_id': claim_id.partner_address_id.id,
+                        'partner_id': claim_id.partner_id.id,
                         'invoice_state': "none",
                         'company_id': claim_id.company_id.id,
                         # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True),
                         'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0],
                         'location_dest_id': claim_id.partner_id.property_stock_customer.id,
-					    'note' : 'RMA picking in',                        
+					    'note' : 'RMA picking in',
 				    })
 		    # Create picking lines
             for exchange_line in exchange_lines.exchange_line_ids:
@@ -89,7 +89,7 @@
 					    'product_id': exchange_line.replacement_product_id.id,
 					    'product_qty': exchange_line.replacement_product_quantity,
 					    'product_uom': exchange_line.replacement_product_id.uom_id.id,
-					    'address_id': claim_id.partner_address_id.id,
+					    'partner_id': claim_id.partner_id.id,
 					    'prodlot_id': exchange_line.replacement_prodlot_id,
 					    # 'tracking_id': 
 					    'picking_id': picking_id,
@@ -99,7 +99,7 @@
 					    'company_id': claim_id.company_id.id,
 					    'location_id': self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0],
 					    'location_dest_id': claim_id.partner_id.property_stock_customer.id,
-					    'note': 'RMA Refound',                        
+					    'note': 'RMA Refound',
 				    })
         view = {
             'name': 'Customer Picking OUT',
@@ -110,7 +110,7 @@
             'type': 'ir.actions.act_window',
         }
         return view
-                              
+
 picking_out_from_exchange_lines()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'crm_claim_rma/wizard/picking_from_returned_lines.py'
--- crm_claim_rma/wizard/picking_from_returned_lines.py	2012-09-12 09:29:21 +0000
+++ crm_claim_rma/wizard/picking_from_returned_lines.py	2013-08-19 12:18:10 +0000
@@ -32,7 +32,7 @@
         'claim_line_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", select=True),
         'claim_line_ids' : fields.many2many('temp.claim.line',string='Selected return lines'),
     }
-    
+
     # Get selected lines to add to picking in
     def _get_selected_lines(self, cr, uid,context):
         returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] 
@@ -53,12 +53,12 @@
     # Get default destination location
     def _get_dest_loc(self, cr, uid,context):
         return self.pool.get('stock.warehouse').read(cr, uid, [1],['lot_input_id'])[0]['lot_input_id'][0]  
-           
+
     _defaults = {
         'claim_line_ids': _get_selected_lines,
         'claim_line_location' : _get_dest_loc,
-    }    
-        
+    }
+
     # If "Cancel" button pressed
     def action_cancel(self,cr,uid,ids,conect=None):
         return {'type': 'ir.actions.act_window_close',}
@@ -84,7 +84,7 @@
                         'move_type': 'one', # direct
                         'state': 'draft',
                         'date': time.strftime('%Y-%m-%d %H:%M:%S'),
-                        'address_id': claim_id.partner_address_id.id,
+                        'partner_id': claim_id.partner_id.id,
                         'invoice_state': "none",
                         'company_id': claim_id.company_id.id,
                         'location_id': location,
@@ -103,7 +103,7 @@
                         'product_id': picking_line.product_id.id,
                         'product_qty': picking_line.product_returned_quantity,
                         'product_uom': picking_line.product_id.uom_id.id,
-                        'address_id': claim_id.partner_address_id.id,
+                        'partner_id': claim_id.partner_id.id,
                         'prodlot_id': picking_line.prodlot_id.id,
                         # 'tracking_id': 
                         'picking_id': picking_id,
@@ -125,7 +125,7 @@
             'res_model': 'stock.picking',
             'type': 'ir.actions.act_window',
         }
-                              
+
 picking_in_from_returned_lines()
 
 # Class to create a picking out from selected return lines
@@ -135,7 +135,7 @@
     _columns = {
         'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'),
     }
-    
+
     # Get selected lines to add to picking in
     def _get_selected_lines(self, cr, uid,context):
         returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] 
@@ -151,11 +151,11 @@
                         'prodlot_id' :  line.prodlot_id.id,
                         'price_unit' :  line.unit_sale_price,
                     }))
-        return M2M    
-   
+        return M2M
+
     _defaults = {
         'claim_line_ids': _get_selected_lines,
-    }    
+    }
 
     # If "Cancel" button pressed
     def action_cancel(self,cr,uid,ids,context=None):
@@ -180,7 +180,7 @@
                         'move_type': 'one', # direct
                         'state': 'draft',
                         'date': time.strftime('%Y-%m-%d %H:%M:%S'),
-                        'address_id': claim_id.partner_address_id.id,
+                        'partner_id': claim_id.partner_id.id,
                         'invoice_state': "none",
                         'company_id': claim_id.company_id.id,
                         # 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True),
@@ -200,7 +200,7 @@
                         'product_id': picking_line.product_id.id,
                         'product_qty': picking_line.product_returned_quantity,
                         'product_uom': picking_line.product_id.uom_id.id,
-                        'address_id': claim_id.partner_address_id.id,
+                        'partner_id': claim_id.partner_id.id,
                         'prodlot_id': picking_line.prodlot_id.id,
                         # 'tracking_id': 
                         'picking_id': picking_id,

=== modified file 'crm_claim_rma/wizard/refund_from_returned_lines.py'
--- crm_claim_rma/wizard/refund_from_returned_lines.py	2012-09-03 10:06:46 +0000
+++ crm_claim_rma/wizard/refund_from_returned_lines.py	2013-08-19 12:18:10 +0000
@@ -31,7 +31,7 @@
         'refund_journal' : fields.many2one('account.journal', 'Refund journal', select=True),
         'claim_line_ids' : fields.many2many('temp.claim.line', string='Selected return lines'),
     }
-    
+
     # Get selected lines to add to picking in
     def _get_selected_lines(self, cr, uid,context):
         returned_line_ids = self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['claim_line_ids'])['claim_line_ids'] 
@@ -47,18 +47,18 @@
                         'prodlot_id' : line.prodlot_id.id,
                         'price_unit' :  line.unit_sale_price,
                     }))
-        return M2M    
+        return M2M
 
     # Get default journal
     def _get_journal(self, cr, uid,context):
         #('company_id','=',claim_id.company_id.id)
         # ,('refund_journal','=','True')
         return self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')],limit=1)[0] 
-   
+
     _defaults = {
         'claim_line_ids': _get_selected_lines,
         'refund_journal' : _get_journal,
-    }    
+    }
 
     # On "Cancel" button
     def action_cancel(self,cr,uid,ids,context=None):
@@ -85,22 +85,22 @@
                         'reference_type': 'none',
                         'date_invoice': time.strftime('%Y-%m-%d %H:%M:%S'),
                         # 'date_due':
-                        'address_contact_id' : claim_id.partner_address_id.id,
-                        'address_invoice_id' : claim_id.partner_address_id.id,
+                        'partner_id' : claim_id.partner_id.id,
+                        'commercial_partner_id' : claim_id.partner_id.id,
                         'account_id' : claim_id.partner_id.property_account_receivable.id,
                         'currency_id' : claim_id.company_id.currency_id.id, # from invoice ???
                         'journal_id' : refund.refund_journal.id,
                         'company_id' : claim_id.company_id.id,
                         'comment' : 'RMA Refund',
                         'claim_id': claim_id.id,
-                    })                    
-            # Create invoice lines        
-            for refund_line in refund.claim_line_ids:             
+                    })
+            # Create invoice lines
+            for refund_line in refund.claim_line_ids:
                 if refund_line.invoice_id:
                     invoice_line_id = self.pool.get('account.invoice.line').create(cr, uid, {
                         'name' : refund_line.product_id.name_template,
-                        'origin' : claim_id.sequence,                        
-                        'invoice_id' : invoice_id,                        
+                        'origin' : claim_id.sequence,
+                        'invoice_id' : invoice_id,
                         'uos_id' : refund_line.product_id.uom_id.id,
                         'product_id':refund_line.product_id.id,
                         'account_id': claim_id.partner_id.property_account_receivable.id, # refund_line.product_id.property_account_expense.id,
@@ -111,7 +111,7 @@
 #                        'account_analytic_id':
                         'company_id' : claim_id.company_id.id,
                         'partner_id' : refund_line.invoice_id.partner_id.id,
-                        'note': 'RMA Refund',                        
+                        'note': 'RMA Refund',
                         })
                 else:
                     raise osv.except_osv(_('Error !'), _('Cannot find any invoice for the return line!'))
@@ -123,7 +123,7 @@
             'res_model': 'account.invoice',
             'type': 'ir.actions.act_window',
         }
-                      
+
 refund_from_returned_lines()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


Follow ups