← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/openerp-rma/7.0-improvement-cleaning-jge into lp:openerp-rma

 

Joël Grand-Guillaume @ camptocamp has proposed merging lp:~camptocamp/openerp-rma/7.0-improvement-cleaning-jge into lp:openerp-rma.

Commit message:
[MIGR] Migrate the crm_claim_rma to version 7.0:
Split of the module in :
- crm_rma_advance_location (extract the warehouse and location additions that the original module had)
- crm_rma_lot_mass_return(extracted the mass return button to return products from serial)
- crm_claim_ext(trash bin module where land all functions that I wasn't able to restore)
Add module crm_rma_by_shop (new module that add the shop_id on claims and the according filter to work with)
[IMP] Usability improvements to match v7.0 possibilities
[IMP] Cleanup of the code, PEP8, community standards,...



Requested reviews:
  OpenERP RMA (openerprma)

For more details, see:
https://code.launchpad.net/~camptocamp/openerp-rma/7.0-improvement-cleaning-jge/+merge/195387

Hi,


Here is a first round to have those modules in the community reviewer umbrella. Quite some work still need to be done, but we now have something as a start here.

What I mainly did for this first round is:

 * Split RMA module into various module, mainly to ensure the core one working fine and make it more "generic":

   - crm_claim_rma : The core module, with returns, deliveries and refund management + better usability to fit v7.0 standards

   - crm_rma_advance_location : Where I extract the warehouse and location additions that the original module had. This module change the route taken by RMA returns and make stuff more complexes as it adds more fields. It is not required in all cases to have those complex location paths. This module still need work to be maintainable, but it works !

   - crm_rma_by_shop : A new module that add the shop_id on claims and the according filter to work with

   - crm_rma_lot_mass_return: Where I extracted the mass return button to return products from serial. This is also not a common use case, that's why I put it out. This module isn't really functional yet and still need to be ported. I marked it as installable = False to avoid people some trouble.

   - crm_claim_ext : The trash bin module where land all functions that I wasn't able to restore. If Akretion (as original author) want to, they are welcome to suggest another merge from that old code. I marked it as installable = False to avoid people some trouble.

 * Make little improvements in product_warranty module (description,...)

 * Change some behavior to be more consistent and usable: claim line know their return location, button are display in function of the context of the claim (customer, supplier), better sequence management,...

 * Review most of them to improve the code and community standards : Add all .pot files, PEP8, ...

Note that this branch already contain the work made in that branch: lp:~akretion-team/openerp-rma/claim_rma_v7

Thanks for the review !

Regards,

Joël


-- 
https://code.launchpad.net/~camptocamp/openerp-rma/7.0-improvement-cleaning-jge/+merge/195387
Your team OpenERP RMA is requested to review the proposed merge of lp:~camptocamp/openerp-rma/7.0-improvement-cleaning-jge into lp:openerp-rma.
=== modified file 'crm_claim_ext/__init__.py'
--- crm_claim_ext/__init__.py	2011-10-12 13:33:56 +0000
+++ crm_claim_ext/__init__.py	2013-11-15 13:53:46 +0000
@@ -19,5 +19,5 @@
 #You should have received a copy of the GNU General Public License      #
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
-
+import wizard
 import crm_claim_ext

=== modified file 'crm_claim_ext/__openerp__.py'
--- crm_claim_ext/__openerp__.py	2012-09-14 13:13:17 +0000
+++ crm_claim_ext/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -27,7 +27,13 @@
     'category': 'Generic Modules/CRM & SRM',
     'description': """
 Akretion - Emmanuel Samyn
-Add some fields to CRM claim : canal, spirit
+ * Add some fields to CRM claim : canal, spirit, product.exchange
+ * Forbid to return product from picking out and in by masking the button
+
+It also contain all views that weren't used when porting this module to v7.0.
+Also, all wizard that were not used anymore also landed here in the wait his original
+author (Akretion) take a decision on them.
+
     """,
     'author': 'esamyn',
     'website': 'http://www.erp-236.com',
@@ -35,10 +41,16 @@
     'init_xml': [],
     'update_xml': [
         'crm_claim_ext_view.xml',
+        'wizard/get_empty_serial_view.xml',
+#        'wizard/returned_lines_from_invoice_wizard_view.xml',
+#        'wizard/picking_from_returned_lines_wizard_view.xml',
+#        'wizard/refund_from_returned_lines_wizard_view.xml',
+#        'wizard/exchange_from_returned_lines_wizard_view.xml',
+#        'wizard/picking_from_exchange_lines_wizard_view.xml',
     ],
     'demo_xml': [], 
     'test': [], 
-    'installable': True,
+    'installable': False,
     'active': False,
     'certificate' : '',
 }

=== modified file 'crm_claim_ext/crm_claim_ext.py'
--- crm_claim_ext/crm_claim_ext.py	2011-10-12 13:33:56 +0000
+++ crm_claim_ext/crm_claim_ext.py	2013-11-15 13:53:46 +0000
@@ -36,6 +36,11 @@
     _columns = {
         'canal_id': fields.many2one('res.partner.canal', 'Channel'),
         'som': fields.many2one('res.partner.som', 'State of Mind'),
+        'product_exchange_ids': fields.one2many('product.exchange', 'claim_return_id', 'Product exchanges'),
+                # Aftersale outsourcing        
+#        'in_supplier_picking_id': fields.many2one('stock.picking', 'Return To Supplier Picking', required=False, select=True),
+#        'out_supplier_picking_id': fields.many2one('stock.picking', 'Return From Supplier Picking', required=False, select=True),
+
 
     }
 crm_claim_ext()    

=== modified file 'crm_claim_ext/crm_claim_ext_view.xml'
--- crm_claim_ext/crm_claim_ext_view.xml	2012-06-13 09:21:50 +0000
+++ crm_claim_ext/crm_claim_ext_view.xml	2013-11-15 13:53:46 +0000
@@ -33,5 +33,122 @@
             </field>
         </record>
 
+         <record id="crm_claim_rma.picking_out_form" model="ir.ui.view">
+            <field name="name">crm_claim_rma.picking_out_form</field>
+            <field name="model">stock.picking.out</field>
+            <field name="inherit_id" ref="stock.view_picking_out_form" />
+            <field name="arch" type="xml">
+<!--                If we use crm_claim_rma we should not use the old return products anymore-->
+                    <xpath expr="/form/header/button[@string='Return Products']" position="attributes">
+                        <attribute name="invisible">1</attribute>
+                    </xpath>
+            </field>
+        </record>
+
+        <record id="picking_in_form" model="ir.ui.view">
+            <field name="name">crm_claim_rma.picking_in_form</field>
+            <field name="model">stock.picking.in</field>
+            <field name="inherit_id" ref="stock.view_picking_in_form" />
+            <field name="arch" type="xml">
+<!--                If we use crm_claim_rma we should not use the old return products anymore-->
+                <xpath expr="/form/header/button[@string='Return Products']" position="attributes">
+                    <attribute name="invisible">1</attribute>
+                </xpath>
+            </field>
+        </record>
+
+        <!-- Picking follow -->
+        <!-- TREE -->
+<!--
+        <record model="ir.ui.view" id="crm_picking_follow_tree_view">
+            <field name="name">CRM - Picking follow Tree</field>
+            <field name="model">picking.follow</field>
+            <field name="arch" type="xml">
+                <tree string="Picking follows">
+                    <field name="picking_id"/>
+                    <field name="related_picking_state"/>
+                    <field name="related_picking_due_date"/>
+                    <field name="related_picking_delivered_date"/>
+                    <field name="name"/>
+                </tree>
+            </field>
+        </record>
+-->
+        <!-- FORM -->
+<!--
+        <record model="ir.ui.view" id="crm_picking_follow_form_view">
+            <field name="name">CRM - Picking follow Form</field>
+            <field name="model">picking.follow</field>
+            <field name="arch" type="xml">
+                <form string="Picking follow">
+                    <field name="picking_id"/>
+                    <field name="related_picking_state"/> 
+                    <field name="related_picking_due_date"/>
+                    <field name="related_picking_delivered_date"/> 
+                    <field name="name"/>    
+                </form>
+            </field>
+        </record>
+-->
+
+
+
+<!-- PRODUCT EXCHANGE -->
+    <!-- TREE -->
+<!--    <record model="ir.ui.view" id="crm_product_exchange_tree_view">-->
+<!--        <field name="name">CRM - Product exchange Tree</field>-->
+<!--        <field name="model">product.exchange</field>-->
+<!--        <field name="type">tree</field>-->
+<!--        <field name="arch" type="xml">-->
+<!--        <tree string="Product exchanges" editable="top" >-->
+<!--            <field name="selected"/>-->
+<!--            <field name="state"/>-->
+<!--            <field name="exchange_send_date"/>-->
+<!--            <field name="returned_product"/> -->
+<!--            <field name="returned_product_serial"/>-->
+<!--            <field name="replacement_product"/>-->
+<!--            <field name="replacement_product_serial"/>-->
+<!--            <field name="returned_value"/>-->
+<!--            <field name="replacement_value"/>-->
+<!--            <field name="name"/>    -->
+<!--        </tree>-->
+<!--        </field>-->
+<!--    </record>-->
+
+    <!-- FORM -->
+<!--    <record model="ir.ui.view" id="crm_product_exchange_form_view">-->
+<!--        <field name="name">CRM - Product exchange Form</field>-->
+<!--        <field name="model">product.exchange</field>-->
+<!--        <field name="arch" type="xml">-->
+<!--        <form string="Product exchange">-->
+<!--            <field name="state"/>-->
+<!--            <field name="exchange_send_date"/>-->
+<!--            <separator string="Returned product" colspan="2"/>-->
+<!--            <separator string="Replacement product" colspan="2"/>-->
+<!--            <field name="returned_product"/> -->
+<!--            <field name="replacement_product"/>-->
+<!--            <field name="returned_product_serial"/>-->
+<!--            <field name="replacement_product_serial"/> -->
+<!--            <field name="returned_product_qty"/>        -->
+<!--            <field name="replacement_product_qty"/>-->
+<!--            <field name="returned_unit_sale_price"/>-->
+<!--            <field name="replacement_unit_sale_price"/>-->
+<!--            <field name="returned_value"/>-->
+<!--            <field name="replacement_value"/>-->
+<!--            <separator string="Comment" colspan="2"/>-->
+<!--            <field name="name" colspan="4" nolabel="1"/>        -->
+<!--        </form>-->
+<!--        </field>-->
+<!--    </record>-->
+<!--        -->
+
+ <!-- act_window
+
+            context="{'search_default_account_id':[active_id], 'search_default_unreconciled':1, 'default_account_id': active_id}"
+            src_model="account.account"/>
+
+        <act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" 
+        name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/ -->
+        
      </data>
 </openerp>

=== added directory 'crm_claim_ext/i18n'
=== added directory 'crm_claim_ext/wizard'
=== added file 'crm_claim_ext/wizard/__init__.py'
--- crm_claim_ext/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_claim_ext/wizard/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+#import returned_lines_from_invoice
+#import picking_from_returned_lines
+#import refund_from_returned_lines
+#import exchange_from_returned_lines
+#import picking_from_exchange_lines
+from . import get_empty_serial
\ No newline at end of file

=== renamed file 'crm_claim_rma/wizard/exchange_from_returned_lines.py' => 'crm_claim_ext/wizard/exchange_from_returned_lines.py'
=== renamed file 'crm_claim_rma/wizard/exchange_from_returned_lines_wizard_view.xml' => 'crm_claim_ext/wizard/exchange_from_returned_lines_wizard_view.xml'
=== renamed file 'crm_claim_rma/wizard/get_empty_serial.py' => 'crm_claim_ext/wizard/get_empty_serial.py'
--- crm_claim_rma/wizard/get_empty_serial.py	2011-10-12 13:01:59 +0000
+++ crm_claim_ext/wizard/get_empty_serial.py	2013-11-15 13:53:46 +0000
@@ -20,10 +20,11 @@
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
 
-from osv import fields, osv
+from openerp.osv import fields, orm
 import pooler
 
-class get_empty_serial(osv.osv_memory):
+
+class get_empty_serial(orm.TransientModel):
     _name='get_empty_serial.wizard'
     _description='' # Get possible serial for this return based on claim partner, product, invoice
     _columns = {

=== renamed file 'crm_claim_rma/wizard/get_empty_serial_view.xml' => 'crm_claim_ext/wizard/get_empty_serial_view.xml'
=== renamed file 'crm_claim_rma/wizard/picking_from_exchange_lines.py' => 'crm_claim_ext/wizard/picking_from_exchange_lines.py'
=== renamed file 'crm_claim_rma/wizard/picking_from_exchange_lines_wizard_view.xml' => 'crm_claim_ext/wizard/picking_from_exchange_lines_wizard_view.xml'
=== renamed file 'crm_claim_rma/wizard/picking_from_returned_lines.py' => 'crm_claim_ext/wizard/picking_from_returned_lines.py'
=== renamed file 'crm_claim_rma/wizard/picking_from_returned_lines_wizard_view.xml' => 'crm_claim_ext/wizard/picking_from_returned_lines_wizard_view.xml'
=== renamed file 'crm_claim_rma/wizard/refund_from_returned_lines.py' => 'crm_claim_ext/wizard/refund_from_returned_lines.py'
=== renamed file 'crm_claim_rma/wizard/refund_from_returned_lines_wizard_view.xml' => 'crm_claim_ext/wizard/refund_from_returned_lines_wizard_view.xml'
=== renamed file 'crm_claim_rma/wizard/returned_lines_from_invoice.py' => 'crm_claim_ext/wizard/returned_lines_from_invoice.py'
=== renamed file 'crm_claim_rma/wizard/returned_lines_from_invoice_wizard_view.xml' => 'crm_claim_ext/wizard/returned_lines_from_invoice_wizard_view.xml'
=== modified file 'crm_claim_rma/__init__.py'
--- crm_claim_rma/__init__.py	2012-09-12 09:29:21 +0000
+++ crm_claim_rma/__init__.py	2013-11-15 13:53:46 +0000
@@ -1,28 +1,26 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau, 	#
-# Emmanuel Samyn														#
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-import wizard
-import crm_claim_rma
-import account_invoice
-import stock
-import res_company
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import wizard
+from . import crm_claim_rma
+from . import account_invoice
+from . import stock
+from . import res_company

=== modified file 'crm_claim_rma/__openerp__.py'
--- crm_claim_rma/__openerp__.py	2012-09-24 13:30:20 +0000
+++ crm_claim_rma/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -1,76 +1,65 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau,     #
-# Emmanuel Samyn, Benoît Guillot                                        #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
 {
-    'name': 'CRM Product Return',
-    'version': '1.0',
+    'name': 'RMA Claim (Product Return Management)',
+    'version': '1.1',
     'category': 'Generic Modules/CRM & SRM',
     'description': """
-Akretion - Emmanuel Samyn
-Management of Return Merchandise Authorization (RMA) in OpenERP.
-Upgrade the standard crm_claim module to add :
-* product returns (one by one, mass return by lot, mass return by invoice)
+Management of Return Merchandise Authorization (RMA)
+====================================================
+
+This module aim to improve the Claims by adding a way to manage the product returns. It
+allows you to create and manage picking from a claim. It also introduce a new object 
+the claim lines to better handle that problematic. One Claim can have several lines that concern 
+the return of differents products. It's for every of them that you'll be able to check the 
+warranty (still running or not).
+
+It mainly contain the following features:
+
+* product returns (one by one, mass return by invoice)
 * warranty control & return address (based on invoice date and product form)
 * product picking in / out
 * product refund
-* product exchange
-* access to related customer data (orders, invoices, refunds, picking in/out)
-
-THIS MODULE REPLACES Akretion stock_rma from V6.0
-    
-WARNING : To use the module in V6.1 you need a refactor of the function refund
-in the module account from the addons. You can find the refactor at the revisions 6933 and 6934
-on this branch : https://code.launchpad.net/~akretion-team/openobject-addons/openobject-addons-61-akretion
-    
-    """,
-    'author': 'esamyn',
-    'website': 'http://www.erp-236.com',
+* access to related customer data (orders, invoices, refunds, picking in/out)  from a claim
+
+Using this module make the logistic flow of return this way:
+
+* Returning product goes into Stock or Supplier location with a incoming shipment (depending
+  on the settings of the supplier info in the product form)
+* You can make a delivery from the RMA to send a new product to the Customer
+
+""",
+    'author': 'Akretion, Camptocamp',
+    'website': 'http://www.akretion.com, http://www.camptocamp.com',
     'depends': ['sale','stock','crm_claim','product_warranty'],
-    'init_xml': ['rma_data.xml',],
-    'update_xml': [
+    'data': [
                 'wizard/claim_make_picking_view.xml',
-                'wizard/claim_make_picking_from_picking_view.xml',
-                'wizard/returned_lines_from_serial_wizard_view.xml',
-#                'wizard/returned_lines_from_invoice_wizard_view.xml',
-#                'wizard/picking_from_returned_lines_wizard_view.xml',
-#                'wizard/refund_from_returned_lines_wizard_view.xml',
-#                'wizard/exchange_from_returned_lines_wizard_view.xml',
-#                'wizard/picking_from_exchange_lines_wizard_view.xml',
-                'wizard/get_empty_serial_view.xml',
                 'crm_claim_rma_view.xml',
                 'security/ir.model.access.csv',
                 'account_invoice_view.xml',
                 'stock_view.xml',
                 'res_company_view.xml',
                 'crm_claim_rma_data.xml',
-                'stock_data.xml',
- #       'report/crm_claim_report_view.xml',
     ],
-    'demo_xml': [
- #       'crm_claim_demo.xml',
-    ], 
-#    'test': ['test/test_crm_claim.yml'], 
     'images': ['images/product_return.png', 'images/claim.png','images/return_line.png','images/exchange.png'],
     'installable': True,
     'active': False,

=== modified file 'crm_claim_rma/account_invoice.py'
--- crm_claim_rma/account_invoice.py	2012-09-19 16:25:16 +0000
+++ crm_claim_rma/account_invoice.py	2013-11-15 13:53:46 +0000
@@ -1,68 +1,94 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau, 	#
-# Emmanuel Samyn, Benoît Guillot                                        #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-from osv import fields, osv
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm, osv
 from tools.translate import _
 
-class account_invoice(osv.osv):
+
+class account_invoice(orm.Model):
 
     _inherit = "account.invoice"
 
-
     _columns = {
         'claim_id': fields.many2one('crm.claim', 'Claim'),
     }
 
-    def _get_cleanup_fields(self, cr, uid, context=None):
-        fields = super(account_invoice, self)._get_cleanup_fields(cr, uid, context=context)
-        fields = fields + ('claim_line_id',)
-        return fields
-
     def _refund_cleanup_lines(self, cr, uid, lines, context=None):
+        """Override when from claim to update the quantity and link
+        to the claim line."""
         if context is None: context = {}
         new_lines = []
-        if context.get('claim_line_ids') and lines and 'product_id' in lines[0]:#check if is an invoice_line
+        # check if is an invoice_line and we are from a claim
+        if context.get('claim_line_ids') and lines and lines[0]._name =='account.invoice.line' :
             for claim_line_id in context.get('claim_line_ids'):
-                claim_info = self.pool.get('claim.line').read(cr, uid, claim_line_id[1], ['invoice_line_id', 'product_returned_quantity', 'refund_line_id'], context=context)
+                claim_info = self.pool.get('claim.line').read(cr, uid, 
+                    claim_line_id[1], 
+                    [
+                        'invoice_line_id', 
+                        'product_returned_quantity', 
+                        'refund_line_id'], 
+                    context=context)
                 if not claim_info['refund_line_id']:
-                    invoice_line_info = self.pool.get('account.invoice.line').read(cr, uid, claim_info['invoice_line_id'][0], context=context)
-                    invoice_line_info['quantity'] = claim_info['product_returned_quantity']
-                    invoice_line_info['claim_line_id'] = [claim_line_id[1]]
-                    new_lines.append(invoice_line_info)
+                #For each lines replace quantity and add clain_line_id
+                    inv_line_obj = self.pool.get('account.invoice.line')
+                    inv_line =  inv_line_obj.browse(cr, uid, 
+                            [claim_info['invoice_line_id'][0]], 
+                            context=context)[0]
+                    clean_line = {}
+                    for field in inv_line._all_columns.keys():
+                        column_type = inv_line._all_columns[field].column._type
+                        if column_type == 'many2one':
+                            clean_line[field] = inv_line[field].id
+                        elif column_type not in ['many2many','one2many']:
+                            clean_line[field] = inv_line[field]
+                        elif field == 'invoice_line_tax_id':
+                            tax_list = []
+                            for tax in inv_line[field]:
+                                tax_list.append(tax.id)
+                            clean_line[field] = [(6,0, tax_list)]
+                    clean_line['quantity'] = claim_info['product_returned_quantity']
+                    clean_line['claim_line_id'] = [claim_line_id[1]]
+                    new_lines.append(clean_line)
             if not new_lines:
-                #TODO use custom states to show button of this wizard or not instead of raise an error
-                raise osv.except_osv(_('Error !'), _('A refund has already been created for this claim !'))
-            lines = new_lines
-        result = super(account_invoice, self)._refund_cleanup_lines(cr, uid, lines, context=context)
-        return result
-
-    def _prepare_refund(self, cr, uid, *args, **kwargs):
-        result = super(account_invoice, self)._prepare_refund(cr, uid, *args, **kwargs)
-        if kwargs.get('context') and kwargs['context'].get('claim_id'):
-            result['claim_id'] = kwargs['context']['claim_id']
-        return result
-
-class account_invoice_line(osv.osv):
+                # TODO use custom states to show button of this wizard or 
+                # not instead of raise an error
+                raise osv.except_osv(_('Error !'), 
+                    _('A refund has already been created for this claim !'))
+        else:
+            return super(account_invoice, self)._refund_cleanup_lines(cr, uid, lines, context=None)
+        return map(lambda x: (0,0,x), new_lines)
+
+    def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None, 
+            description=None, journal_id=None, context=None):
+        if context is None:
+            context={}
+        result = super(account_invoice, self)._prepare_refund(cr, uid, invoice, 
+            date=date, period_id=period_id, description=description, 
+            journal_id=journal_id, context=context)
+        if context.get('claim_id'):
+            result['claim_id'] = context.get('claim_id')
+        return result
+
+
+class account_invoice_line(orm.Model):
 
     _inherit = "account.invoice.line"
 
@@ -71,7 +97,10 @@
         if vals.get('claim_line_id'):
             claim_line_id = vals['claim_line_id']
             del vals['claim_line_id']
-        line_id = super(account_invoice_line, self).create(cr, uid, vals, context=context)
+        line_id = super(account_invoice_line, self).create(cr, uid, 
+            vals, context=context)
         if claim_line_id:
-            self.pool.get('claim.line').write(cr, uid, claim_line_id, {'refund_line_id': line_id}, context=context)
+            claim_line_obj = self.pool.get('claim.line')
+            claim_line_obj.write(cr, uid, claim_line_id, 
+                {'refund_line_id': line_id}, context=context)
         return line_id

=== modified file 'crm_claim_rma/account_invoice_view.xml'
--- crm_claim_rma/account_invoice_view.xml	2013-02-22 22:40:51 +0000
+++ crm_claim_rma/account_invoice_view.xml	2013-11-15 13:53:46 +0000
@@ -1,15 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-  crm_claim_rma for OpenERP
-  Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>
-  The licence is in the file __openerp__.py
--->
-
 <openerp>
     <data>
         <!-- INHERITED VIEW FOR THE OBJECT : account_invoice -->
 
-        <record id="crm_claim_rma.invoice_form" model="ir.ui.view">
+        <record id="invoice_form" model="ir.ui.view">
             <field name="name">crm_claim_rma.invoice_form</field>
             <field name="model">account.invoice</field>
             <field name="inherit_id" ref="account.invoice_form" />

=== modified file 'crm_claim_rma/crm_claim_rma.py'
--- crm_claim_rma/crm_claim_rma.py	2013-08-19 22:20:51 +0000
+++ crm_claim_rma/crm_claim_rma.py	2013-11-15 13:53:46 +0000
@@ -1,35 +1,35 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau,     #
-# Emmanuel Samyn                            #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
 
-from openerp.osv import fields, orm
-from crm import crm
+from openerp.osv import fields, orm, osv
+# from crm import crm
 from datetime import datetime
 from dateutil.relativedelta import relativedelta
 import time
 from tools.translate import _
 from tools import DEFAULT_SERVER_DATE_FORMAT
-
-#TODO: REFACTOR IN A GENERIC MODULE 
+from tools.translate import _
+
+
 class substate_substate(orm.Model): 
     """
     To precise a state (state=refused; substates= reason 1, 2,...)
@@ -38,58 +38,124 @@
     _description = "substate that precise a given state"
     _columns = {
         'name': fields.char('Sub state', size=128, required=True),
-        'substate_descr' : fields.text('Description', help="To give more information about the sub state"), 
+        'substate_descr' : fields.text('Description', 
+            help="To give more information about the sub state"), 
         # ADD OBJECT TO FILTER
         }
 
+
 class claim_line(orm.Model):
     """
     Class to handle a product return line (corresponding to one invoice line)
     """
     _name = "claim.line"
     _description = "List of product to return"
+    
+    # Comment written in a claim.line to know about the warranty status
+    WARRANT_COMMENT = {
+        'valid': "Valid",
+        'expired': "Expired",
+        'not_define': "Not Defined"}
         
     # Method to calculate total amount of the line : qty*UP
     def _line_total_amount(self, cr, uid, ids, field_name, arg, context=None):
         res = {}
         for line in self.browse(cr,uid,ids):            
             res[line.id] = line.unit_sale_price*line.product_returned_quantity
-        return res 
+        return res
+
+    def copy_data(self, cr, uid, id, default=None, context=None):
+        if default is None:
+            default = {}
+        std_default = {
+            'move_in_id': False,
+            'move_out_id': False,
+            'refund_line_id': False,
+        }
+        std_default.update(default)
+        return super(claim_line, self).copy_data(
+            cr, uid, id, default=std_default, context=context)
         
     _columns = {
         'name': fields.char('Description', size=64,required=True),
         'claim_origine': fields.selection([('none','Not specified'),
-                                    ('legal','Legal retractation'),
-                                    ('cancellation','Order cancellation'),
-                                    ('damaged','Damaged delivered product'),                                    
-                                    ('error','Shipping error'),
-                                    ('exchange','Exchange request'),
-                                    ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the line product problem"),
-        'claim_descr' : fields.text('Claim description', help="More precise description of the problem"),  
-        'product_id': fields.many2one('product.product', 'Product',help="Returned product"),
-        'product_returned_quantity' : fields.float('Quantity', digits=(12,2), help="Quantity of product returned"),
-        'unit_sale_price' : fields.float('Unit sale price', digits=(12,2), help="Unit sale price of the product. Auto filed if retrun done by invoice selection. BE CAREFUL AND CHECK the automatic value as don't take into account previous refounds, invoice discount, can be for 0 if product for free,..."),
-        'return_value' : fields.function(_line_total_amount, method=True, string='Total return', type='float', help="Quantity returned * Unit sold price",),
-        'prodlot_id': fields.many2one('stock.production.lot', 'Serial/Lot n°',help="The serial/lot of the returned product"),
-        'applicable_guarantee': fields.selection([('us','Company'),('supplier','Supplier'),('brand','Brand manufacturer')], 'Warranty type'),# TODO: Replace with function field. type supplier might generate an auto draft forward to the supplier
-        'guarantee_limit': fields.date('Warranty limit', help="The warranty limit is computed as: invoice date + warranty defined on selected product.", readonly=True),
-        'warning': fields.char('Warranty', size=64, readonly=True,help="If warranty has expired"),
-        'warranty_type': fields.char('Warranty type', size=64, readonly=True,help="from product form"),
-        "warranty_return_partner" : fields.many2one('res.partner', 'Warranty return',help="Where the customer has to send back the product(s)"),        
-        'claim_id': fields.many2one('crm.claim', 'Related claim',help="To link to the case.claim object"),
+            ('legal','Legal retractation'),
+            ('cancellation','Order cancellation'),
+            ('damaged','Damaged delivered product'),                                    
+            ('error','Shipping error'),
+            ('exchange','Exchange request'),
+            ('lost','Lost during transport'),
+            ('other','Other')], 
+            'Claim Subject',
+            required=True,
+            help="To describe the line product problem"),
+        'claim_descr' : fields.text('Claim description',
+            help="More precise description of the problem"),  
+        'product_id': fields.many2one('product.product', 'Product',
+            help="Returned product"),
+        'product_returned_quantity' : fields.float('Quantity', digits=(12,2), 
+            help="Quantity of product returned"),
+        'unit_sale_price' : fields.float('Unit sale price', digits=(12,2),
+            help="Unit sale price of the product. Auto filed if retrun done by"
+                 " invoice selection. BE CAREFUL AND CHECK the automatic value "
+                 "as don't take into account previous refounds, invoice "
+                 "discount, can be for 0 if product for free,..."),
+        'return_value' : fields.function(_line_total_amount, method=True, 
+            string='Total return',
+            type='float',
+            help="Quantity returned * Unit sold price",),
+        'prodlot_id': fields.many2one('stock.production.lot', 'Serial/Lot n°',
+            help="The serial/lot of the returned product"),
+        'applicable_guarantee': fields.selection(
+            [
+                ('us','Company'),
+                ('supplier','Supplier'),
+                ('brand','Brand manufacturer')],
+            'Warranty type'),
+        'guarantee_limit': fields.date('Warranty limit',
+            readonly=True,
+            help="The warranty limit is computed as: invoice date + warranty "
+                 "defined on selected product."),
+        'warning': fields.char('Warranty', size=64,
+            readonly=True,
+            help="If warranty has expired"),
+        'warranty_type': fields.char('Warranty type',
+            size=64,
+            readonly=True,
+            help="From product form"),
+        "warranty_return_partner" : fields.many2one('res.partner',
+            'Warranty return',
+            help="Where the customer has to send back the product(s)"),        
+        'claim_id': fields.many2one('crm.claim', 'Related claim',
+            help="To link to the case.claim object"),
         'state' : fields.selection([('draft','Draft'),
                                     ('refused','Refused'),
                                     ('confirmed','Confirmed, waiting for product'),
                                     ('in_to_control','Received, to control'),
                                     ('in_to_treate','Controlled, to treate'),
                                     ('treated','Treated')], 'State'),
-        'substate_id': fields.many2one('substate.substate', 'Sub state',help="Select a sub state to precise the standard state. Example 1: state = refused; substate could be warranty over, not in warranty, no problem,... . Example 2: state = to treate; substate could be to refund, to exchange, to repair,..."),
-        'last_state_change': fields.date('Last change', help="To set the last state / substate change"),
-        'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', help='The invoice line related to the returned product'),
-        'refund_line_id': fields.many2one('account.invoice.line', 'Refund Line', help='The refund line related to the returned product'),
-        'move_in_id': fields.many2one('stock.move', 'Move Line from picking in', help='The move line related to the returned product'),
-        'move_out_id': fields.many2one('stock.move', 'Move Line from picking out', help='The move line related to the returned product'),
+        'substate_id': fields.many2one('substate.substate', 'Sub state',
+            help="Select a sub state to precise the standard state. Example 1: "
+                 "state = refused; substate could be warranty over, not in "
+                 "warranty, no problem,... . Example 2: state = to treate; "
+                 "substate could be to refund, to exchange, to repair,..."),
+        'last_state_change': fields.date('Last change', 
+            help="To set the last state / substate change"),
+        'invoice_line_id': fields.many2one('account.invoice.line',
+            'Invoice Line',
+            help='The invoice line related to the returned product'),
+        'refund_line_id': fields.many2one('account.invoice.line',
+            'Refund Line',
+            help='The refund line related to the returned product'),
+        'move_in_id': fields.many2one('stock.move',
+            'Move Line from picking in',
+            help='The move line related to the returned product'),
+        'move_out_id': fields.many2one('stock.move',
+            'Move Line from picking out',
+            help='The move line related to the returned product'),
+        'location_dest_id': fields.many2one('stock.location',
+            'Return Stock Location',
+            help='The return stock location of the returned product'),
     }
 
     _defaults = {
@@ -101,113 +167,178 @@
     def set_warranty_limit(self, cr, uid, ids, claim_line, context=None):
         date_invoice = claim_line.invoice_line_id.invoice_id.date_invoice
         if date_invoice:
-            warning = "Valid"
+            warning = _(self.WARRANT_COMMENT['not_define'])
+            date_inv_at_server = datetime.strptime(date_invoice,
+                DEFAULT_SERVER_DATE_FORMAT)
+            supplier = claim_line.product_id.seller_ids[0]
             if claim_line.claim_id.claim_type == 'supplier':
-                if claim_line.prodlot_id :
-                    limit = (datetime.strptime(date_invoice, DEFAULT_SERVER_DATE_FORMAT) + relativedelta(months=int(claim_line.product_id.seller_ids[0].warranty_duration))).strftime(DEFAULT_SERVER_DATE_FORMAT) # TODO: To be implemented
-                else :
-                    limit = (datetime.strptime(date_invoice, DEFAULT_SERVER_DATE_FORMAT) + relativedelta(months=int(claim_line.product_id.seller_ids[0].warranty_duration))).strftime(DEFAULT_SERVER_DATE_FORMAT) 
-            else :
-                limit = (datetime.strptime(date_invoice, DEFAULT_SERVER_DATE_FORMAT) + relativedelta(months=int(claim_line.product_id.warranty))).strftime(DEFAULT_SERVER_DATE_FORMAT)
-            if limit < claim_line.claim_id.date:
-                warning = 'Expired'
+                waranty_duration = int(supplier.warranty_duration)
+            else:
+                waranty_duration = int(claim_line.product_id.warranty)
+            limit = (date_inv_at_server +
+                    relativedelta(month=waranty_duration)).strftime(DEFAULT_SERVER_DATE_FORMAT)
+            # If waranty period was defined
+            if waranty_duration > 0:
+                if limit < claim_line.claim_id.date:
+                    warning = _(self.WARRANT_COMMENT['expired'])
+                else:
+                    warning = _(self.WARRANT_COMMENT['valid'])
             self.write(cr,uid,ids,{
                     'guarantee_limit' : limit,
                     'warning' : warning,
                     })
         else:
-            raise osv.except_osv(_('Error !'), _('Cannot find any date for invoice ! Must be a validated invoice !'))
+            raise osv.except_osv(_('Error !'), 
+                _('Cannot find any date for invoice ! Must be a validated invoice !'))
         return True
 
+    def get_destination_location(self, cr, uid, product_id, 
+            warehouse_id, context=None):
+        """Compute and return the destination location ID to take
+        for a return."""
+        prod_obj = self.pool.get('product.product')
+        prod = prod_obj.browse(cr, uid, product_id, context=context)
+        wh_obj = self.pool.get('stock.warehouse')
+        wh = wh_obj.browse(cr, uid, warehouse_id, context=context)
+        location_dest_id = wh.lot_stock_id.id
+        return_type = 'company'
+        if prod:
+            seller = prod.seller_info_id
+            if seller:
+                return_type = seller.warranty_return_partner
+                if return_type == 'supplier':
+                    location_dest_id = seller.name.property_stock_supplier.id
+        return location_dest_id
+
     # Method to calculate warranty return address
-    def set_warranty_return_address(self, cr, uid, ids, claim_line, context=None):
+    def set_warranty_return_address(self, cr, uid, ids, 
+            claim_line, context=None):
+        """Return the partner to be used as return destination and
+        the destination stock location of the line in case of return.
+        We can have various case here:
+            - company or other: return to company partner or crm_return_address_id
+              if specified
+            - supplier: return to the supplier address"""
         return_address = None
-        warranty_type = 'company'
+        return_type = 'company'
         seller = claim_line.product_id.seller_info_id
+        claim_company = claim_line.claim_id.company_id
+        if claim_company.crm_return_address_id:
+            return_address = claim_company.crm_return_address_id.id
+        else:
+            return_address = claim_company.partner_id.id
         if seller:
-            return_partner = seller.warranty_return_partner
-            if return_partner:
-                warranty_type = return_partner
-            else:
-                warranty_type = 'company'
-            return_address = seller.warranty_return_address.id
-#                if return_partner == 'company': 
-#                    return_address = self._get_partner_address(cr, uid, ids, context,claim_line.claim_id.company_id.partner_id)[0]
-#                elif return_partner == 'supplier':
-#                    return_address = self._get_partner_address(cr, uid, ids, context,claim_line.product_id.seller_ids[0].name)[0]
-#                    warranty_type = 'supplier'
-#                elif return_partner == 'brand':
-#                    return_address = self._get_partner_address(cr, uid, ids, context, claim_line.product_id.product_brand_id.partner_id)[0]
-#                    warranty_type = 'brand'
-#                else :
-#                    warranty_type = 'other'
-#                    # TO BE IMPLEMENTED if something to do...
-#            else :
-#                warranty_type = 'company'
-#                return_address = self._get_default_company_address(cr, uid, claim_line.claim_id.company_id, context=context)
-                #TODO fix me use default address
-#                self.write(cr,uid,ids,{'warranty_return_partner':1,'warranty_type': 'company'})
-#                return True
-
-                #raise osv.except_osv(_('Error !'), _('Cannot find any warranty return partner for this product !'))
-        else : 
-            warranty_type = 'company'
-            if claim_line.claim_id.company_id.crm_return_address_id:
-                return_address = [claim_line.claim_id.company_id.crm_return_address_id.id]
-            else:
-                return_address = [claim_line.claim_id.company_id.partner_id.address[0].id]
-#            return_address = self._get_default_company_address(cr, uid, claim_line.claim_id.company_id, context=context)
-            #TODO fix me use default address
-#            self.write(cr,uid,ids,{'warranty_return_partner':1,'warranty_type': 'company'})
-#            return True
-            #raise osv.except_osv(_('Error !'), _('Cannot find any supplier for this product !'))                
-        self.write(cr,uid,ids,{'warranty_return_partner':return_address,'warranty_type':warranty_type}) 
+            return_type = seller.warranty_return_partner
+            if return_type == 'supplier':
+                return_address = seller.warranty_return_address.id
+        location_dest_id = self.get_destination_location(cr, uid, 
+            claim_line.product_id.id,
+            claim_line.claim_id.warehouse_id.id,
+            context=context)
+        self.write(cr, uid, ids,
+            {'warranty_return_partner': return_address,
+            'warranty_type': return_type,
+            'location_dest_id': location_dest_id}) 
         return True
                
-    # Method to calculate warranty limit and validity
+    # Method to calculate warranty limit and address
     def set_warranty(self, cr, uid, ids, context=None):
         for claim_line in self.browse(cr, uid, ids, context=context):
             if claim_line.product_id and claim_line.invoice_line_id:
-                self.set_warranty_limit(cr, uid, ids, claim_line, context)
-                self.set_warranty_return_address(cr, uid, ids, claim_line, context)
+                self.set_warranty_limit(cr, uid, ids, 
+                    claim_line, context=context)
+                self.set_warranty_return_address(cr, uid, ids, 
+                    claim_line, context=context)
             else:
-                raise osv.except_osv(_('Error !'), _('PLEASE SET PRODUCT & INVOICE!'))
+                raise osv.except_osv(_('Error !'), 
+                    _('PLEASE SET PRODUCT & INVOICE!'))
         return True 
 
+
 #TODO add the option to split the claim_line in order to manage the same product separately
-
 class crm_claim(orm.Model):
     _inherit = 'crm.claim'
 
+    def _get_sequence_number(self, cr, uid, context=None):
+        res = self.pool.get('ir.sequence').get(cr, uid, 
+            'crm.claim.rma', context=context) or '/'
+        return res
+
+    def _get_default_warehouse(self, cr, uid, context=None):
+        company_id = self.pool.get('res.users').browse(cr, uid, uid, 
+            context=context).company_id.id
+        wh_ids = self.pool.get('stock.warehouse').search(cr, uid, 
+            [('company_id','=',company_id)], context=context)
+        if not wh_ids:
+            raise osv.except_osv(_('Error!'), 
+                _('There is no warehouse for the current user\'s company!'))
+        return wh_ids[0]
+
+    def name_get(self, cr, uid, ids, context=None):
+        res = []
+        for claim in self.browse(cr, uid, ids, context=context):
+            res.append((claim.id, '[' + claim.number + '] ' + claim.name))
+        return res
+
+    def create(self, cr, uid, vals, context=None):
+        if ('number' not in vals) or (vals.get('number')=='/'):
+            vals['number'] = self._get_sequence_number(cr, uid, context=context)
+        new_id = super(crm_claim, self).create(cr, uid, vals, context)
+        return new_id
+
+    def copy_data(self, cr, uid, id, default=None, context=None):
+        if default is None:
+            default = {}
+        std_default = {
+            'invoice_ids': False,
+            'picking_ids': False,
+            'number': self._get_sequence_number(cr, uid, context=context),
+        }
+        std_default.update(default)
+        return super(crm_claim, self).copy_data(
+            cr, uid, id, default=std_default, context=context)
+
     _columns = {
-        'number': fields.char('Number', size=128,readonly=True,states={'draft': [('readonly', False)]},required=True, help="Company internal claim unique number"),
+        'number': fields.char('Number', readonly=True, 
+            states={'draft': [('readonly', False)]},
+            required=True,
+            select=True,
+            help="Company internal claim unique number"),
         'claim_type': fields.selection([('customer','Customer'),
-                                    ('supplier','Supplier'),
-                                    ('other','Other')], 'Claim type', required=True, help="customer = from customer to company ; supplier = from company to supplier"),
-        'claim_line_ids' : fields.one2many('claim.line', 'claim_id', 'Return lines'),
-        'product_exchange_ids': fields.one2many('product.exchange', 'claim_return_id', 'Product exchanges'),
-        # Aftersale outsourcing        
-#        'in_supplier_picking_id': fields.many2one('stock.picking', 'Return To Supplier Picking', required=False, select=True),
-#        'out_supplier_picking_id': fields.many2one('stock.picking', 'Return From Supplier Picking', required=False, select=True),
-
-        # Financial management
+            ('supplier','Supplier'),
+            ('other','Other')], 
+            'Claim type',
+            required=True,
+            help="customer = from customer to company ; supplier = from "
+                 "company to supplier"),
+        'claim_line_ids' : fields.one2many('claim.line', 'claim_id', 
+            'Return lines'),
         'planned_revenue': fields.float('Expected revenue'),
         'planned_cost': fields.float('Expected cost'),
         'real_revenue': fields.float('Real revenue'),
         'real_cost': fields.float('Real cost'),
         'invoice_ids': fields.one2many('account.invoice', 'claim_id', 'Refunds'),
         'picking_ids': fields.one2many('stock.picking', 'claim_id', 'RMA'),
-        'invoice_id': fields.many2one('account.invoice', 'Invoice', help='Related invoice'),
-        'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
+        'invoice_id': fields.many2one('account.invoice', 'Invoice', 
+            help='Related original Cusotmer invoice'),
+        'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', 
+            required=True),
     }
+
     _defaults = {
-        'number': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'crm.claim'),
-        'claim_type': lambda *a: 'customer',
-        'warehouse_id': lambda *a: 1,
+        'number': lambda self, cr, uid, context: '/',
+        'claim_type': 'customer',
+        'warehouse_id': _get_default_warehouse,
     }
 
-    def onchange_partner_address_id(self, cr, uid, ids, add, email=False, context=None):
-        res = super(crm_claim, self).onchange_partner_address_id(cr, uid, ids, add, email=email)
+    _sql_constraints = [
+        ('number_uniq', 'unique(number, company_id)', 'Number/Reference must be unique per Company!'),
+    ]
+
+    def onchange_partner_address_id(self, cr, uid, ids, add, 
+            email=False, context=None):
+        res = super(crm_claim, self).onchange_partner_address_id(cr, uid, ids, 
+            add, email=email)
         if add:
             if not res['value']['email_from'] or not res['value']['partner_phone']:
                 address = self.pool.get('res.partner').browse(cr, uid, add)
@@ -218,12 +349,20 @@
                         res['value']['partner_phone'] = other_add.phone
         return res
 
-    def onchange_invoice_id(self, cr, uid, ids, invoice_id, context=None):
+    def onchange_invoice_id(self, cr, uid, ids, invoice_id, 
+            warehouse_id, context=None):
         invoice_line_obj = self.pool.get('account.invoice.line')
-        invoice_line_ids = invoice_line_obj.search(cr, uid, [('invoice_id', '=', invoice_id)])
+        claim_line_obj = self.pool.get('claim.line')
+        invoice_line_ids = invoice_line_obj.search(cr, uid, 
+            [('invoice_id','=',invoice_id)])
         claim_lines = []
+        if not warehouse_id:
+            warehouse_id = self._get_default_warehouse(cr, uid, context=context)
         for invoice_line in invoice_line_obj.browse(cr,uid,invoice_line_ids):
-#            claim_line_obj = self.pool.get('claim.line')
+            location_dest_id = claim_line_obj.get_destination_location(cr, uid, 
+                invoice_line.product_id.id,
+                warehouse_id,
+                context=context)
             claim_lines.append({
                     'name': invoice_line.name,
                     'claim_origine' : "none",
@@ -231,11 +370,8 @@
                     'product_id' : invoice_line.product_id.id,
                     'product_returned_quantity' : invoice_line.quantity,
                     'unit_sale_price' : invoice_line.price_unit,
-#                    'prodlot_id' : invoice_line.,
+                    'location_dest_id': location_dest_id,
                     'state' : 'draft',
                 })
-#            for line in claim_line_obj.browse(cr,uid,[line_id],context):
-#                line.set_warranty()
         return  {'value' : {'claim_line_ids' : claim_lines}}
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'crm_claim_rma/crm_claim_rma_view.xml'
--- crm_claim_rma/crm_claim_rma_view.xml	2013-08-19 11:50:47 +0000
+++ crm_claim_rma/crm_claim_rma_view.xml	2013-11-15 13:53:46 +0000
@@ -1,26 +1,4 @@
 <?xml version="1.0"?>
-<!--
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Emmanuel Samyn                     #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
--->
 <openerp>
     <data>
 <!-- Return line -->
@@ -78,9 +56,12 @@
                 <tree editable="top" string="Returned lines">
                     <field name="state"/>
                     <field name="substate_id"/>
+                    <field name="product_id"/>
                     <field name="name"/>
                     <field name="prodlot_id"/>
                     <field name="warning"/> 
+                    <field name="location_dest_id"/> 
+                    <button name="set_warranty" string="Compute Waranty" type="object" icon="gtk-justify-fill"/>
                     <field name="product_returned_quantity"/>
                     <field name="claim_origine"/>
                     <field name="refund_line_id"/>
@@ -99,7 +80,7 @@
             <field name="name"/>
             <separator string="Returned good" colspan="4"/>
             <group col="6" colspan="4">
-                <field name="invoice_line_id"/> <!-- domain="[('type', '=', 'out_invoice')]" -->
+                <field name="invoice_line_id"/>
                 <field name="product_id"/> 
                 <field name="prodlot_id"/>
                 <field name="product_returned_quantity"/>
@@ -109,7 +90,6 @@
                 <field name="move_in_id"/>
                 <field name="move_out_id"/>
             </group>
-            <!-- button name="%(action_get_empty_serial)d" string="Get possible values for empty serial" states="draft,confirmed" type="action" target="new"/ -->
             <separator string="Problem" colspan="4"/>
             <field name="claim_origine" nolabel="1" colspan="4"/>
             <field name="claim_descr" nolabel="1" colspan="4"/>
@@ -129,232 +109,209 @@
             </field>
         </record>
 
-<!-- Picking follow -->
-        <!-- TREE -->
-<!--
-        <record model="ir.ui.view" id="crm_picking_follow_tree_view">
-            <field name="name">CRM - Picking follow Tree</field>
-            <field name="model">picking.follow</field>
-            <field name="arch" type="xml">
-                <tree string="Picking follows">
-                    <field name="picking_id"/>
-                    <field name="related_picking_state"/>
-                    <field name="related_picking_due_date"/>
-                    <field name="related_picking_delivered_date"/>
-                    <field name="name"/>
-                </tree>
-            </field>
-        </record>
--->
-        <!-- FORM -->
-<!--
-        <record model="ir.ui.view" id="crm_picking_follow_form_view">
-            <field name="name">CRM - Picking follow Form</field>
-            <field name="model">picking.follow</field>
-            <field name="arch" type="xml">
-                <form string="Picking follow">
-                    <field name="picking_id"/>
-                    <field name="related_picking_state"/> 
-                    <field name="related_picking_due_date"/>
-                    <field name="related_picking_delivered_date"/> 
-                    <field name="name"/>    
-                </form>
-            </field>
-        </record>
--->
-<!-- PRODUCT EXCHANGE -->
-    <!-- TREE -->
-<!--    <record model="ir.ui.view" id="crm_product_exchange_tree_view">-->
-<!--        <field name="name">CRM - Product exchange Tree</field>-->
-<!--        <field name="model">product.exchange</field>-->
-<!--        <field name="type">tree</field>-->
-<!--        <field name="arch" type="xml">-->
-<!--        <tree string="Product exchanges" editable="top" >-->
-<!--            <field name="selected"/>-->
-<!--            <field name="state"/>-->
-<!--            <field name="exchange_send_date"/>-->
-<!--            <field name="returned_product"/> -->
-<!--            <field name="returned_product_serial"/>-->
-<!--            <field name="replacement_product"/>-->
-<!--            <field name="replacement_product_serial"/>-->
-<!--            <field name="returned_value"/>-->
-<!--            <field name="replacement_value"/>-->
-<!--            <field name="name"/>    -->
-<!--        </tree>-->
-<!--        </field>-->
-<!--    </record>-->
-
-    <!-- FORM -->
-<!--    <record model="ir.ui.view" id="crm_product_exchange_form_view">-->
-<!--        <field name="name">CRM - Product exchange Form</field>-->
-<!--        <field name="model">product.exchange</field>-->
-<!--        <field name="arch" type="xml">-->
-<!--        <form string="Product exchange">-->
-<!--            <field name="state"/>-->
-<!--            <field name="exchange_send_date"/>-->
-<!--            <separator string="Returned product" colspan="2"/>-->
-<!--            <separator string="Replacement product" colspan="2"/>-->
-<!--            <field name="returned_product"/> -->
-<!--            <field name="replacement_product"/>-->
-<!--            <field name="returned_product_serial"/>-->
-<!--            <field name="replacement_product_serial"/> -->
-<!--            <field name="returned_product_qty"/>        -->
-<!--            <field name="replacement_product_qty"/>-->
-<!--            <field name="returned_unit_sale_price"/>-->
-<!--            <field name="replacement_unit_sale_price"/>-->
-<!--            <field name="returned_value"/>-->
-<!--            <field name="replacement_value"/>-->
-<!--            <separator string="Comment" colspan="2"/>-->
-<!--            <field name="name" colspan="4" nolabel="1"/>        -->
-<!--        </form>-->
-<!--        </field>-->
-<!--    </record>-->
-<!--        -->
 <!-- CLAIM VIEWS -->
 
+    <record model="ir.ui.view" id="crm_case_claims_tree_view">
+        <field name="name">CRM - Claims Tree</field>
+        <field name="model">crm.claim</field>
+        <field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view"/>
+        <field name="arch" type="xml">
+            <field name="stage_id" position="after">
+                <field name="section_id" />
+            </field>
+            <field name="name" position="before">
+                <field name="number" />
+            </field>
+        </field>
+    </record>
+
+    <record model="ir.ui.view" id="crm_case_claims_form_view_replace">
+            <field name="name">CRM - Claims Form</field>
+            <field name="model">crm.claim</field>
+            <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
+            <field name="arch" type="xml">
+                <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]" position="replace">
+                    <field name="categ_id" />
+                </field>
+            </field>
+        </record>
+
     <record model="ir.ui.view" id="crm_claim_rma_form_view">
         <field name="name">CRM - Claim product return Form</field>
         <field name="model">crm.claim</field>
         <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
         <field name="arch" type="xml">
-            <page string="Follow Up" position="after">
-                <field name="invoice_ids" colspan="4" nolabel="1" readonly="1"/>
-                <field name="picking_ids" colspan="4" nolabel="1" readonly="1"/>
-	    </page>
-<!--                
-            <xpath expr="/form/group/notebook/page[@string='Communication &amp; History']/field" position="after">
-                <field name="invoice_ids" colspan="4" nolabel="1" readonly="1"/>
-                <field name="picking_ids" colspan="4" nolabel="1" readonly="1"/>
-            </xpath>
--->
-            <field name="description" position="after">
-                <group name="Product Return" colspan="4">
-                    <separator string="Product Return" colspan="4"/>
-                    <field name="invoice_id" colspan="1" on_change="onchange_invoice_id(invoice_id, context)" domain="[('partner_id','=',partner_id)]" />
-                    <button name="%(action_create_return_serial)d" string="Mass return from serial/lot n°" states="draft,open" type="action" target="new"/>
-                    <field name="claim_line_ids" nolabel="1" colspan="3"/>
-                </group>
-                <group col="4" colspan="4" attrs="{'invisible':[('state', '&lt;&gt;','open')]}">
-                    <separator string="Action" colspan="4" />
-                    <button name="%(action_claim_picking_in)d"
-                            string="New picking IN" states="open"
-                            type="action" target="new"
-                            context="{'warehouse_id': warehouse_id,
-                                'partner_id': partner_id}"/>
-
-
-                    <button name="%(action_claim_picking_out)d"
-                            string="New picking OUT" states="open"
-                            type="action" target="new"
-                            context="{'warehouse_id': warehouse_id,
-                                'partner_id': partner_id}"/>
-
-                    <button name="%(action_claim_picking_loss)d"
-                            string="New Product Loss" states="open"
-                            type="action" target="new"
-                            context="{'warehouse_id': warehouse_id,
-                                'partner_id': partner_id}"/>
-
-
-                    <button name="%(account.action_account_invoice_refund)d"
-                            type='action' string='New Refund'
-                            states='open' icon="gtk-execute"
-                            context="{
-                                'invoice_ids': [invoice_id],
-                                'claim_line_ids': claim_line_ids,
-                                'description': name,
-                                'claim_id': id,
-                                }"/>
-                </group>
-            </field>
+            <page string="Follow Up" position="before">
+                <page string="Product Return">
+                    <group name="Product Return">
+                        <separator string="Product Return" colspan="4"/>
+                        <group>
+                            <field name="invoice_id" on_change="onchange_invoice_id(invoice_id,warehouse_id,context)" domain="[('partner_id','=',partner_id)]" />
+                        </group>
+                        <group>
+                            <!-- Place for mass return button from crm_rma_lot_mass_return -->
+                        </group>
+                        <field name="claim_line_ids" nolabel="1" colspan="4"/>
+                    </group>
+                    <group col="4" colspan="4" attrs="{'invisible':[('state', '&lt;&gt;','open')]}">
+                        <separator string="Action" colspan="4" />
+                        <button name="%(action_claim_picking_in)d"
+                                string="New Products Return" states="open"
+                                type="action" target="new"
+                                context="{'warehouse_id': warehouse_id,
+                                    'partner_id': partner_id}"/>
+
+                        <button name="%(action_claim_picking_out)d"
+                                string="New Delivery" states="open"
+                                type="action" target="new"
+                                context="{'warehouse_id': warehouse_id,
+                                    'partner_id': partner_id}"/>
+
+                        <button name="%(account.action_account_invoice_refund)d"
+                                type='action' string='New Refund'
+                                states='open' icon="gtk-execute"
+                                context="{
+                                    'invoice_ids': [invoice_id],
+                                    'claim_line_ids': claim_line_ids,
+                                    'description': name,
+                                    'claim_id': id,
+                                    }"/>
+                    </group>
+                </page>
+                <page string="Generated Documents">
+                    <separator colspan="2" string="Refunds"/>
+                    <field name="invoice_ids" colspan="4" readonly="1"/>
+                    <separator colspan="2" string="Receptions / Deliveries"/>
+                    <field name="picking_ids" colspan="4" readonly="1"/>
+                </page>
+	       </page>
         </field>
     </record>
 
-    <record model="ir.ui.view" id="crm_claim_rma_form_view2">
-        <field name="name">CRM - Claim product return Form</field>
-        <field name="model">crm.claim</field>
-        <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
-            <field name="arch" type="xml">
-                <field name="date_deadline" position="after">
-                    <field name="number"/>
-                    <field name="claim_type"/>
-                    <field name="warehouse_id" />
-                </field>
-            </field>
-    </record>
-                
+
 <!-- Right side link to orders -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id]}"
         id="act_crm_claim_rma_sale_orders" 
-        name="Partner sale orders" 
-        res_model="sale.order" 
+        name="Quotations and Sales"
+        res_model="sale.order"
         src_model="crm.claim"/>
 <!-- Right side link to invoices -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id],}"
         domain="[('type', '=', 'out_invoice')]"
         id="act_crm_claim_rma_invoice_out" 
-        name="Partner invoices out" 
+        name="Customer Invoices" 
         res_model="account.invoice" 
         src_model="crm.claim"/>
 <!-- Right side link to invoices -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id],}"
         domain="[('type', '=', 'in_invoice')]"
         id="act_crm_claim_rma_invoice_in" 
-        name="Partner invoices in" 
+        name="Supplier Invoices" 
         res_model="account.invoice" 
         src_model="crm.claim"/>
 <!-- Right side link to refunds -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id],}"
         domain="[('type', '=', 'out_refund')]"
         id="act_crm_claim_rma_refunds_out" 
-        name="Partner refunds out" 
+        name="Customer Refunds" 
         res_model="account.invoice" 
         src_model="crm.claim"/>    
 <!-- Right side link to refunds -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id],}"
         domain="[('type', '=', 'in_refund')]"
         id="act_crm_claim_rma_refunds_in" 
-        name="Partner refunds in" 
+        name="Supplier Refunds" 
         res_model="account.invoice" 
         src_model="crm.claim"/> 
 <!-- Right side link to picking in --> 
         <act_window
-        context="{'search_default_partner_id': [partner_id]}"
         domain="[('type', '=', 'in')]"
         id="act_crm_claim_rma_picking_in" 
-        name="Partner picking IN" 
+        name="Incomming Shipment and Returns" 
         res_model="stock.picking" 
         src_model="crm.claim"/>  
 <!-- Right side link to picking out -->
         <act_window 
-        context="{'search_default_partner_id': [partner_id]}"
         domain="[('type', '=', 'out')]"
         id="act_crm_claim_rma_picking_out" 
-        name="Partner picking OUT" 
+        name="Deliveries" 
         res_model="stock.picking" 
         src_model="crm.claim"/>  
 
-
- <!-- act_window
-
-            context="{'search_default_account_id':[active_id], 'search_default_unreconciled':1, 'default_account_id': active_id}"
-            src_model="account.account"/>
-
-        <act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" 
-        name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/ -->
-        
+    <record model="ir.ui.view" id="crm_claim_rma_form_view2">
+        <field name="name">CRM - Claim product return Form</field>
+        <field name="model">crm.claim</field>
+        <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
+            <field name="arch" type="xml">
+                <field name="date_deadline" position="after">
+                    <field name="claim_type"/>
+                    <field name="warehouse_id" />
+                </field>
+                <field name="name" position="replace">
+                    <div class="oe_title">
+                        <label for="number" class="oe_edit_only"/>
+                        <h1><field name="number"/></h1>
+                    </div>
+                </field>
+                <field name="date" position="replace">
+                </field>
+                <field name="user_id" position="before">
+                    <field name="name" />
+                    <field name="date"/>
+                </field>
+                <xpath expr="//sheet[@string='Claims']/group[1]" position="inside">
+                    <div class="oe_right oe_button_box" name="buttons">
+                        <button name="%(act_crm_claim_rma_sale_orders)d" type="action"
+                                string="Quotations and Sales"
+                                attrs="{'invisible': ['|',('partner_id','=', False),('claim_type','in', ['supplier','other'])]}"
+                                context="{'search_default_partner_id': [partner_id],'search_default_user_id':False}"
+                               />
+                        <button name="%(act_crm_claim_rma_invoice_out)d" type="action"
+                                string="Customer Invoices"
+                                attrs="{'invisible': ['|',('partner_id','=', False),('claim_type','in', ['supplier','other'])]}"
+                                context="{'search_default_partner_id': [partner_id],'search_default_user_id':False}"
+                               />
+                        <button name="%(act_crm_claim_rma_refunds_out)d" type="action"
+                                string="Customer Refunds"
+                                attrs="{'invisible': ['|',('partner_id','=', False),('claim_type','in', ['supplier','other'])]}"
+                                context="{'search_default_partner_id': [partner_id],'search_default_user_id':False}"
+                               />
+                        <button name="%(act_crm_claim_rma_invoice_in)d" type="action"
+                                string="Supplier Invoices"
+                                attrs="{'invisible': ['|',('partner_id','=', False),('claim_type','in', ['customer','other'])]}"
+                                context="{'search_default_partner_id': [partner_id],'search_default_user_id':False}"
+                               />
+                        <button name="%(act_crm_claim_rma_refunds_in)d" type="action"
+                                string="Supplier Refunds"
+                                attrs="{'invisible': ['|',('partner_id','=', False),('claim_type','in', ['customer','other'])]}"
+                                context="{'search_default_partner_id': [partner_id],'search_default_user_id':False}"
+                               />
+                    </div>
+                </xpath>
+            </field>
+    </record>
+
+ <!-- Crm claim Search view -->
+    <record id="view_crm_case_claims_filter" model="ir.ui.view">
+        <field name="name">CRM - Claims Search</field>
+        <field name="model">crm.claim</field>
+        <field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter"/>
+        <field name="arch" type="xml">
+            <field name="name" string="Claims" position="before">
+                <field name="number"/>
+            </field>
+            <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" position="before">
+                <filter string="Sales Team" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'section_id'}"/>
+            </filter>
+        </field>
+    </record>
+
+       
 <!-- Menu -->
         <record model="ir.actions.act_window" id="crm_claim.crm_case_categ_claim0">
             <field name="context">{"search_default_user_id":uid, "stage_type":'claim'}</field>
         </record>
 
-
-
     <!-- return lines action -->
         <record model="ir.actions.act_window" id="act_crm_case_claim_lines">
             <field name="name">Claim lines</field>
@@ -362,7 +319,6 @@
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="view_id" ref="crm_claim_line_tree_view"/>
-            <!-- field name="context">{'search_default_section_id': section_id, "search_default_current":1,"search_default_user_id":uid, "stage_type":'claim'}</field -->
             <field name="search_view_id" ref="view_crm_claim_lines_filter"/>
         </record>
     <!-- substates action -->
@@ -370,7 +326,6 @@
             <field name="name">Claim line substates</field>
             <field name="res_model">substate.substate</field>
             <field name="view_type">form</field>
-            <!-- field name="view_id" ref="crm.crm_case_categ_tree-view"/ -->
         </record>
     <!-- Menu -->
         <menuitem name="Return lines" id="menu_crm_case_claims_claim_lines"

=== added file 'crm_claim_rma/i18n/crm_claim_rma.pot'
--- crm_claim_rma/i18n/crm_claim_rma.pot	1970-01-01 00:00:00 +0000
+++ crm_claim_rma/i18n/crm_claim_rma.pot	2013-11-15 13:53:46 +0000
@@ -0,0 +1,965 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* crm_claim_rma
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-15 13:25+0000\n"
+"PO-Revision-Date: 2013-11-15 13:25+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Returned good"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:res.company:0
+msgid "Crm product return address"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Draft and Open Claims"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Group By..."
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,claim_descr:0
+msgid "More precise description of the problem"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,guarantee_limit:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_guarantee_limit
+msgid "Warranty limit"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model.fields,field_description:crm_claim_rma.field_res_company_crm_return_address_id
+#: field:res.company,crm_return_address_id:0
+msgid "Crm return address"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:stock.picking.in:0
+#: view:stock.picking.out:0
+msgid "To Invoice"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,refund_line_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_refund_line_id
+msgid "Refund Line"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:res.company,crm_return_address_id:0
+msgid "Default address where the customers has to send back the returned product in a crm claim. If empty the address is the company address"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,applicable_guarantee:0
+msgid "Company"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,claim_descr:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_claim_descr
+msgid "Claim description"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,move_out_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_move_out_id
+msgid "Move Line from picking out"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,last_state_change:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_last_state_change
+msgid "Last change"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,product_id:0
+msgid "Returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim_make_picking.wizard:0
+msgid "Create picking"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "New Delivery"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Calculate warranty state"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/account_invoice.py:74
+#, python-format
+msgid "A refund has already been created for this claim !"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Compute Waranty"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:account.invoice,claim_id:0
+#: model:ir.model,name:crm_claim_rma.model_crm_claim
+#: model:ir.model.fields,field_description:crm_claim_rma.field_account_invoice_claim_id
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_picking_claim_id
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_picking_claim_id_4064
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_picking_claim_id_4065
+#: field:stock.picking,claim_id:0
+#: field:stock.picking.in,claim_id:0
+#: field:stock.picking.out,claim_id:0
+msgid "Claim"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,location_dest_id:0
+msgid "The return stock location of the returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,substate_id:0
+msgid "Select a sub state to precise the standard state. Example 1: state = refused; substate could be warranty over, not in warranty, no problem,... . Example 2: state = to treate; substate could be to refund, to exchange, to repair,..."
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim13
+msgid "General Adjustement"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.actions.act_window,name:crm_claim_rma.action_claim_picking_out
+msgid "Create Outgoing Shipments"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,warranty_return_partner:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_warranty_return_partner
+msgid "Warranty return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+#: field:claim.line,warning:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_warning
+msgid "Warranty"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,warning:0
+msgid "If warranty has expired"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim11
+msgid "Customer Return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,product_returned_quantity:0
+msgid "Quantity of product returned"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,planned_cost:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_planned_cost
+msgid "Expected cost"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/wizard/claim_make_picking.py:65
+#, python-format
+msgid "A picking has already been created for this claim !"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:stock.location,name:crm_claim_rma.stock_location_carrier_loss
+msgid "Carrier Loss"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Receptions / Deliveries"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,location_dest_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_location_dest_id
+msgid "Return Stock Location"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_stock_picking_out
+msgid "Delivery Orders"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:185
+#, python-format
+msgid "valid"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,last_state_change:0
+msgid "To set the last state / substate change"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_returned_lines_from_serial_wizard
+msgid "Wizard to create product return lines from serial numbers"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim_make_picking.wizard,claim_line_source_location:0
+#: help:claim_make_picking_from_picking.wizard,picking_line_source_location:0
+msgid "Location where the returned products are from."
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Returned lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim_make_picking.wizard:0
+msgid "Locations"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,applicable_guarantee:0
+#: selection:crm.claim,claim_type:0
+msgid "Supplier"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+#: field:claim.line,state:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_state
+msgid "State"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,applicable_guarantee:0
+#: field:claim.line,warranty_type:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_applicable_guarantee
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_warranty_type
+msgid "Warranty type"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_stock_picking
+msgid "Picking List"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,warehouse_id:0
+#: model:ir.model,name:crm_claim_rma.model_stock_warehouse
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_warehouse_id
+msgid "Warehouse"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,claim_origine:0
+msgid "To describe the line product problem"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim_make_picking.wizard,claim_line_dest_location:0
+#: help:claim_make_picking_from_picking.wizard,picking_line_dest_location:0
+msgid "Location where the system will stock the returned products."
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "More"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Legal retractation"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/account_invoice.py:73
+#: code:addons/crm_claim_rma/crm_claim_rma.py:191
+#: code:addons/crm_claim_rma/crm_claim_rma.py:253
+#: code:addons/crm_claim_rma/wizard/claim_make_picking.py:64
+#: code:addons/crm_claim_rma/wizard/claim_make_picking.py:167
+#, python-format
+msgid "Error !"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,guarantee_limit:0
+msgid "The warranty limit is computed as: invoice date + warranty defined on selected product."
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:254
+#, python-format
+msgid "PLEASE SET PRODUCT & INVOICE!"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,claim_origine:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_claim_origine
+msgid "Claim Subject"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,real_cost:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_real_cost
+msgid "Real cost"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,claim_id:0
+msgid "To link to the case.claim object"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim18
+msgid "Pricing Error"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,product_returned_quantity:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_product_returned_quantity
+msgid "Quantity"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,warranty_type:0
+msgid "From product form"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim_make_picking_from_picking.wizard,picking_line_ids:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_from_picking_wizard_picking_line_ids
+msgid "Picking lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Confirmed, waiting for product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,claim_line_ids:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_claim_line_ids
+#: model:ir.ui.menu,name:crm_claim_rma.menu_crm_case_claims_claim_lines
+msgid "Return lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Stage"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,planned_revenue:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_planned_revenue
+msgid "Expected revenue"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Controlled, to treate"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_refunds_out
+msgid "Customer Refunds"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_warehouse_lot_breakage_loss_id
+#: field:stock.warehouse,lot_breakage_loss_id:0
+msgid "Location Breakage Loss"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_sale_orders
+msgid "Quotations and Sales"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Lost during transport"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Shipping error"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/wizard/claim_make_picking.py:168
+#, python-format
+msgid "A product return cannot be created for various destination location, please chose line with a same destination location."
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:crm.claim,invoice_id:0
+msgid "Related original Cusotmer invoice"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim12
+msgid "Buyer Cancelled"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,claim_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_claim_id
+msgid "Related claim"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,invoice_line_id:0
+#: model:ir.model,name:crm_claim_rma.model_account_invoice_line
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_invoice_line_id
+msgid "Invoice Line"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim_make_picking.wizard,claim_line_dest_location:0
+#: field:claim_make_picking_from_picking.wizard,picking_line_dest_location:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_from_picking_wizard_picking_line_dest_location
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_wizard_claim_line_dest_location
+msgid "Dest. Location"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,move_in_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_move_in_id
+msgid "Move Line from picking in"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim20
+msgid "Delivered Late by Carrier"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Product Return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Generated Documents"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,prodlot_id:0
+msgid "The serial/lot of the returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "New Refund"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,substate_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_substate_id
+#: model:ir.model.fields,field_description:crm_claim_rma.field_substate_substate_name
+#: field:substate.substate,name:0
+msgid "Sub state"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_refunds_in
+msgid "Supplier Refunds"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Order cancellation"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,real_revenue:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_real_revenue
+msgid "Real revenue"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim_make_picking.wizard:0
+msgid "Select lines for picking"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:stock.location,name:crm_claim_rma.stock_location_refurbish
+msgid "Refurbish"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim_make_picking.wizard:0
+msgid "Select exchange lines to add in picking"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim14
+msgid "Could Not Ship"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_claim_line
+msgid "List of product to return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim10
+msgid "No Inventory"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,unit_sale_price:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_unit_sale_price
+msgid "Unit sale price"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,refund_line_id:0
+msgid "The refund line related to the returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:183
+#, python-format
+msgid "expired"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_stock_picking_in
+msgid "Incoming Shipments"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:substate.substate,substate_descr:0
+msgid "To give more information about the sub state"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_substates
+msgid "Claim line substates"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Returned line"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Not specified"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,picking_ids:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_picking_ids
+#: model:stock.location,name:crm_claim_rma.stock_location_rma
+#: view:stock.picking.in:0
+#: view:stock.picking.out:0
+msgid "RMA"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_warehouse_lot_rma_id
+#: field:stock.warehouse,lot_rma_id:0
+msgid "Location RMA"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,applicable_guarantee:0
+msgid "Brand manufacturer"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:stock.location,name:crm_claim_rma.stock_location_mistake_loss
+msgid "Mistake Loss"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,prodlot_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_prodlot_id
+msgid "Serial/Lot n°"
+msgstr ""
+
+#. module: crm_claim_rma
+#: sql_constraint:crm.claim:0
+msgid "Number/Reference must be unique per Company!"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,warranty_return_partner:0
+msgid "Where the customer has to send back the product(s)"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:274
+#, python-format
+msgid "There is no warehouse for the current user's company!"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_res_company
+msgid "Companies"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Damaged delivered product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim_make_picking.wizard,claim_line_ids:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_case_claim_lines
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_wizard_claim_line_ids
+msgid "Claim lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:192
+#, python-format
+msgid "Cannot find any date for invoice ! Must be a validated invoice !"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Action"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Claims"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Problem"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Treated"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim16
+msgid "Merchandise Not Received"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:crm.claim,number:0
+msgid "Company internal claim unique number"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.ui.menu,name:crm_claim_rma.menu_crm_case_claims_claim_line_substates
+msgid "Returned line substates"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Substate"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_invoice_out
+msgid "Customer Invoices"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim_make_picking.wizard,claim_line_source_location:0
+#: field:claim_make_picking_from_picking.wizard,picking_line_source_location:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_from_picking_wizard_picking_line_source_location
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_make_picking_wizard_claim_line_source_location
+msgid "Source Location"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Claim n°"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_picking_out
+msgid "Deliveries"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+#: field:crm.claim,invoice_id:0
+#: model:ir.model,name:crm_claim_rma.model_account_invoice
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_invoice_id
+msgid "Invoice"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,invoice_line_id:0
+msgid "The invoice line related to the returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim_make_picking.wizard:0
+msgid "Cancel"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim21
+msgid "Missed Fulfilment Promise"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "In Progress"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.section,name:crm_claim_rma.section_after_sales_service
+msgid "After Sales Service"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Received, to control"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim17
+msgid "Merchandise Not As Described"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+msgid "Exchange request"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_substate_substate
+msgid "substate that precise a given state"
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:170
+#, python-format
+msgid "not_define"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.actions.act_window,name:crm_claim_rma.action_claim_picking_in
+msgid "Return Products"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Current"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,claim_origine:0
+#: selection:crm.claim,claim_type:0
+msgid "Other"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "New Products Return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_invoice_in
+msgid "Supplier Invoices"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+#: field:claim.line,product_id:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_product_id
+msgid "Product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,name:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_name
+#: model:ir.model.fields,field_description:crm_claim_rma.field_substate_substate_substate_descr
+#: field:substate.substate,substate_descr:0
+msgid "Description"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "Search Claims"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,claim_type:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_claim_type
+msgid "Claim type"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:claim.line,state:0
+msgid "Refused"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,unit_sale_price:0
+msgid "Unit sale price of the product. Auto filed if retrun done by invoice selection. BE CAREFUL AND CHECK the automatic value as don't take into account previous refounds, invoice discount, can be for 0 if product for free,..."
+msgstr ""
+
+#. module: crm_claim_rma
+#: code:addons/crm_claim_rma/crm_claim_rma.py:273
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:crm.claim,number:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_number
+msgid "Number"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_warehouse_lot_carrier_loss_id
+#: field:stock.warehouse,lot_carrier_loss_id:0
+msgid "Location Carrier Loss"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Follow Up"
+msgstr ""
+
+#. module: crm_claim_rma
+#: selection:crm.claim,claim_type:0
+msgid "Customer"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+#: field:crm.claim,invoice_ids:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_crm_claim_invoice_ids
+msgid "Refunds"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_account_invoice_refund
+msgid "Invoice Refund"
+msgstr ""
+
+#. module: crm_claim_rma
+#: field:claim.line,return_value:0
+#: model:ir.model.fields,field_description:crm_claim_rma.field_claim_line_return_value
+msgid "Total return"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,return_value:0
+msgid "Quantity returned * Unit sold price"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:crm.claim,claim_type:0
+msgid "customer = from customer to company ; supplier = from company to supplier"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim19
+msgid "Shipping Address Undeliverable"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.actions.act_window,name:crm_claim_rma.act_crm_claim_rma_picking_in
+msgid "Incomming Shipment and Returns"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:stock.picking.out:0
+msgid "Delivery orders to invoice"
+msgstr ""
+
+#. module: crm_claim_rma
+#: help:claim.line,move_in_id:0
+#: help:claim.line,move_out_id:0
+msgid "The move line related to the returned product"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:stock.location,name:crm_claim_rma.stock_location_breakage_loss
+msgid "Breakage Loss"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:crm.claim:0
+msgid "Sales Team"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:crm.case.categ,name:crm_claim_rma.categ_claim15
+msgid "Different Item"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_claim_make_picking_wizard
+msgid "Wizard to create pickings from claim lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model,name:crm_claim_rma.model_claim_make_picking_from_picking_wizard
+msgid "Wizard to create pickings from picking lines"
+msgstr ""
+
+#. module: crm_claim_rma
+#: view:claim.line:0
+msgid "In Progress Claims"
+msgstr ""
+
+#. module: crm_claim_rma
+#: model:ir.model.fields,field_description:crm_claim_rma.field_stock_warehouse_lot_refurbish_id
+#: field:stock.warehouse,lot_refurbish_id:0
+msgid "Location Refurbish"
+msgstr ""
+

=== added file 'crm_claim_rma/i18n/pt_BR.po'
--- crm_claim_rma/i18n/pt_BR.po	1970-01-01 00:00:00 +0000
+++ crm_claim_rma/i18n/pt_BR.po	2013-11-15 13:53:46 +0000
@@ -0,0 +1,869 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* crm_claim
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-16 15:03+0000\n"
+"PO-Revision-Date: 2013-08-16 15:03+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_claim
+#: help:crm.claim.stage,fold:0
+msgid "This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."
+msgstr "Esta fase não é visível, por exemplo, na barra de status ou vista kanban, quando não há registros em que fase para mostrar."
+
+#. module: crm_claim
+#: field:crm.claim.report,nbr:0
+msgid "# of Cases"
+msgstr "# de Casos"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: view:crm.claim.report:0
+msgid "Group By..."
+msgstr "Agrupar por..."
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Responsibilities"
+msgstr "Responsabilidades"
+
+#. module: crm_claim
+#: help:sale.config.settings,fetchmail_claim:0
+msgid "Allows you to configure your incoming mail server, and create claims from incoming emails."
+msgstr "Permite configurar o servidor de e-mails recebidos, e criar solicitações a partir de e-mails recebidos."
+
+#. module: crm_claim
+#: model:ir.model,name:crm_claim.model_crm_claim_stage
+msgid "Claim stages"
+msgstr "Estágios de Solicitações"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "March"
+msgstr "Março"
+
+#. module: crm_claim
+#: field:crm.claim.report,delay_close:0
+msgid "Delay to close"
+msgstr "Adiar o fechamento"
+
+#. module: crm_claim
+#: field:crm.claim,message_unread:0
+msgid "Unread Messages"
+msgstr "Mensagens não lidas"
+
+#. module: crm_claim
+#: field:crm.claim,resolution:0
+msgid "Resolution"
+msgstr "Solução"
+
+#. module: crm_claim
+#: field:crm.claim,company_id:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,company_id:0
+msgid "Company"
+msgstr "Empresa"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,help:crm_claim.crm_claim_categ_action
+msgid "<p class=\"oe_view_nocontent_create\">\n"
+"                Click to create a claim category.\n"
+"              </p><p>\n"
+"                Create claim categories to better manage and classify your\n"
+"                claims. Some example of claims can be: preventive action,\n"
+"                corrective action.\n"
+"              </p>\n"
+"            "
+msgstr "<p class=\"oe_view_nocontent_create\">\n"
+"                Clique para criar uma categoria de solicitação.\n"
+"              </p><p>\n"
+"                Crie categorias de solicitações para melhor gerenciar e classificar as solicitações,\n"
+"                Alguns exemplos de solicitações podem ser: ação preventiva, ação corretiva.\n"
+"              </p>\n"
+"            "
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "#Claim"
+msgstr "# Solicitação"
+
+#. module: crm_claim
+#: field:crm.claim.stage,name:0
+msgid "Stage Name"
+msgstr "Nome do Estágio"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Salesperson"
+msgstr "Vendedor"
+
+#. module: crm_claim
+#: selection:crm.claim,priority:0
+#: selection:crm.claim.report,priority:0
+msgid "Highest"
+msgstr "Máxima"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+#: field:crm.claim.report,day:0
+msgid "Day"
+msgstr "Dia"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Claim Description"
+msgstr "Descrição da Solicitação"
+
+#. module: crm_claim
+#: field:crm.claim,message_ids:0
+msgid "Messages"
+msgstr "Mensagens"
+
+#. module: crm_claim
+#: model:crm.case.categ,name:crm_claim.categ_claim1
+msgid "Factual Claims"
+msgstr "Solicitações com Fatos"
+
+#. module: crm_claim
+#: selection:crm.claim,state:0
+#: selection:crm.claim.report,state:0
+#: selection:crm.claim.stage,state:0
+msgid "Cancelled"
+msgstr "Cancelada"
+
+#. module: crm_claim
+#: model:crm.case.resource.type,name:crm_claim.type_claim2
+msgid "Preventive"
+msgstr "Preventiva"
+
+#. module: crm_claim
+#: help:crm.claim,message_unread:0
+msgid "If checked new messages require your attention."
+msgstr "Se marcado novas mensagens solicitarão sua atenção."
+
+#. module: crm_claim
+#: field:crm.claim.report,date_closed:0
+msgid "Close Date"
+msgstr "Data de Fechamento"
+
+#. module: crm_claim
+#: view:res.partner:0
+msgid "False"
+msgstr "Falso"
+
+#. module: crm_claim
+#: field:crm.claim,ref:0
+msgid "Reference"
+msgstr "Referência"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Date of claim"
+msgstr "Data da solicitação"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "# Mails"
+msgstr "# Emails"
+
+#. module: crm_claim
+#: help:crm.claim,message_summary:0
+msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views."
+msgstr "Contém o resumo da conversação (número de mensagens, ...). Este resumo é gerado diretamente em formato HTML para que possa ser inserido nas visões kanban."
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,date_deadline:0
+#: field:crm.claim.report,date_deadline:0
+msgid "Deadline"
+msgstr "Prazo Final"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,partner_id:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,partner_id:0
+#: model:ir.model,name:crm_claim.model_res_partner
+msgid "Partner"
+msgstr "Parceiro"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Follow Up"
+msgstr "Lembrete"
+
+#. module: crm_claim
+#: selection:crm.claim,type_action:0
+#: selection:crm.claim.report,type_action:0
+msgid "Preventive Action"
+msgstr "Ação Preventiva"
+
+#. module: crm_claim
+#: field:crm.claim.report,section_id:0
+msgid "Section"
+msgstr "Seção"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Root Causes"
+msgstr "Origens da Solicitação"
+
+#. module: crm_claim
+#: field:crm.claim,user_fault:0
+msgid "Trouble Responsible"
+msgstr "Responsável pela Solicitação"
+
+#. module: crm_claim
+#: field:crm.claim,priority:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,priority:0
+msgid "Priority"
+msgstr "Prioridade"
+
+#. module: crm_claim
+#: field:crm.claim.stage,fold:0
+msgid "Hide in Views when Empty"
+msgstr "Ocultar nas visualizações quando estiver vazio"
+
+#. module: crm_claim
+#: field:crm.claim,message_follower_ids:0
+msgid "Followers"
+msgstr "Seguidores"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: selection:crm.claim,state:0
+#: view:crm.claim.report:0
+#: model:crm.claim.stage,name:crm_claim.stage_claim1
+#: selection:crm.claim.stage,state:0
+msgid "New"
+msgstr "Nova"
+
+#. module: crm_claim
+#: field:crm.claim.stage,section_ids:0
+msgid "Sections"
+msgstr "Seções"
+
+#. module: crm_claim
+#: field:crm.claim,email_from:0
+msgid "Email"
+msgstr "Email"
+
+#. module: crm_claim
+#: selection:crm.claim,priority:0
+#: selection:crm.claim.report,priority:0
+msgid "Lowest"
+msgstr "Mínima"
+
+#. module: crm_claim
+#: field:crm.claim,action_next:0
+msgid "Next Action"
+msgstr "Próxima Ação"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "My Sales Team(s)"
+msgstr "Minha Equipe de Vendas"
+
+#. module: crm_claim
+#: field:crm.claim,create_date:0
+msgid "Creation Date"
+msgstr "Data de Criação"
+
+#. module: crm_claim
+#: field:crm.claim,name:0
+msgid "Claim Subject"
+msgstr "Assunto da Solicitação"
+
+#. module: crm_claim
+#: model:crm.claim.stage,name:crm_claim.stage_claim3
+msgid "Rejected"
+msgstr "Rejeitada"
+
+#. module: crm_claim
+#: field:crm.claim,date_action_next:0
+msgid "Next Action Date"
+msgstr "Data da Próxima Ação"
+
+#. module: crm_claim
+#: model:ir.model,name:crm_claim.model_sale_config_settings
+msgid "sale.config.settings"
+msgstr "sale.config.settings"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,help:crm_claim.action_report_crm_claim
+msgid "Have a general overview of all claims processed in the system by sorting them with specific criteria."
+msgstr "Tenha uma visão geral de todas as solicitações processadas no sistema classificando-as com critérios específicos."
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "July"
+msgstr "Julho"
+
+#. module: crm_claim
+#: view:crm.claim.stage:0
+#: model:ir.actions.act_window,name:crm_claim.crm_claim_stage_act
+msgid "Claim Stages"
+msgstr "Estágios da Solicitação"
+
+#. module: crm_claim
+#: model:ir.ui.menu,name:crm_claim.menu_crm_case_claim-act
+msgid "Categories"
+msgstr "Categorias"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,stage_id:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,stage_id:0
+msgid "Stage"
+msgstr "Estágio"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Dates"
+msgstr "Datas"
+
+#. module: crm_claim
+#: help:crm.claim,email_from:0
+msgid "Destination email for email gateway."
+msgstr "Email de destino para o servidor de email."
+
+#. module: crm_claim
+#: code:addons/crm_claim/crm_claim.py:194
+#, python-format
+msgid "No Subject"
+msgstr "Sem Assunto"
+
+#. module: crm_claim
+#: help:crm.claim.stage,state:0
+msgid "The related status for the stage. The status of your document will automatically change regarding the selected stage. For example, if a stage is related to the status 'Close', when your document reaches this stage, it will be automatically have the 'closed' status."
+msgstr "O estado relacionado para o estágio. A situação do documento muda automaticamente em relação à fase selecionada. Por exemplo, se uma etapa está relacionada ao \"Fechamento\", quando o documento chega a esta fase, ficará automaticamente com a situação de 'fechado'."
+
+#. module: crm_claim
+#: field:crm.claim,contact_id:0
+msgid "Contact"
+msgstr "Contato"
+
+#. module: crm_claim
+#: model:ir.ui.menu,name:crm_claim.menu_claim_stage_view
+msgid "Stages"
+msgstr "Estágios"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,name:crm_claim.action_report_crm_claim
+#: model:ir.ui.menu,name:crm_claim.menu_report_crm_claim_tree
+msgid "Claims Analysis"
+msgstr "Análise das Solicitações"
+
+#. module: crm_claim
+#: help:crm.claim.report,delay_close:0
+msgid "Number of Days to close the case"
+msgstr "Número de Dias para concluir o caso"
+
+#. module: crm_claim
+#: model:ir.model,name:crm_claim.model_crm_claim_report
+msgid "CRM Claim Report"
+msgstr "Relatório de Solicitações no CRM"
+
+#. module: crm_claim
+#: view:sale.config.settings:0
+msgid "Configure"
+msgstr "Configurar"
+
+#. module: crm_claim
+#: model:crm.case.resource.type,name:crm_claim.type_claim1
+msgid "Corrective"
+msgstr "Corretiva"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "September"
+msgstr "Setembro"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "December"
+msgstr "Dezembro"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+#: field:crm.claim.report,month:0
+msgid "Month"
+msgstr "Mês"
+
+#. module: crm_claim
+#: field:crm.claim,type_action:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,type_action:0
+msgid "Action Type"
+msgstr "Tipo de Ação"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Settle"
+msgstr "Resolvido"
+
+#. module: crm_claim
+#: field:crm.claim,write_date:0
+msgid "Update Date"
+msgstr "Data de Atualização"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Year of claim"
+msgstr "Ano da solicitação"
+
+#. module: crm_claim
+#: help:crm.claim.stage,case_default:0
+msgid "If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."
+msgstr "Se você marcar este campo, esta etapa será proposta por padrão em cada equipe de vendas. Não irá atribuir esta fase às equipes já existentes."
+
+#. module: crm_claim
+#: field:crm.claim,categ_id:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,categ_id:0
+msgid "Category"
+msgstr "Categoria"
+
+#. module: crm_claim
+#: model:crm.case.categ,name:crm_claim.categ_claim2
+msgid "Value Claims"
+msgstr "Solicitações de Valor"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Responsible User"
+msgstr "Usuário Responsável"
+
+#. module: crm_claim
+#: field:crm.claim,email_cc:0
+msgid "Watchers Emails"
+msgstr "Emails dos Observadores"
+
+#. module: crm_claim
+#: help:crm.claim,email_cc:0
+msgid "These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"
+msgstr "Estes endereços de email serão adicionados no o campo CC de todas entradas e saídas de emails para este registro antes do mesmo ser enviado. Separe múltiplos endereços de email com vírgula."
+
+#. module: crm_claim
+#: selection:crm.claim.report,state:0
+msgid "Draft"
+msgstr "Provisório"
+
+#. module: crm_claim
+#: selection:crm.claim,priority:0
+#: selection:crm.claim.report,priority:0
+msgid "Low"
+msgstr "Baixa"
+
+#. module: crm_claim
+#: field:crm.claim,date_closed:0
+#: selection:crm.claim,state:0
+#: selection:crm.claim.report,state:0
+#: selection:crm.claim.stage,state:0
+msgid "Closed"
+msgstr "Fechada"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Reject"
+msgstr "Rejeitar"
+
+#. module: crm_claim
+#: view:res.partner:0
+msgid "Partners Claim"
+msgstr "Solicitações de Parceiros"
+
+#. module: crm_claim
+#: view:crm.claim.stage:0
+msgid "Claim Stage"
+msgstr "Estágio da Solicitação"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: selection:crm.claim,state:0
+#: view:crm.claim.report:0
+#: selection:crm.claim.report,state:0
+#: selection:crm.claim.stage,state:0
+msgid "Pending"
+msgstr "Pendente"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,state:0
+#: view:crm.claim.report:0
+#: field:crm.claim.report,state:0
+#: field:crm.claim.stage,state:0
+msgid "Status"
+msgstr "Situação"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "August"
+msgstr "Agosto"
+
+#. module: crm_claim
+#: selection:crm.claim,priority:0
+#: selection:crm.claim.report,priority:0
+msgid "Normal"
+msgstr "Normal"
+
+#. module: crm_claim
+#: help:crm.claim.stage,sequence:0
+msgid "Used to order stages. Lower is better."
+msgstr "Usado para ordenar estágios. Mais baixo é melhor."
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "June"
+msgstr "Junho"
+
+#. module: crm_claim
+#: field:crm.claim,id:0
+msgid "ID"
+msgstr "ID"
+
+#. module: crm_claim
+#: field:crm.claim,partner_phone:0
+msgid "Phone"
+msgstr "Telefone"
+
+#. module: crm_claim
+#: field:crm.claim,message_is_follower:0
+msgid "Is a Follower"
+msgstr "É um Seguidor"
+
+#. module: crm_claim
+#: field:crm.claim.report,user_id:0
+msgid "User"
+msgstr "Usuário"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,help:crm_claim.crm_claim_stage_act
+msgid "<p class=\"oe_view_nocontent_create\">\n"
+"                Click to setup a new stage in the processing of the claims. \n"
+"              </p><p>\n"
+"                You can create claim stages to categorize the status of every\n"
+"                claim entered in the system. The stages define all the steps\n"
+"                required for the resolution of a claim.\n"
+"              </p>\n"
+"            "
+msgstr "<p class=\"oe_view_nocontent_create\">\n"
+"                Clique para configurar um novo estágio na resolução de solicitações. \n"
+"              </p><p>\n"
+"                Você pode criar estágios para categorizar a situação de cada\n"
+"                solicitação inserida no sistema. Os estágios definem todos os passos\n"
+"                necessários para resolver a solicitação.\n"
+"              </p>\n"
+"            "
+
+#. module: crm_claim
+#: help:crm.claim,state:0
+msgid "The status is set to 'Draft', when a case is created.                      If the case is in progress the status is set to 'Open'.                      When the case is over, the status is set to 'Done'.                      If the case needs to be reviewed then the status is                       set to 'Pending'."
+msgstr "A situação é definida como 'Provisória' quando o caso é criado. Se o caso está em progresso, a situação muda para 'Aberto'. Quando o caso termina, a situação é definida como 'Concluído'. Se o caso precisa ser revisado, a situação é definida como 'Pendente'."
+
+#. module: crm_claim
+#: field:crm.claim,active:0
+msgid "Active"
+msgstr "Ativa"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "November"
+msgstr "Novembro"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Extended Filters..."
+msgstr "Filtros Extendidos..."
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Closure"
+msgstr "Encerramento"
+
+#. module: crm_claim
+#: help:crm.claim,section_id:0
+msgid "Responsible sales team. Define Responsible user and Email account for mail gateway."
+msgstr "Responsável da Equipe de Vendas. Definir o usuário e email para o servidor de emails."
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "October"
+msgstr "Outubro"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "January"
+msgstr "Janeiro"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,date:0
+msgid "Claim Date"
+msgstr "Data da Solicitação"
+
+#. module: crm_claim
+#: field:crm.claim,message_summary:0
+msgid "Summary"
+msgstr "Resumo"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,name:crm_claim.crm_claim_categ_action
+msgid "Claim Categories"
+msgstr "Categorias de Solicitações"
+
+#. module: crm_claim
+#: field:crm.claim.stage,case_default:0
+msgid "Common to All Teams"
+msgstr "Comum a Todas as Equipes"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: view:crm.claim.report:0
+#: model:ir.actions.act_window,name:crm_claim.act_claim_partner
+#: model:ir.actions.act_window,name:crm_claim.crm_case_categ_claim0
+#: model:ir.ui.menu,name:crm_claim.menu_crm_case_claims
+#: view:res.partner:0
+#: field:res.partner,claims_ids:0
+msgid "Claims"
+msgstr "Solicitações"
+
+#. module: crm_claim
+#: selection:crm.claim,type_action:0
+#: selection:crm.claim.report,type_action:0
+msgid "Corrective Action"
+msgstr "Ação Corretiva"
+
+#. module: crm_claim
+#: model:crm.case.categ,name:crm_claim.categ_claim3
+msgid "Policy Claims"
+msgstr "Política de Solicitações"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Date Closed"
+msgstr "Data de Fechamento"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: model:ir.model,name:crm_claim.model_crm_claim
+#: model:ir.ui.menu,name:crm_claim.menu_config_claim
+msgid "Claim"
+msgstr "Solicitação"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "My Company"
+msgstr "Minha Empresa"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Done"
+msgstr "Concluído"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Claim Reporter"
+msgstr "Solicitante"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+#: selection:crm.claim.report,state:0
+msgid "Open"
+msgstr "Aberto"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "New Claims"
+msgstr "Novas Solicitações"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: selection:crm.claim,state:0
+#: model:crm.claim.stage,name:crm_claim.stage_claim5
+#: selection:crm.claim.stage,state:0
+msgid "In Progress"
+msgstr "Em Andamento"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: field:crm.claim,user_id:0
+msgid "Responsible"
+msgstr "Responsável"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Search"
+msgstr "Pesquisar"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Unassigned Claims"
+msgstr "Solicitações em aberto"
+
+#. module: crm_claim
+#: field:crm.claim.report,delay_expected:0
+msgid "Overpassed Deadline"
+msgstr "Prazo Ultrapassado"
+
+#. module: crm_claim
+#: field:crm.claim,cause:0
+msgid "Root Cause"
+msgstr "Origem"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Claim/Action Description"
+msgstr "Descrição da Solicitação / Ação"
+
+#. module: crm_claim
+#: field:crm.claim,description:0
+msgid "Description"
+msgstr "Descrição"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Search Claims"
+msgstr "Pesquisar Solicitações"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "May"
+msgstr "Maio"
+
+#. module: crm_claim
+#: view:crm.claim:0
+#: view:crm.claim.report:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Resolution Actions"
+msgstr "Ações de Resolução"
+
+#. module: crm_claim
+#: field:crm.claim.stage,case_refused:0
+msgid "Refused stage"
+msgstr "Estágio Recusado"
+
+#. module: crm_claim
+#: field:crm.claim.report,email:0
+msgid "# Emails"
+msgstr "# Emails"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "Month of claim"
+msgstr "Mês da solicitação"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "February"
+msgstr "Fevereiro"
+
+#. module: crm_claim
+#: model:ir.actions.act_window,help:crm_claim.crm_case_categ_claim0
+msgid "<p class=\"oe_view_nocontent_create\">\n"
+"                Record and track your customers' claims. Claims may be linked to a sales order or a lot.You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).Claims may automatically be linked to an email address using the mail gateway module.\n"
+"            </p>\n"
+"            "
+msgstr "<p class=\"oe_view_nocontent_create\">\n"
+"                Record and track your customers' claims. Claims may be linked to a sales order or a lot.You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).Claims may automatically be linked to an email address using the mail gateway module.\n"
+"            </p>\n"
+"            "
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+#: field:crm.claim.report,name:0
+msgid "Year"
+msgstr "Ano"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "My company"
+msgstr "Minha empresa"
+
+#. module: crm_claim
+#: selection:crm.claim.report,month:0
+msgid "April"
+msgstr "Abril"
+
+#. module: crm_claim
+#: view:crm.claim.report:0
+msgid "My Case(s)"
+msgstr "Meu(s) Caso(s)"
+
+#. module: crm_claim
+#: model:crm.claim.stage,name:crm_claim.stage_claim2
+msgid "Settled"
+msgstr "Resolvido"
+
+#. module: crm_claim
+#: help:crm.claim,message_ids:0
+msgid "Messages and communication history"
+msgstr "Histórico de mensagens e comunicação"
+
+#. module: crm_claim
+#: field:sale.config.settings,fetchmail_claim:0
+msgid "Create claims from incoming mails"
+msgstr "Criar solicitações a partir de emails"
+
+#. module: crm_claim
+#: field:crm.claim.stage,sequence:0
+msgid "Sequence"
+msgstr "Seqüência"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "Actions"
+msgstr "Ações"
+
+#. module: crm_claim
+#: selection:crm.claim,priority:0
+#: selection:crm.claim.report,priority:0
+msgid "High"
+msgstr "Alta"
+
+#. module: crm_claim
+#: field:crm.claim,section_id:0
+#: view:crm.claim.report:0
+msgid "Sales Team"
+msgstr "Equipe de Vendas"
+
+#. module: crm_claim
+#: field:crm.claim.report,create_date:0
+msgid "Create Date"
+msgstr "Data de Criação"
+
+#. module: crm_claim
+#: view:crm.claim:0
+msgid "In Progress Claims"
+msgstr "Solicitações em Andamento"
+
+#. module: crm_claim
+#: help:crm.claim.stage,section_ids:0
+msgid "Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."
+msgstr "Conexão entre estágios e equipes de vendas. Quando definido, ele limita o estágio atual às equipes de vendas selecionadas."
+
+#. module: crm_claim
+#: help:crm.claim.stage,case_refused:0
+msgid "Refused stages are specific stages for done."
+msgstr "Estágios de Recusados são específicos para concluídos."
+

=== removed file 'crm_claim_rma/images/claim.png'
Binary files crm_claim_rma/images/claim.png	2011-10-13 09:01:22 +0000 and crm_claim_rma/images/claim.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'crm_claim_rma/images/exchange.png'
Binary files crm_claim_rma/images/exchange.png	2011-10-13 09:01:22 +0000 and crm_claim_rma/images/exchange.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'crm_claim_rma/images/product_return.png'
Binary files crm_claim_rma/images/product_return.png	2011-10-13 09:01:22 +0000 and crm_claim_rma/images/product_return.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'crm_claim_rma/images/return_line.png'
Binary files crm_claim_rma/images/return_line.png	2011-10-13 09:01:22 +0000 and crm_claim_rma/images/return_line.png	1970-01-01 00:00:00 +0000 differ
=== modified file 'crm_claim_rma/res_company.py'
--- crm_claim_rma/res_company.py	2013-02-22 22:40:51 +0000
+++ crm_claim_rma/res_company.py	2013-11-15 13:53:46 +0000
@@ -1,33 +1,38 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau, 	#
-# Emmanuel Samyn, Benoît Guillot                                        #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-from osv import fields, osv
-
-class res_company(osv.osv):
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm, osv
+
+
+class res_company(orm.Model):
+    
     _inherit = "res.company"
 
     _columns = {
-        'crm_return_address_id': fields.many2one('res.partner', 'Crm return address', help="Default address where the customers has to send back the returned product in a crm claim. If empty the address is the company address"),
+        'crm_return_address_id': fields.many2one('res.partner', 
+            'Crm return address',
+            help="Default address where the customers has to send back the "
+                 "returned product in a crm claim. If empty the address is the "
+                 "company address"),
     }
 
-res_company()
+

=== modified file 'crm_claim_rma/res_company_view.xml'
--- crm_claim_rma/res_company_view.xml	2013-02-22 22:40:51 +0000
+++ crm_claim_rma/res_company_view.xml	2013-11-15 13:53:46 +0000
@@ -1,15 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-  crm_claim_rma for OpenERP
-  Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>
-  The licence is in the file __openerp__.py
--->
-
 <openerp>
     <data>
         <!-- INHERITED VIEW FOR THE OBJECT : res_company -->
 
-        <record id="crm_claim_rma.company_form" model="ir.ui.view">
+        <record id="company_form" model="ir.ui.view">
             <field name="name">crm_claim_rma.company_form</field>
             <field name="model">res.company</field>
             <field name="inherit_id" ref="base.view_company_form" />

=== removed file 'crm_claim_rma/rma_data.xml'
--- crm_claim_rma/rma_data.xml	2012-09-12 09:29:21 +0000
+++ crm_claim_rma/rma_data.xml	1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
-<?xml version="1.0" ?>
-<openerp>
-    <data>
-<!-- Sequences for crm.claim -->
-        <record id="seq_type_crm_claim" model="ir.sequence.type">
-            <field name="name">CRM claim</field>
-            <field name="code">crm.claim</field>
-        </record>
-
-        <record id="seq_crm_claim" model="ir.sequence">
-            <field name="name">CRM claim</field>
-            <field name="code">crm.claim</field>
-            <field name="prefix">CL/%(year)s/</field>
-            <field name="padding">5</field>
-        </record>
-        
-<!-- STANDARD SUBSTATE FOR CLAIM RMA -->
-<!-- TO TREATE -->
-        <record id="rma_to_treate_refund" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;To refund&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product has to be refunded&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_to_treate_exchange" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;To exchange&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product has to be exchanged&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_to_treate_repair" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;To repair&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product has to be repaired&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_to_treate_send_supplier" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;To send back to supplier&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product has to be sent back to supplier&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_to_treate_back_from_supplier" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Back from supplier, to send to customer&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product has to be sent back from supplier and is to be sent back to customer&quot;&quot;&quot;" />
-        </record>
-<!-- TREATED -->        
-        <record id="rma_treated_refund" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Refunded and stock&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product refunded and sent back to stock&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_treated_refund_waste" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Refunded and waste&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product refunded and sent to waste&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_treated_exchange" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Exchanged&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product exchanged&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_treated_repair" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Repaired&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product repaired&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_treated_sent_to_supplier" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Sent to supplier, pending&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product sent to supplier. Waiting for supplier response&quot;&quot;&quot;" />
-        </record>
-        <record id="rma_treated_repaired_by_supplier" model="substate.substate">
-            <field name="name" eval="&quot;&quot;&quot;Repaired by supplier and sent back to customer&quot;&quot;&quot;"/>
-            <field name="substate_descr" eval="&quot;&quot;&quot;Returned product repaired by supplier and sent back to customer&quot;&quot;&quot;" />
-        </record>
-    </data>
-</openerp>

=== modified file 'crm_claim_rma/stock.py'
--- crm_claim_rma/stock.py	2012-11-22 10:30:23 +0000
+++ crm_claim_rma/stock.py	2013-11-15 13:53:46 +0000
@@ -1,61 +1,81 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau, 	#
-# Emmanuel Samyn, Benoît Guillot                                        #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-from osv import fields, osv
-
-class stock_picking(osv.osv):
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm, osv
+
+
+class stock_picking(orm.Model):
 
     _inherit = "stock.picking"
-    
-
-    _columns = {
-        'claim_id': fields.many2one('crm.claim', 'Claim'),
-        'claim_picking': fields.boolean('Picking from Claim'),
-    }
-
-class stock_warehouse(osv.osv):
-
-    _inherit = "stock.warehouse"
-    
-
-    _columns = {
-        'lot_rma_id': fields.many2one('stock.location', 'Location RMA'),
-        'lot_carrier_loss_id': fields.many2one('stock.location', 'Location Carrier Loss'),
-        'lot_breakage_loss_id': fields.many2one('stock.location', 'Location Breakage Loss'),
-        'lot_refurbish_id': fields.many2one('stock.location', 'Location Refurbish'),
-    }
-
-#This part concern the case of a wrong picking out. We need to create a new stock_move in a micking already open.
-#In order to don't have to confirm the stock_move we override the create and confirm it at the creation only for this case
-
-class stock_move(osv.osv):
+
+    _columns = {
+        'claim_id': fields.many2one('crm.claim', 'Claim'),
+    }
+
+    def create(self, cr, user, vals, context=None):
+        if ('name' not in vals) or (vals.get('name')=='/'):
+            if vals['type'] != 'internal':
+                seq_obj_name =  'stock.picking.' + vals['type']
+            else:
+                seq_obj_name =  self._name
+            vals['name'] = self.pool.get('ir.sequence').get(cr, user, 
+                seq_obj_name,
+                context=context)
+        new_id = super(stock_picking, self).create(cr, user, vals, 
+            context=context)
+        return new_id
+
+
+class stock_picking_out(orm.Model):
+
+    _inherit = "stock.picking.out"
+    
+    _columns = {
+        'claim_id': fields.many2one('crm.claim', 'Claim'),
+    }
+
+
+class stock_picking_out(orm.Model):
+
+    _inherit = "stock.picking.in"
+    
+    _columns = {
+        'claim_id': fields.many2one('crm.claim', 'Claim'),
+    }
+
+
+#This part concern the case of a wrong picking out. We need to create a new 
+#stock_move in a picking already open.
+#In order to don't have to confirm the stock_move we override the create and
+#confirm it at the creation only for this case
+class stock_move(orm.Model):
     
     _inherit = "stock.move"
 
     def create(self, cr, uid, vals, context=None):
         move_id = super(stock_move, self).create(cr, uid, vals, context=context)
         if vals.get('picking_id'):
-            picking = self.pool.get('stock.picking').browse(cr, uid, vals['picking_id'], context=context)
-            if picking.claim_picking and picking.type == u'in':
-                move = self.write(cr, uid, move_id, {'state': 'confirmed'}, context=context)
-        return move_id
\ No newline at end of file
+            picking = self.pool.get('stock.picking').browse(cr, uid, 
+                vals['picking_id'], context=context)
+            if picking.claim_id and picking.type == u'in':
+                move = self.write(cr, uid, move_id, {'state': 'confirmed'},
+                    context=context)
+        return move_id

=== removed file 'crm_claim_rma/stock_data.xml'
--- crm_claim_rma/stock_data.xml	2012-10-05 13:12:51 +0000
+++ crm_claim_rma/stock_data.xml	1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-    <data noupdate="1">
-        <!--
-        Default Values for : Stock Location
-        -->
-        <record id="stock_location_carrier_loss" model="stock.location">
-            <field name="name">Carrier Loss</field>
-            <field name="usage">internal</field>
-            <field name="location_id" ref="stock.stock_location_company"/>
-        </record>
-        <record id="stock_location_rma" model="stock.location">
-            <field name="name">RMA</field>
-            <field name="usage">internal</field>
-            <field name="location_id" ref="stock.stock_location_company"/>
-        </record>
-        <record id="stock_location_breakage_loss" model="stock.location">
-            <field name="name">Breakage Loss</field>
-            <field name="usage">internal</field>
-            <field name="location_id" ref="stock.stock_location_company"/>
-        </record>
-        <record id="stock_location_refurbish" model="stock.location">
-            <field name="name">Refurbish</field>
-            <field name="usage">internal</field>
-            <field name="location_id" ref="stock.stock_location_company"/>
-        </record>
-        <record id="stock_location_mistake_loss" model="stock.location">
-            <field name="name">Mistake Loss</field>
-            <field name="usage">internal</field>
-            <field name="location_id" ref="stock.stock_location_company"/>
-        </record>
-        <!--
-        Default Values for : Stock Warehouse
-        -->
-        <record id="stock.warehouse0" model="stock.warehouse">
-            <field name="lot_rma_id" ref="stock_location_rma"/>
-            <field name="lot_breakage_loss_id" ref="stock_location_breakage_loss"/>
-            <field name="lot_carrier_loss_id" ref="stock_location_carrier_loss"/>
-            <field name="lot_refurbish_id" ref="stock_location_refurbish"/>
-        </record>
-    </data>
-</openerp>

=== modified file 'crm_claim_rma/stock_view.xml'
--- crm_claim_rma/stock_view.xml	2013-02-22 22:40:51 +0000
+++ crm_claim_rma/stock_view.xml	2013-11-15 13:53:46 +0000
@@ -1,89 +1,50 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-  crm_claim_rma for OpenERP
-  Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>
-  The licence is in the file __openerp__.py
--->
-
 <openerp>
     <data>
         <!-- INHERITED VIEW FOR THE OBJECT : stock_picking -->
 
-        <record id="crm_claim_rma.picking_in_form" model="ir.ui.view">
+        <record id="picking_in_form" model="ir.ui.view">
             <field name="name">crm_claim_rma.picking_in_form</field>
-            <field name="model">stock.picking</field>
+            <field name="model">stock.picking.in</field>
             <field name="inherit_id" ref="stock.view_picking_in_form" />
-            <field eval="16" name="priority"/>
             <field name="arch" type="xml">
-                <data>
-                    <xpath expr="/form/notebook/page[@string='Additional Info']/field[@name='type']" position="after">
-                        <field name="claim_id" />
-                        <field name="claim_picking" invisible="1"/>
-                    </xpath>
-<!--                If we use crm_claim_rma we should not use the old return products anymore-->
-                    <xpath expr="/form/notebook/page[@string='General Information']/group/button[@string='Return Products']" position="attributes">
-                        <attribute name="invisible">1</attribute>
-                    </xpath>
-                    <xpath expr="/form/notebook/page[@string='General Information']/group/button[@string='Return Products']" position="after">
-                        <group name="claim_picking_button" attrs="{'invisible':['|',
-                                                                ('state','&lt;&gt;','done'),
-                                                                ('claim_picking', '=', False)]}">
-                            <button name="%(action_stock_picking_from_claim_picking)d" 
-                                    string="Product to stock" type="action"/>
-                            <button name="%(action_loss_picking_from_claim_picking)d" 
-                                    string="Product to Loss" type="action"/>
-                            <button name="%(action_used_picking_from_claim_picking)d" 
-                                    string="Product to refurbish stock" type="action"/>
-                        </group>
-                    </xpath>
-                </data>
+                <xpath expr="//field[@name='move_type']" position="after">
+                    <field name="claim_id" />
+                </xpath>
             </field>
         </record>
 
-        <record id="crm_claim_rma.picking_out_form" model="ir.ui.view">
+        <record id="picking_out_form" model="ir.ui.view">
             <field name="name">crm_claim_rma.picking_out_form</field>
-            <field name="model">stock.picking</field>
+            <field name="model">stock.picking.out</field>
             <field name="inherit_id" ref="stock.view_picking_out_form" />
-            <field eval="16" name="priority"/>
-            <field name="arch" type="xml">
-                <data>
-                    <xpath expr="/form/notebook/page[@string='Additional info']/field[@name='type']" position="after">
-                        <field name="claim_id" />
-                    </xpath>
-<!--                If we use crm_claim_rma we should not use the old return products anymore-->
-                    <xpath expr="/form/notebook/page[@string='Products']/group/button[@string='Return Products']" position="attributes">
-                        <attribute name="invisible">1</attribute>
-                    </xpath>
-                </data>
-            </field>
-        </record>
-
-        <record id="crm_claim_rma.warehouse_form" model="ir.ui.view">
-            <field name="name">crm_claim_rma.warehouse_form</field>
-            <field name="model">stock.warehouse</field>
-            <field name="inherit_id" ref="stock.view_warehouse" />
-            <field eval="16" name="priority"/>
-            <field name="arch" type="xml">
-                <data>
-                    <xpath expr="/form/group/group/field[@name='lot_output_id']" position="after">
-                        <field name="lot_rma_id"/>
-                        <field name="lot_carrier_loss_id"/>
-                        <field name="lot_breakage_loss_id"/>
-                        <field name="lot_refurbish_id"/>
-                    </xpath>
-                </data>
+            <field name="arch" type="xml">
+                <xpath expr="/form/sheet/notebook/page/group/group/field[@name='move_type']" position="after">
+                    <field name="claim_id" />
+                </xpath>
             </field>
         </record>
         
         <record id="view_picking_in_search" model="ir.ui.view">
             <field name="name">crm_claim_rma.picking_in_search</field>
-            <field name="model">stock.picking</field>
+            <field name="model">stock.picking.in</field>
             <field name="inherit_id" ref="stock.view_picking_in_search" />
-            <field eval="16" name="priority"/>
-            <field name="arch" type="xml">
-                <filter string="To Invoice" position="after">
-                    <separator orientation="vertical"/>
-                    <filter string="RMA" name="to_do" icon="terp-accessories-archiver-minus" domain="[('claim_picking', '=', 'False'), ('claim_id', '!=', 'False')]" />
+            <field name="arch" type="xml">
+                <filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]" position="after">
+                    <separator/>
+                    <filter string="RMA" icon="terp-accessories-archiver-minus" domain="[('claim_id', '!=', 'False')]" />
+                </filter>
+            </field>
+        </record>
+
+        <record id="view_picking_out_search" model="ir.ui.view">
+            <field name="name">crm_claim_rma.picking_out_search</field>
+            <field name="model">stock.picking.out</field>
+            <field name="inherit_id" ref="stock.view_picking_out_search" />
+            <field name="arch" type="xml">
+                <filter icon="terp-dolar" name="to_invoice" string="To Invoice" domain="[('invoice_state','=','2binvoiced')]" help="Delivery orders to invoice" position="after">
+                    <separator/>
+                    <filter string="RMA" icon="terp-accessories-archiver-minus" domain="[('claim_id', '!=', 'False')]" />
                 </filter>
             </field>
         </record>

=== modified file 'crm_claim_rma/wizard/__init__.py'
--- crm_claim_rma/wizard/__init__.py	2012-09-17 14:54:41 +0000
+++ crm_claim_rma/wizard/__init__.py	2013-11-15 13:53:46 +0000
@@ -1,34 +1,23 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# Copyright (C) 2009-2011  Akretion, Raphaël Valyi, Sébastien Beau, 	#
-# Emmanuel Samyn							                            #
-#                                                                       #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-import returned_lines_from_serial
-#import returned_lines_from_invoice
-#import picking_from_returned_lines
-#import refund_from_returned_lines
-#import exchange_from_returned_lines
-#import picking_from_exchange_lines
-import get_empty_serial
-
-import claim_make_picking
-import account_invoice_refund
-import claim_make_picking_from_picking
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import claim_make_picking
+from . import account_invoice_refund

=== modified file 'crm_claim_rma/wizard/account_invoice_refund.py'
--- crm_claim_rma/wizard/account_invoice_refund.py	2012-10-12 15:10:03 +0000
+++ crm_claim_rma/wizard/account_invoice_refund.py	2013-11-15 13:53:46 +0000
@@ -1,33 +1,37 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-# crm_claim_rma for OpenERP                                             #
-# Copyright (C) 2012  Akretion,                                         #
-#                     Benoît GUILLOT <benoit.guillot@xxxxxxxxxxxx>      #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-from osv import fields, osv
-
-class account_invoice_refund(osv.osv_memory):
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm
+
+
+class account_invoice_refund(orm.TransientModel):
+    
     _inherit = "account.invoice.refund"
 
     def compute_refund(self, cr, uid, ids, mode='refund', context=None):
         if context is None: context={}
         if context.get('invoice_ids'):
             context['active_ids'] = context.get('invoice_ids')
-        return super(account_invoice_refund, self).compute_refund(cr, uid, ids, mode='refund', context=context)
+        return super(account_invoice_refund, self).compute_refund(cr, uid, ids,
+            mode='refund', context=context)
 
     def _get_description(self, cr, uid, context=None):
         if context is None: context = {}
@@ -38,9 +42,3 @@
         'description': _get_description,
     }
 
-
-
-
-account_invoice_refund()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'crm_claim_rma/wizard/claim_make_picking.py'
--- crm_claim_rma/wizard/claim_make_picking.py	2013-08-19 11:56:08 +0000
+++ crm_claim_rma/wizard/claim_make_picking.py	2013-11-15 13:53:46 +0000
@@ -1,83 +1,121 @@
 # -*- coding: utf-8 -*-
-#########################################################################
-#                                                                       #
-#                                                                       #
-#########################################################################
-#                                                                       #
-# crm_claim_rma for OpenERP                                             #
-# Copyright (C) 2009-2012  Akretion, Emmanuel Samyn,                    #
-#       Benoît GUILLOT <benoit.guillot@xxxxxxxxxxxx>                    #
-#This program is free software: you can redistribute it and/or modify   #
-#it under the terms of the GNU General Public License as published by   #
-#the Free Software Foundation, either version 3 of the License, or      #
-#(at your option) any later version.                                    #
-#                                                                       #
-#This program is distributed in the hope that it will be useful,        #
-#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
-#GNU General Public License for more details.                           #
-#                                                                       #
-#You should have received a copy of the GNU General Public License      #
-#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
-#########################################################################
-
-from osv import fields, osv
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm, osv
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
+from openerp import netsvc
+from openerp.tools.translate import _
 import time
-from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
-import netsvc
-from tools.translate import _
-
-
-class claim_make_picking(osv.osv_memory):
-    _name='claim_make_picking.wizard'
-    _description='Wizard to create pickings from claim lines'
+
+
+class claim_make_picking(orm.TransientModel):
+
+    _name = 'claim_make_picking.wizard'
+    _description = 'Wizard to create pickings from claim lines'
     _columns = {
-        'claim_line_source_location' : fields.many2one('stock.location', 'Source Location',help="Location where the returned products are from.", required=True),
-        'claim_line_dest_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", required=True),
-        'claim_line_ids' : fields.many2many('claim.line', 'claim_line_picking', 'claim_picking_id', 'claim_line_id', 'Claim lines'),
+        'claim_line_source_location': fields.many2one('stock.location',
+            'Source Location',
+            help="Location where the returned products are from.",
+            required=True),
+        'claim_line_dest_location': fields.many2one('stock.location',
+            'Dest. Location',
+            help="Location where the system will stock the returned products.",
+            required=True),
+        'claim_line_ids': fields.many2many('claim.line',
+            'claim_line_picking',
+            'claim_picking_id',
+            'claim_line_id',
+            'Claim lines'),
     }
 
     def _get_claim_lines(self, cr, uid, context):
         #TODO use custom states to show buttons of this wizard or not instead of raise an error
         if context is None: context = {}
         line_obj = self.pool.get('claim.line')
-        if context.get('picking_type') in ['in', 'loss']:
+        if context.get('picking_type') == 'out':
+            move_field = 'move_out_id'
+        else:
             move_field = 'move_in_id'
-        elif context.get('picking_type') == 'out':
-            move_field = 'move_out_id'
         good_lines = []
-        line_ids =  line_obj.search(cr, uid, [('claim_id', '=', context['active_id'])], context=context)
+        line_ids =  line_obj.search(cr, uid, 
+            [('claim_id', '=', context['active_id'])], context=context)
         for line in line_obj.browse(cr, uid, line_ids, context=context):
             if not line[move_field] or line[move_field].state == 'cancel':
                 good_lines.append(line.id)
         if not good_lines:
-            raise osv.except_osv(_('Error !'), _('A picking has already been created for this claim !'))
+            raise osv.except_osv(_('Error !'), 
+                _('A picking has already been created for this claim !'))
         return good_lines
 
     # Get default source location
     def _get_source_loc(self, cr, uid, context):
+        loc_id = False
         if context is None: context = {}
         warehouse_obj = self.pool.get('stock.warehouse')
         warehouse_id = context.get('warehouse_id')
         if context.get('picking_type') == 'out':
-            loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_stock_id'], context=context)['lot_stock_id'][0]
-        elif context.get('picking_type') in ['in', 'loss'] and context.get('partner_id'):
-            loc_id = self.pool.get('res.partner').read(cr, uid, context['partner_id'],
-                                              ['property_stock_customer'],
-                                              context=context)['property_stock_customer']
+            loc_id = warehouse_obj.read(cr, uid, 
+                warehouse_id, 
+                ['lot_stock_id'],
+                context=context)['lot_stock_id'][0]
+        elif context.get('partner_id'):
+            loc_id = self.pool.get('res.partner').read(cr, uid, 
+                context['partner_id'],
+                ['property_stock_customer'],
+                context=context)['property_stock_customer']
+        return loc_id
+
+    def _get_common_dest_location_from_line(self, cr, uid, line_ids, context):
+        """Return the ID of the common location between all lines. If notecommon
+        destination was  found, return False"""
+        loc_id = False
+        line_obj = self.pool.get('claim.line')
+        line_location = []
+        for line in line_obj.browse(cr, uid, line_ids, context=context):
+            if line.location_dest_id.id not in line_location:
+                line_location.append(line.location_dest_id.id)
+        if len (line_location) == 1:
+            loc_id = line_location[0]
         return loc_id
 
     # Get default destination location
     def _get_dest_loc(self, cr, uid, context):
+        """Return the location_id to use as destination.
+        If it's an outoing shippment: take the customer stock property 
+        If it's an incomming shippment take the location_dest_id common to all lines, or
+        if different, return None."""
         if context is None: context = {}
         warehouse_obj = self.pool.get('stock.warehouse')
         warehouse_id = context.get('warehouse_id')
-        if context.get('picking_type') == 'out':
-            loc_id = self.pool.get('res.partner').read(cr, uid, context.get('partner_id'), ['property_stock_customer'], context=context)['property_stock_customer'][0]
-        elif context.get('picking_type') == 'in':
-            loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_rma_id'], context=context)['lot_rma_id'][0]
-        elif context.get('picking_type') == 'loss':
-            loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_carrier_loss_id'], context=context)['lot_carrier_loss_id'][0]
+        loc_id = False
+        if context.get('picking_type') == 'out' and context.get('partner_id'):
+            loc_id = self.pool.get('res.partner').read(cr, uid, 
+                context.get('partner_id'),
+                ['property_stock_customer'],
+                context=context)['property_stock_customer'][0]
+        elif context.get('picking_type') == 'in' and context.get('partner_id'):
+            # Add the case of return to supplier ! 
+            line_ids = self._get_claim_lines(cr, uid, context=context)
+            loc_id = self._get_common_dest_location_from_line(cr, uid, 
+                line_ids, context=context)
         return loc_id
 
     _defaults = {
@@ -94,34 +132,41 @@
         picking_obj = self.pool.get('stock.picking')
         if context is None: context = {}
         view_obj = self.pool.get('ir.ui.view')
-        claim_picking = False
-        if context.get('picking_type') in ['in', 'loss']:
-            p_type = 'in'
-            view_xml_id = 'view_picking_in_form'
-            view_name = 'stock.picking.in.form'
-            write_field = 'move_in_id'
-            if context.get('picking_type') == 'in':
-                claim_picking = True
-                note = 'RMA picking in'
-                name = 'Customer picking in'
-            elif context.get('picking_type') == 'loss':
-                name = 'Customer product loss'
-                note = 'RMA product loss'
-        elif context.get('picking_type') == 'out':
+        name = 'RMA picking out'
+        if context.get('picking_type') == 'out':
             p_type = 'out'
             write_field = 'move_out_id'
             note = 'RMA picking out'
-            name = 'Customer picking out'
-            view_xml_id = 'view_picking_in_form'
-            view_name = 'stock.picking.in.form'
+            view_xml_id = 'stock_picking_form'
+            view_name = 'stock.picking.form'
+        else:
+            p_type = 'in'
+            view_xml_id = 'stock_picking_form'
+            view_name = 'stock.picking.form'
+            write_field = 'move_in_id'
+            if context.get('picking_type'):
+                note = 'RMA picking ' + str(context.get('picking_type'))
+                name = note
         view_id = view_obj.search(cr, uid, [
                                             ('xml_id', '=', view_xml_id),
+                                            ('model', '=', 'stock.picking'),
                                             ('type', '=', 'form'),
                                             ('name', '=', view_name)
                                             ], context=context)[0]
         wizard = self.browse(cr, uid, ids[0], context=context)
-        claim = self.pool.get('crm.claim').browse(cr, uid, context['active_id'], context=context)
+        claim = self.pool.get('crm.claim').browse(cr, uid, 
+            context['active_id'], context=context)
         partner_id = claim.partner_id.id
+        line_ids = [x.id for x in wizard.claim_line_ids]
+        # In case of product return, we don't allow one picking for various
+        # product if location are different
+        if context.get('product_return'):
+            common_dest_loc_id = self._get_common_dest_location_from_line(cr, uid, 
+                    line_ids, context=context)
+            if not common_dest_loc_id:
+                raise osv.except_osv(_('Error !'), 
+                    _('A product return cannot be created for various destination location, please '
+                      'chose line with a same destination location.'))
         # create picking
         picking_id = picking_obj.create(cr, uid, {
                     'origin': claim.number,
@@ -136,7 +181,6 @@
                     'location_dest_id': wizard.claim_line_dest_location.id,
                     'note' : note,
                     'claim_id': claim.id,
-                    'claim_picking': claim_picking
                 })
         # Create picking lines
         for wizard_claim_line in wizard.claim_line_ids:
@@ -161,17 +205,20 @@
                     'location_dest_id': wizard.claim_line_dest_location.id,
                     'note': note,
                 })
-            self.pool.get('claim.line').write(cr, uid, wizard_claim_line.id, {write_field: move_id}, context=context)
+            self.pool.get('claim.line').write(cr, uid, 
+                wizard_claim_line.id, {write_field: move_id}, context=context)
         wf_service = netsvc.LocalService("workflow")
         if picking_id:
-            wf_service.trg_validate(uid, 'stock.picking', picking_id,'button_confirm', cr)
+            wf_service.trg_validate(uid, 'stock.picking', 
+                picking_id,'button_confirm', cr)
             picking_obj.action_assign(cr, uid, [picking_id])
+        domain = "[('type','=','%s'),('partner_id','=',%s)]"%(p_type, partner_id)
         return {
             'name': '%s' % name,
             'view_type': 'form',
             'view_mode': 'form',
             'view_id': view_id,
-            'domain' : "[('type', '=', '%s'),('partner_id','=',%s)]" % (p_type, partner_id),
+            'domain' : domain,
             'res_model': 'stock.picking',
             'res_id': picking_id,
             'type': 'ir.actions.act_window',

=== modified file 'crm_claim_rma/wizard/claim_make_picking_view.xml'
--- crm_claim_rma/wizard/claim_make_picking_view.xml	2013-02-22 22:40:51 +0000
+++ crm_claim_rma/wizard/claim_make_picking_view.xml	2013-11-15 13:53:46 +0000
@@ -27,18 +27,18 @@
         </record> 
 
         <record id="action_claim_picking_in" model="ir.actions.act_window">
-            <field name="name">action_claim_picking_in</field>
+            <field name="name">Return Products</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">claim_make_picking.wizard</field>
             <field name="src_model">crm.claim</field>
             <field name="view_type">form</field>
             <field name="view_mode">form</field>
             <field name="target">new</field> 
-            <field name="context">{'picking_type': 'in'}</field>
+            <field name="context">{'picking_type': 'in','product_return': True}</field>
         </record>
 
         <record id="action_claim_picking_out" model="ir.actions.act_window">
-            <field name="name">action_claim_picking_out</field>
+            <field name="name">Create Outgoing Shipments</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">claim_make_picking.wizard</field>
             <field name="src_model">crm.claim</field>
@@ -48,16 +48,5 @@
             <field name="context">{'picking_type': 'out'}</field>
         </record>
 
-        <record id="action_claim_picking_loss" model="ir.actions.act_window">
-            <field name="name">action_claim_picking_loss</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">claim_make_picking.wizard</field>
-            <field name="src_model">crm.claim</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="target">new</field> 
-            <field name="context">{'picking_type': 'loss'}</field>
-        </record>
-
     </data>
 </openerp>

=== added directory 'crm_rma_advance_location'
=== added file 'crm_rma_advance_location/__init__.py'
--- crm_rma_advance_location/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import stock
+from . import wizard
+

=== added file 'crm_rma_advance_location/__openerp__.py'
--- crm_rma_advance_location/__openerp__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{'name': 'RMA Claims Advance Location',
+ 'version': '1.0',
+ 'category': 'Generic Modules/CRM & SRM',
+ 'depends': ['crm_claim_rma'
+             ],
+ 'author': 'Akretion',
+ 'license': 'AGPL-3',
+ 'website': 'http://www.akretion.com',
+ 'description': """
+RMA Claim Advance Location
+==========================
+
+This module adds the following location on warehouses :
+
+ * Carrier Loss
+ * RMA
+ * Breakage Loss 
+ * Refurbish
+ * Mistake Loss
+
+And also various wizards on icoming deliveries that allow you to move your goods easily in those
+new locations from a done reception.
+
+Using this module make the logistic flow of return a bit more complexe:
+
+ * Returning product goes into RMA location with a incoming shipment
+ * From the incoming shipment, forward them to another places (stock, loss,...)
+
+WARNING: Use with caution, this module is currently not yet completely debugged and is waiting his author to be.
+
+""",
+ 'images': [],
+ 'demo': [],
+ 'data': [
+    'wizard/claim_make_picking_from_picking_view.xml',
+    'wizard/claim_make_picking_view.xml',
+    'stock_view.xml',
+    'stock_data.xml',
+    'claim_rma_view.xml',
+ ],
+ 'installable': True,
+ 'application': True,
+}

=== added file 'crm_rma_advance_location/claim_rma_view.xml'
--- crm_rma_advance_location/claim_rma_view.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/claim_rma_view.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+    <record model="ir.ui.view" id="crm_claim_rma_form_view">
+        <field name="name">CRM - Claim product return Form</field>
+        <field name="model">crm.claim</field>
+        <field name="inherit_id" ref="crm_claim_rma.crm_claim_rma_form_view"/>
+        <field name="arch" type="xml">
+            <xpath expr="//button[@string='New Delivery']" position="after">
+                <button name="%(action_claim_picking_loss)d"
+                                string="New Product Loss" states="open"
+                                type="action" target="new"
+                                context="{'warehouse_id': warehouse_id,
+                                    'partner_id': partner_id}"/>
+            </xpath>
+        </field>
+    </record>
+
+     </data>
+</openerp>

=== added directory 'crm_rma_advance_location/i18n'
=== added file 'crm_rma_advance_location/i18n/crm_rma_advance_location.pot'
--- crm_rma_advance_location/i18n/crm_rma_advance_location.pot	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/i18n/crm_rma_advance_location.pot	2013-11-15 13:53:46 +0000
@@ -0,0 +1,122 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* crm_rma_advance_location
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-15 13:27+0000\n"
+"PO-Revision-Date: 2013-11-15 13:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_rma_advance_location
+#: model:ir.actions.act_window,name:crm_rma_advance_location.action_claim_picking_loss
+msgid "Create Products Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.actions.act_window,name:crm_rma_advance_location.action_used_picking_from_claim_picking
+msgid "Create Incomming Shipment to Refurbish Location"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:claim_make_picking_from_picking.wizard:0
+msgid "Locations"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:claim_make_picking_from_picking.wizard:0
+msgid "Select lines for picking"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:stock.location,name:crm_rma_advance_location.stock_location_breakage_loss
+msgid "Breakage Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.model,name:crm_rma_advance_location.model_claim_make_picking_wizard
+msgid "Wizard to create pickings from claim lines"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:stock.location,name:crm_rma_advance_location.stock_location_carrier_loss
+msgid "Carrier Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:stock.location,name:crm_rma_advance_location.stock_location_mistake_loss
+msgid "Mistake Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.actions.act_window,name:crm_rma_advance_location.action_loss_picking_from_claim_picking
+msgid "Create Incomming Shipment to Breakkage Loss Location"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:stock.picking.in:0
+msgid "Product to refurbish stock"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.model,name:crm_rma_advance_location.model_stock_warehouse
+msgid "Warehouse"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:stock.location,name:crm_rma_advance_location.stock_location_rma
+msgid "RMA"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:stock.location,name:crm_rma_advance_location.stock_location_refurbish
+msgid "Refurbish"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:stock.picking.in:0
+msgid "Product to stock"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.actions.act_window,name:crm_rma_advance_location.action_stock_picking_from_claim_picking
+msgid "Create Incomming Shipment to Stock"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:claim_make_picking_from_picking.wizard:0
+msgid "Create picking"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:claim_make_picking_from_picking.wizard:0
+msgid "Cancel"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:crm.claim:0
+msgid "New Product Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: model:ir.model,name:crm_rma_advance_location.model_claim_make_picking_from_picking_wizard
+msgid "Wizard to create pickings from picking lines"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:stock.picking.in:0
+msgid "Product to Loss"
+msgstr ""
+
+#. module: crm_rma_advance_location
+#: view:claim_make_picking_from_picking.wizard:0
+msgid "Select lines to add in picking"
+msgstr ""
+

=== added file 'crm_rma_advance_location/stock.py'
--- crm_rma_advance_location/stock.py	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/stock.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm, osv
+
+
+class stock_warehouse(orm.Model):
+
+    _inherit = "stock.warehouse"
+    
+    _columns = {
+        'lot_rma_id': fields.many2one('stock.location', 'Location RMA'),
+        'lot_carrier_loss_id': fields.many2one('stock.location',
+            'Location Carrier Loss'),
+        'lot_breakage_loss_id': fields.many2one('stock.location',
+            'Location Breakage Loss'),
+        'lot_refurbish_id': fields.many2one('stock.location',
+            'Location Refurbish'),
+    }

=== added file 'crm_rma_advance_location/stock_data.xml'
--- crm_rma_advance_location/stock_data.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/stock_data.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<openerp>
+    <data noupdate="1">
+        <!--
+        Default Values for : Stock Location
+        -->
+        <record id="stock_location_carrier_loss" model="stock.location">
+            <field name="name">Carrier Loss</field>
+            <field name="usage">internal</field>
+            <field name="location_id" ref="stock.stock_location_company"/>
+        </record>
+        <record id="stock_location_rma" model="stock.location">
+            <field name="name">RMA</field>
+            <field name="usage">internal</field>
+            <field name="location_id" ref="stock.stock_location_company"/>
+        </record>
+        <record id="stock_location_breakage_loss" model="stock.location">
+            <field name="name">Breakage Loss</field>
+            <field name="usage">internal</field>
+            <field name="location_id" ref="stock.stock_location_company"/>
+        </record>
+        <record id="stock_location_refurbish" model="stock.location">
+            <field name="name">Refurbish</field>
+            <field name="usage">internal</field>
+            <field name="location_id" ref="stock.stock_location_company"/>
+        </record>
+        <record id="stock_location_mistake_loss" model="stock.location">
+            <field name="name">Mistake Loss</field>
+            <field name="usage">internal</field>
+            <field name="location_id" ref="stock.stock_location_company"/>
+        </record>
+        <!--
+        Default Values for : Stock Warehouse
+        -->
+        <record id="stock.warehouse0" model="stock.warehouse">
+            <field name="lot_rma_id" ref="stock_location_rma"/>
+            <field name="lot_breakage_loss_id" ref="stock_location_breakage_loss"/>
+            <field name="lot_carrier_loss_id" ref="stock_location_carrier_loss"/>
+            <field name="lot_refurbish_id" ref="stock_location_refurbish"/>
+        </record>
+    </data>
+</openerp>

=== added file 'crm_rma_advance_location/stock_view.xml'
--- crm_rma_advance_location/stock_view.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/stock_view.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- INHERITED VIEW FOR THE OBJECT : stock_picking -->
+
+        <record id="picking_in_form" model="ir.ui.view">
+            <field name="name">crm_claim_rma.picking_in_form</field>
+            <field name="model">stock.picking.in</field>
+            <field name="inherit_id" ref="stock.view_picking_in_form" />
+            <field name="arch" type="xml">
+                <!-- Those wizard aren't working yet -->
+                <xpath expr="/form/header/button[@string='Return Products']" position="after">
+                        <button name="%(action_stock_picking_from_claim_picking)d" 
+                                string="Product to stock" type="action"
+                                attrs="{'invisible':['|',
+                                                    ('state','&lt;&gt;','done'),
+                                                    ('claim_id', '=', False)]}"/>
+                        <button name="%(action_loss_picking_from_claim_picking)d" 
+                                string="Product to Loss" type="action"
+                                attrs="{'invisible':['|',
+                                                    ('state','&lt;&gt;','done'),
+                                                    ('claim_id', '=', False)]}"/>
+                        <button name="%(action_used_picking_from_claim_picking)d" 
+                                string="Product to refurbish stock" type="action"
+                                attrs="{'invisible':['|',
+                                                    ('state','&lt;&gt;','done'),
+                                                    ('claim_id', '=', False)]}"/>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="warehouse_form" model="ir.ui.view">
+            <field name="name">crm_claim_rma.warehouse_form</field>
+            <field name="model">stock.warehouse</field>
+            <field name="inherit_id" ref="stock.view_warehouse" />
+            <field name="arch" type="xml">
+                <xpath expr="/form/group/group/field[@name='lot_output_id']" position="after">
+                    <field name="lot_rma_id"/>
+                    <field name="lot_carrier_loss_id"/>
+                    <field name="lot_breakage_loss_id"/>
+                    <field name="lot_refurbish_id"/>
+                </xpath>
+            </field>
+        </record>
+        
+
+    </data>
+</openerp>

=== added directory 'crm_rma_advance_location/wizard'
=== added file 'crm_rma_advance_location/wizard/__init__.py'
--- crm_rma_advance_location/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/wizard/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import claim_make_picking_from_picking
+from . import claim_make_picking
\ No newline at end of file

=== added file 'crm_rma_advance_location/wizard/claim_make_picking.py'
--- crm_rma_advance_location/wizard/claim_make_picking.py	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/wizard/claim_make_picking.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+#########################################################################
+#                                                                       #
+#                                                                       #
+#########################################################################
+#                                                                       #
+# crm_claim_rma for OpenERP                                             #
+# Copyright (C) 2009-2012  Akretion, Emmanuel Samyn,                    #
+#       Benoît GUILLOT <benoit.guillot@xxxxxxxxxxxx>                    #
+#This program is free software: you can redistribute it and/or modify   #
+#it under the terms of the GNU General Public License as published by   #
+#the Free Software Foundation, either version 3 of the License, or      #
+#(at your option) any later version.                                    #
+#                                                                       #
+#This program is distributed in the hope that it will be useful,        #
+#but WITHOUT ANY WARRANTY; without even the implied warranty of         #
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
+#GNU General Public License for more details.                           #
+#                                                                       #
+#You should have received a copy of the GNU General Public License      #
+#along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
+#########################################################################
+from openerp.osv import fields, orm, osv
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
+from openerp import netsvc
+from openerp.tools.translate import _
+import time
+
+
+class claim_make_picking(orm.TransientModel):
+
+    _inherit = 'claim_make_picking.wizard'
+
+    # Get default destination location
+    def _get_dest_loc(self, cr, uid, context):
+        res = super(claim_make_picking, self)._get_dest_loc(cr, uid, 
+            context=context)
+        if context is None: context = {}
+        warehouse_obj = self.pool.get('stock.warehouse')
+        warehouse_id = context.get('warehouse_id')
+        if context.get('picking_type') == 'in':
+            loc_id = warehouse_obj.read(cr, uid, 
+                warehouse_id,
+                ['lot_rma_id'],
+                context=context)['lot_rma_id'][0]
+        elif context.get('picking_type') == 'loss':
+            loc_id = warehouse_obj.read(cr, uid,
+                warehouse_id,
+                ['lot_carrier_loss_id'],
+                context=context)['lot_carrier_loss_id'][0]
+        return loc_id
+
+    _defaults = {
+        'claim_line_dest_location': _get_dest_loc,
+    }
+

=== renamed file 'crm_claim_rma/wizard/claim_make_picking_from_picking.py' => 'crm_rma_advance_location/wizard/claim_make_picking_from_picking.py'
--- crm_claim_rma/wizard/claim_make_picking_from_picking.py	2013-08-19 11:56:08 +0000
+++ crm_rma_advance_location/wizard/claim_make_picking_from_picking.py	2013-11-15 13:53:46 +0000
@@ -20,41 +20,59 @@
 #You should have received a copy of the GNU General Public License      #
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
-
-from osv import fields, osv
+from openerp.osv import fields, orm
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
+from openerp import netsvc
 import time
-from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
-import netsvc
-
-
-class claim_make_picking_from_picking(osv.osv_memory):
-    _name='claim_make_picking_from_picking.wizard'
-    _description='Wizard to create pickings from picking lines'
+
+
+class claim_make_picking_from_picking(orm.TransientModel):
+
+    _name = 'claim_make_picking_from_picking.wizard'
+    _description = 'Wizard to create pickings from picking lines'
     _columns = {
-        'picking_line_source_location' : fields.many2one('stock.location', 'Source Location',help="Location where the returned products are from.", required=True),
-        'picking_line_dest_location' : fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the returned products.", required=True),
-        'picking_line_ids' : fields.many2many('stock.move', 'claim_picking_line_picking', 'claim_picking_id', 'picking_line_id', 'Picking lines'),
+        'picking_line_source_location': fields.many2one('stock.location',
+            'Source Location',
+            help="Location where the returned products are from.",
+            required=True),
+        'picking_line_dest_location': fields.many2one('stock.location',
+            'Dest. Location',
+            help="Location where the system will stock the returned products.",
+            required=True),
+        'picking_line_ids': fields.many2many('stock.move',
+            'claim_picking_line_picking',
+            'claim_picking_id',
+            'picking_line_id',
+            'Picking lines'),
     }
 
+    def _get_default_warehouse(self, cr, uid, context=None):
+        warehouse_id=self.pool.get('crm.claim')._get_default_warehouse(cr, uid, context=context)
+        return warehouse_id
+
     def _get_picking_lines(self, cr, uid, context):
-        return self.pool.get('stock.picking').read(cr, uid, context['active_id'], ['move_lines'], context=context)['move_lines']
+        return self.pool.get('stock.picking').read(cr, uid,
+            context['active_id'], ['move_lines'], context=context)['move_lines']
 
     # Get default source location
     def _get_source_loc(self, cr, uid, context):
         if context is None: context = {}
         warehouse_obj = self.pool.get('stock.warehouse')
-        warehouse_id = context.get('warehouse_id')
-        return warehouse_obj.read(cr, uid, warehouse_id, ['lot_rma_id'], context=context)['lot_rma_id'][0]
+        warehouse_id = self._get_default_warehouse(cr, uid, context=context)
+        return warehouse_obj.read(cr, uid,
+            warehouse_id, ['lot_rma_id'], context=context)['lot_rma_id'][0]
 
     # Get default destination location
     def _get_dest_loc(self, cr, uid, context):
         if context is None: context = {}
+        warehouse_id = self._get_default_warehouse(cr, uid, context=context)
         warehouse_obj = self.pool.get('stock.warehouse')
-        warehouse_id = context.get('warehouse_id')
+        import pdb;pdb.set_trace()
         if context.get('picking_type'):
             context_loc = context.get('picking_type')[8:]
             loc_field = 'lot_%s_id' %context.get('picking_type')[8:]
-            loc_id = warehouse_obj.read(cr, uid, warehouse_id, [loc_field], context=context)[loc_field][0]
+            loc_id = warehouse_obj.read(cr, uid,
+                warehouse_id, [loc_field], context=context)[loc_field][0]
         return loc_id
 
     _defaults = {
@@ -84,7 +102,8 @@
                                             ('name', '=', 'stock.picking.form')
                                             ], context=context)[0]
         wizard = self.browse(cr, uid, ids[0], context=context)
-        prev_picking = picking_obj.browse(cr, uid, context['active_id'], context=context)
+        prev_picking = picking_obj.browse(cr, uid,
+            context['active_id'], context=context)
         partner_id = prev_picking.partner_id.id
         # create picking
         picking_id = picking_obj.create(cr, uid, {
@@ -124,17 +143,22 @@
                     'location_dest_id': wizard.picking_line_dest_location.id,
                     'note': note,
                 })
-            wizard_move = move_obj.write(cr, uid, wizard_picking_line.id, {'move_dest_id': move_id}, context=context)
+            wizard_move = move_obj.write(cr, uid,
+                wizard_picking_line.id,
+                {'move_dest_id': move_id},
+                context=context)
         wf_service = netsvc.LocalService("workflow")
         if picking_id:
-            wf_service.trg_validate(uid, 'stock.picking', picking_id,'button_confirm', cr)
+            wf_service.trg_validate(uid, 
+                'stock.picking', picking_id,'button_confirm', cr)
             picking_obj.action_assign(cr, uid, [picking_id])
+        domain = "[('type','=','%s'),('partner_id','=',%s)]"%(p_type, partner_id)
         return {
             'name': '%s' % name,
             'view_type': 'form',
             'view_mode': 'form',
             'view_id': view_id,
-            'domain' : "[('type', '=', '%s'),('partner_id','=',%s)]" % (p_type, partner_id),
+            'domain' : domain,
             'res_model': 'stock.picking',
             'res_id': picking_id,
             'type': 'ir.actions.act_window',

=== renamed file 'crm_claim_rma/wizard/claim_make_picking_from_picking_view.xml' => 'crm_rma_advance_location/wizard/claim_make_picking_from_picking_view.xml'
--- crm_claim_rma/wizard/claim_make_picking_from_picking_view.xml	2013-02-22 22:40:51 +0000
+++ crm_rma_advance_location/wizard/claim_make_picking_from_picking_view.xml	2013-11-15 13:53:46 +0000
@@ -27,7 +27,7 @@
         </record> 
 
         <record id="action_stock_picking_from_claim_picking" model="ir.actions.act_window">
-            <field name="name">action_stock_picking_from_claim_picking</field>
+            <field name="name">Create Incomming Shipment to Stock</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">claim_make_picking_from_picking.wizard</field>
             <field name="src_model">stock.picking</field>
@@ -38,7 +38,7 @@
         </record>
 
         <record id="action_loss_picking_from_claim_picking" model="ir.actions.act_window">
-            <field name="name">action_loss_picking_from_claim_picking</field>
+            <field name="name">Create Incomming Shipment to Breakkage Loss Location</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">claim_make_picking_from_picking.wizard</field>
             <field name="src_model">stock.picking</field>
@@ -49,7 +49,7 @@
         </record>
 
         <record id="action_used_picking_from_claim_picking" model="ir.actions.act_window">
-            <field name="name">action_used_picking_from_claim_picking</field>
+            <field name="name">Create Incomming Shipment to Refurbish Location</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">claim_make_picking_from_picking.wizard</field>
             <field name="src_model">stock.picking</field>

=== added file 'crm_rma_advance_location/wizard/claim_make_picking_view.xml'
--- crm_rma_advance_location/wizard/claim_make_picking_view.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_advance_location/wizard/claim_make_picking_view.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  crm_claim_rma for OpenERP
+  Copyright (C) 2011 Akretion Benoît GUILLOT <benoit.guillot@xxxxxxxxxxxx>
+  The licence is in the file __openerp__.py
+-->
+<openerp>
+    <data>
+
+        <record id="action_claim_picking_loss" model="ir.actions.act_window">
+            <field name="name">Create Products Loss</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">claim_make_picking.wizard</field>
+            <field name="src_model">crm.claim</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="target">new</field> 
+            <field name="context">{'picking_type': 'loss'}</field>
+        </record>
+
+    </data>
+</openerp>

=== added directory 'crm_rma_by_shop'
=== added file 'crm_rma_by_shop/__init__.py'
--- crm_rma_by_shop/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_by_shop/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import claim
\ No newline at end of file

=== added file 'crm_rma_by_shop/__openerp__.py'
--- crm_rma_by_shop/__openerp__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_by_shop/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{'name': 'RMA Claims by shop',
+ 'version': '1.0',
+ 'category': 'Generic Modules/CRM & SRM',
+ 'depends': ['crm_claim', 'sale'
+             ],
+ 'author': 'Camptocamp',
+ 'license': 'AGPL-3',
+ 'website': 'http://www.camptocamp.com',
+ 'description': """
+RMA Claim by shops
+==================
+
+Claim improvements to use them by shops:
+
+ * Add shop on claim
+ * Add various filter in order to work on a basic "by shop" basis
+
+ Was originally designed for e-commerce purpose, but could probably do the trick 
+ for other cases as well.
+
+""",
+ 'images': [],
+ 'demo': [],
+ 'data': [
+    'claim_view.xml',
+ ],
+ 'installable': True,
+ 'application': True,
+}

=== added file 'crm_rma_by_shop/claim.py'
--- crm_rma_by_shop/claim.py	1970-01-01 00:00:00 +0000
+++ crm_rma_by_shop/claim.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import orm, fields
+
+
+class crm_claim(orm.Model):
+    """ Crm claim
+    """
+    _inherit = "crm.claim"
+
+    _columns = {
+        'shop_id': fields.many2one('sale.shop', 'Shop', select="1"),
+    }
+

=== added file 'crm_rma_by_shop/claim_view.xml'
--- crm_rma_by_shop/claim_view.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_by_shop/claim_view.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+        <!-- Claims    -->
+
+        <record model="ir.ui.view" id="crm_case_claims_tree_view">
+            <field name="name">CRM - Claims Tree</field>
+            <field name="model">crm.claim</field>
+            <field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view"/>
+            <field name="arch" type="xml">
+                <field name="user_id" position="before">
+                    <field name="shop_id"/>
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="crm_case_claims_form_view">
+            <field name="name">CRM - Claims Form</field>
+            <field name="model">crm.claim</field>
+            <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
+            <field name="arch" type="xml">
+                <field name="section_id" position="before">
+                    <field name="shop_id"/>
+                </field>
+            </field>
+        </record>
+        <!-- Crm claim Search view -->
+
+        <record id="view_crm_case_claims_filter" model="ir.ui.view">
+            <field name="name">CRM - Claims Search</field>
+            <field name="model">crm.claim</field>
+            <field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter"/>
+            <field name="arch" type="xml">
+                <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}" position="after">
+                    <filter string="Shop" domain="[]" context="{'group_by':'shop_id'}" />
+                </filter>
+            </field>
+        </record>
+
+
+     </data>
+</openerp>

=== added directory 'crm_rma_by_shop/i18n'
=== added file 'crm_rma_by_shop/i18n/crm_rma_by_shop.pot'
--- crm_rma_by_shop/i18n/crm_rma_by_shop.pot	1970-01-01 00:00:00 +0000
+++ crm_rma_by_shop/i18n/crm_rma_by_shop.pot	2013-11-15 13:53:46 +0000
@@ -0,0 +1,34 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* crm_rma_by_shop
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-15 13:29+0000\n"
+"PO-Revision-Date: 2013-11-15 13:29+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_rma_by_shop
+#: view:crm.claim:0
+#: field:crm.claim,shop_id:0
+#: model:ir.model.fields,field_description:crm_rma_by_shop.field_crm_claim_shop_id
+msgid "Shop"
+msgstr ""
+
+#. module: crm_rma_by_shop
+#: model:ir.model,name:crm_rma_by_shop.model_crm_claim
+msgid "Claim"
+msgstr ""
+
+#. module: crm_rma_by_shop
+#: view:crm.claim:0
+msgid "Type"
+msgstr ""
+

=== added directory 'crm_rma_lot_mass_return'
=== added file 'crm_rma_lot_mass_return/__init__.py'
--- crm_rma_lot_mass_return/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_lot_mass_return/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import wizard

=== added file 'crm_rma_lot_mass_return/__openerp__.py'
--- crm_rma_lot_mass_return/__openerp__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_lot_mass_return/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{'name': 'RMA Claims Mass Return by Lot',
+ 'version': '1.0',
+ 'category': 'Generic Modules/CRM & SRM',
+ 'depends': ['crm_claim_rma'
+             ],
+ 'author': 'Akretion',
+ 'license': 'AGPL-3',
+ 'website': 'http://www.akretion.com',
+ 'description': """
+RMA Claim Mass Return by Lot
+============================
+
+This module adds possibility to return a whole lot of product from a Claim
+and create a incoming shipment for them.
+
+
+WARNING: This module is currently not yet completely debugged and is waiting his author to be.
+
+""",
+ 'images': [],
+ 'demo': [],
+ 'data': [
+        'wizard/returned_lines_from_serial_wizard_view.xml',
+        'crm_rma_view.xml',
+ ],
+ 'installable': False,
+ 'application': True,
+}

=== added file 'crm_rma_lot_mass_return/crm_rma_view.xml'
--- crm_rma_lot_mass_return/crm_rma_view.xml	1970-01-01 00:00:00 +0000
+++ crm_rma_lot_mass_return/crm_rma_view.xml	2013-11-15 13:53:46 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+    <record model="ir.ui.view" id="crm_claim_rma_form_view">
+        <field name="name">CRM - Claim product return Form</field>
+        <field name="model">crm.claim</field>
+        <field name="inherit_id" ref="crm_claim_rma.crm_claim_rma_form_view"/>
+        <field name="arch" type="xml">
+            <xpath expr="//page[@string='Product Return']/group/group[2]" position="inside">
+                <button name="%(action_create_return_serial)d" string="Mass return from serial/lot" states="draft,open" type="action" target="new"/>
+            </xpath>
+        </field>
+    </record>
+
+     </data>
+</openerp>

=== added directory 'crm_rma_lot_mass_return/i18n'
=== added file 'crm_rma_lot_mass_return/i18n/crm_rma_lot_mass_return.pot'
--- crm_rma_lot_mass_return/i18n/crm_rma_lot_mass_return.pot	1970-01-01 00:00:00 +0000
+++ crm_rma_lot_mass_return/i18n/crm_rma_lot_mass_return.pot	2013-11-15 13:53:46 +0000
@@ -0,0 +1,67 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* crm_rma_lot_mass_return
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-15 13:30+0000\n"
+"PO-Revision-Date: 2013-11-15 13:30+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: crm_rma_lot_mass_return
+#: view:crm.claim:0
+msgid "Mass return from serial/lot"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Claim short description"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Select serial numbers to create"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: model:ir.actions.act_window,name:crm_rma_lot_mass_return.action_create_return_serial
+msgid "action_create_return_serial"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: model:ir.model,name:crm_rma_lot_mass_return.model_returned_lines_from_serial_wizard
+msgid "Wizard to create product return lines from serial numbers"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Quantity returned"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Save and close"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Save and new"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Cancel"
+msgstr ""
+
+#. module: crm_rma_lot_mass_return
+#: view:returned_lines_from_serial.wizard:0
+msgid "Serial / Lot Number"
+msgstr ""
+

=== added directory 'crm_rma_lot_mass_return/wizard'
=== added file 'crm_rma_lot_mass_return/wizard/__init__.py'
--- crm_rma_lot_mass_return/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ crm_rma_lot_mass_return/wizard/__init__.py	2013-11-15 13:53:46 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2013 Camptocamp
+#    Copyright 2009-2013 Akretion, 
+#    Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import returned_lines_from_serial

=== renamed file 'crm_claim_rma/wizard/returned_lines_from_serial.py' => 'crm_rma_lot_mass_return/wizard/returned_lines_from_serial.py'
--- crm_claim_rma/wizard/returned_lines_from_serial.py	2012-02-07 20:48:00 +0000
+++ crm_rma_lot_mass_return/wizard/returned_lines_from_serial.py	2013-11-15 13:53:46 +0000
@@ -19,19 +19,24 @@
 #You should have received a copy of the GNU General Public License      #
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
-
-from osv import fields, osv
-import pooler
-
-class returned_lines_from_serial(osv.osv_memory):
-    _name='returned_lines_from_serial.wizard'
-    _description='Wizard to create product return lines from serial numbers'
+from openerp.osv import fields, orm
+
+
+class returned_lines_from_serial(orm.TransientModel):
+
+    _name = 'returned_lines_from_serial.wizard'
+    _description = 'Wizard to create product return lines from serial numbers'
     _columns = {
-        'prodlot_id_1': fields.many2one('stock.production.lot', 'Serial / Lot Number 1', required=True),
-        'prodlot_id_2': fields.many2one('stock.production.lot', 'Serial / Lot Number 2'),
-        'prodlot_id_3': fields.many2one('stock.production.lot', 'Serial / Lot Number 3'),
-        'prodlot_id_4': fields.many2one('stock.production.lot', 'Serial / Lot Number 4'),
-        'prodlot_id_5': fields.many2one('stock.production.lot', 'Serial / Lot Number 5'),
+        'prodlot_id_1': fields.many2one('stock.production.lot',
+            'Serial / Lot Number 1', required=True),
+        'prodlot_id_2': fields.many2one('stock.production.lot',
+            'Serial / Lot Number 2'),
+        'prodlot_id_3': fields.many2one('stock.production.lot',
+            'Serial / Lot Number 3'),
+        'prodlot_id_4': fields.many2one('stock.production.lot',
+            'Serial / Lot Number 4'),
+        'prodlot_id_5': fields.many2one('stock.production.lot',
+            'Serial / Lot Number 5'),
         'qty_1' : fields.float('Quantity 1', digits=(12,2), required=True),
         'qty_2' : fields.float('Quantity 2', digits=(12,2)),
         'qty_3' : fields.float('Quantity 3', digits=(12,2)),
@@ -44,7 +49,9 @@
                                     ('error','Shipping error'),
                                     ('exchange','Exchange request'),
                                     ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the product problem"),  
+                                    ('other','Other')], 'Claim Subject',
+                                    required=True,
+                                    help="To describe the product problem"),  
         'claim_2': fields.selection([('none','Not specified'),
                                     ('legal','Legal retractation'),
                                     ('cancellation','Order cancellation'),
@@ -52,7 +59,9 @@
                                     ('error','Shipping error'),
                                     ('exchange','Exchange request'),
                                     ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the line product problem"),
+                                    ('other','Other')], 'Claim Subject',
+                                    required=True,
+                                    help="To describe the line product problem"),
         'claim_3': fields.selection([('none','Not specified'),
                                     ('legal','Legal retractation'),
                                     ('cancellation','Order cancellation'),
@@ -60,7 +69,9 @@
                                     ('error','Shipping error'),
                                     ('exchange','Exchange request'),
                                     ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the line product problem"),
+                                    ('other','Other')], 'Claim Subject',
+                                    required=True,
+                                    help="To describe the line product problem"),
         'claim_4': fields.selection([('none','Not specified'),
                                     ('legal','Legal retractation'),
                                     ('cancellation','Order cancellation'),
@@ -68,7 +79,9 @@
                                     ('error','Shipping error'),
                                     ('exchange','Exchange request'),
                                     ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the line product problem"),
+                                    ('other','Other')], 'Claim Subject',
+                                    required=True,
+                                    help="To describe the line product problem"),
         'claim_5': fields.selection([('none','Not specified'),
                                     ('legal','Legal retractation'),
                                     ('cancellation','Order cancellation'),
@@ -76,13 +89,16 @@
                                     ('error','Shipping error'),
                                     ('exchange','Exchange request'),
                                     ('lost','Lost during transport'),
-                                    ('other','Other')], 'Claim Subject', required=True, help="To describe the line product problem"),
+                                    ('other','Other')], 'Claim Subject',
+                                    required=True,
+                                    help="To describe the line product problem"),
         'partner_id': fields.many2one('res.partner', 'Partner'),
     }
     
     # Get partner from case is set to filter serials
     def _get_default_partner_id(self, cr, uid, context):
-        return self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'][0]    
+        return self.pool.get('crm.claim').read(cr, uid,
+            context['active_id'], ['partner_id'])['partner_id'][0]    
 
     _defaults = {
         'qty_1': lambda *a: 1.0,
@@ -130,12 +146,13 @@
     # Method to create return lines
     def add_return_lines(self, cr, uid, ids, context=None):
         result = self.browse(cr,uid,ids)[0]
-        return_line = self.pool.get('return.line')
+        return_line = self.pool.get('claim.line')
         # Refactor code : create 1 "createmethode" called by each if with values as parameters    
         return_line.create(cr, uid, {
                     'claim_id': context['active_id'],
                     'claim_origine': result.claim_1,
-                    'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_1.id,context),
+                    'product_id' : self.get_product_id(cr, uid, ids,
+                        result.prodlot_id_1.id, context=context),
                     #'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id],[result.prodlot_id_1.product_id.id]), #PRODLOT_ID can be in many invoice !!
                     'product_returned_quantity' : result.qty_1,
                     'prodlot_id' : result.prodlot_id_1.id,
@@ -148,7 +165,8 @@
             return_line.create(cr, uid, {
                     'claim_id': context['active_id'],
                     'claim_origine': result.claim_2,
-                    'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_2.id,context),
+                    'product_id' : self.get_product_id(cr, uid, ids,
+                        result.prodlot_id_2.id, context=context),
 #                    'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]),
                     'product_returned_quantity' : result.qty_2,
                     'prodlot_id' : result.prodlot_id_2.id,
@@ -161,7 +179,8 @@
             return_line.create(cr, uid, {
                     'claim_id': context['active_id'],
                     'claim_origine': result.claim_3,
-                    'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_3.id,context),
+                    'product_id' : self.get_product_id(cr, uid, ids,
+                        result.prodlot_id_3.id, context=context),
 #                    'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]),
                     'product_returned_quantity' : result.qty_3,
                     'prodlot_id' : result.prodlot_id_3.id,
@@ -174,7 +193,8 @@
             return_line.create(cr, uid, {
                     'claim_id': context['active_id'],
                     'claim_origine': result.claim_4,
-                    'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_4.id,context),
+                    'product_id' : self.get_product_id(cr, uid, ids,
+                        result.prodlot_id_4.id, context=context),
 #                    'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]),
                     'product_returned_quantity' : result.qty_4,
                     'prodlot_id' : result.prodlot_id_4.id,
@@ -187,7 +207,8 @@
             return_line.create(cr, uid, {
                     'claim_id': context['active_id'],
                     'claim_origine': result.claim_5,
-                    'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_5.id,context),
+                    'product_id' : self.get_product_id(cr, uid, ids,
+                        result.prodlot_id_5.id, context=context),
 #                    'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id],[result.prodlot_id_1.product_id.id]),
                     'product_returned_quantity' : result.qty_5,
                     'prodlot_id' : result.prodlot_id_5.id,
@@ -201,16 +222,16 @@
         return True
         
     def prodlot_2_product(self,cr, uid, prodlot_ids):          
-        stock_move_ids=self.pool.get('stock.move').search(cr, uid, [('prodlot_id', 'in', prodlot_ids)])
-        res=self.pool.get('stock.move').read(cr, uid, stock_move_ids, ['product_id'])
+        stock_move_ids = self.pool.get('stock.move').search(cr, uid, 
+            [('prodlot_id', 'in', prodlot_ids)])
+        res = self.pool.get('stock.move').read(cr, uid, 
+            stock_move_ids, ['product_id'])
         return set([x['product_id'][0] for x in res if x['product_id']])
         
     def prodlot_2_invoice(self,cr, uid, prodlot_id,product_id):
-        print "prodlot_ids : ", prodlot_id
-        print "product_id : ", product_id
         # get stock_move_ids
-        stock_move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', 'in', prodlot_id)])
-        print "stock_move_ids : ", stock_move_ids
+        stock_move_ids = self.pool.get('stock.move').search(cr, uid,
+            [('prodlot_id', 'in', prodlot_id)])
         # if 1 id
             # (get stock picking (filter on out ?))
             # get invoice_ids from stock_move_id where invoice.line.product = prodlot_product and invoice customer = claim_partner
@@ -226,19 +247,21 @@
 
     def stock_move_2_invoice(self, cr, uid, stock_move_ids):
         inv_line_ids = []
-        res=self.pool.get('stock.move').read(cr, uid, stock_move_ids, ['sale_line_id'])
+        res = self.pool.get('stock.move').read(cr, uid,
+            stock_move_ids, ['sale_line_id'])
         sale_line_ids = [x['sale_line_id'][0] for x in res if x['sale_line_id']]
         if not sale_line_ids:
             return []
-        cr.execute("select invoice_id from sale_order_line_invoice_rel where order_line_id in ("+ ','.join(map(lambda x: str(x),sale_line_ids))+')')
+        sql_base = "select invoice_id from sale_order_line_invoice_rel where \
+         order_line_id in ("
+        cr.execute(sql_base + ','.join(map(lambda x: str(x),sale_line_ids))+')')
         res = cr.fetchall()     
         for i in res:
             for j in i:
                 inv_line_ids.append(j)
 
-        res=self.pool.get('account.invoice.line').read(cr, uid, inv_line_ids,['invoice_id'])
+        res = self.pool.get('account.invoice.line').read(cr, uid,
+            inv_line_ids,['invoice_id'])
         return [x['invoice_id'][0] for x in res if x['invoice_id']]  
-                      
-returned_lines_from_serial()
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+             
\ No newline at end of file

=== renamed file 'crm_claim_rma/wizard/returned_lines_from_serial_wizard_view.xml' => 'crm_rma_lot_mass_return/wizard/returned_lines_from_serial_wizard_view.xml'
=== modified file 'product_warranty/__init__.py'
--- product_warranty/__init__.py	2011-10-12 13:01:59 +0000
+++ product_warranty/__init__.py	2013-11-15 13:53:46 +0000
@@ -19,5 +19,4 @@
 #You should have received a copy of the GNU General Public License      #
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
-
-import product_warranty
+from . import product_warranty

=== modified file 'product_warranty/__openerp__.py'
--- product_warranty/__openerp__.py	2012-09-14 13:13:17 +0000
+++ product_warranty/__openerp__.py	2013-11-15 13:53:46 +0000
@@ -26,16 +26,21 @@
     'version': '1.0',
     'category': 'Generic Modules/Product',
     'description': """
-Akretion - Emmanuel Samyn
-Extend the product warranty management with warranty details on product / supplier relation
+Product Warranty
+================
+
+Extend the product warranty management with warranty details on product / supplier relation:
+
 * supplier warranty duration
-* return product to company, supplier, brand, other
-    """,
-    'author': 'esamyn',
-    'website': 'http://www.erp-236.com',
+* return product to company, supplier, other
+
+Those informations are used in the RMA Claim (Product Return Management) module.
+
+""",
+    'author': 'Akretion',
+    'website': 'http://akretion.com',
     'depends': ['product'],
-    'init_xml': [],
-    'update_xml': [
+    'data': [
         'security/ir.model.access.csv',
         'product_warranty_view.xml',
     ],

=== added file 'product_warranty/i18n/product_warranty.pot'
--- product_warranty/i18n/product_warranty.pot	1970-01-01 00:00:00 +0000
+++ product_warranty/i18n/product_warranty.pot	2013-11-15 13:53:46 +0000
@@ -0,0 +1,100 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* product_warranty
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-15 13:30+0000\n"
+"PO-Revision-Date: 2013-11-15 13:30+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_duration
+#: field:product.supplierinfo,warranty_duration:0
+msgid "Warranty"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_address
+#: field:product.supplierinfo,warranty_return_address:0
+msgid "Warranty return address"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_name
+#: field:return.instruction,name:0
+msgid "Title"
+msgstr ""
+
+#. module: product_warranty
+#: help:product.supplierinfo,warranty_duration:0
+msgid "Warranty in month for this product/supplier relation. Only for company/supplier relation (purchase order) ; the customer/company relation (sale order) always use the product main warranty field"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model,name:product_warranty.model_return_instruction
+#: help:product.supplierinfo,return_instructions:0
+#: help:return.instruction,instructions:0
+msgid "Instructions for product return"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_active_supplier
+#: field:product.supplierinfo,active_supplier:0
+msgid "Active supplier"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_is_default
+#: field:return.instruction,is_default:0
+msgid "Is default"
+msgstr ""
+
+#. module: product_warranty
+#: help:return.instruction,is_default:0
+msgid "If is default, will be use to set the default value in supplier infos. Be careful to have only one default"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.actions.act_window,name:product_warranty.product_return_instructions_action
+#: model:ir.ui.menu,name:product_warranty.menu_product_return_instructions_action
+msgid "Products return instructions"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model,name:product_warranty.model_product_supplierinfo
+msgid "Information about a product supplier"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_partner
+#: field:product.supplierinfo,warranty_return_partner:0
+msgid "Warrantee return"
+msgstr ""
+
+#. module: product_warranty
+#: help:product.supplierinfo,warranty_return_partner:0
+msgid "Who is in charge of the warranty return treatment toward the end customer. Company will use the current compagny delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be applied is the one of the return partner (ie: can be returned to the company and be under the brand warranty"
+msgstr ""
+
+#. module: product_warranty
+#: view:return.instruction:0
+msgid "Return instructions"
+msgstr ""
+
+#. module: product_warranty
+#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_return_instructions
+#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_instructions
+#: field:product.supplierinfo,return_instructions:0
+#: view:return.instruction:0
+#: field:return.instruction,instructions:0
+msgid "Instructions"
+msgstr ""
+

=== modified file 'product_warranty/product_warranty.py'
--- product_warranty/product_warranty.py	2013-08-19 22:04:13 +0000
+++ product_warranty/product_warranty.py	2013-11-15 13:53:46 +0000
@@ -28,8 +28,11 @@
     _description = "Instructions for product return"
     _columns = {
         'name': fields.char('Title', size=128, required=True),
-        'instructions' : fields.text('Instructions', help="Instructions for product return"),
-        'is_default' : fields.boolean('Is default', help="If is default, will be use to set the default value in supplier infos. Be careful to have only one default"),
+        'instructions' : fields.text('Instructions',
+            help="Instructions for product return"),
+        'is_default' : fields.boolean('Is default',
+            help="If is default, will be use to set the default value in "
+                 "supplier infos. Be careful to have only one default"),
         }
 
 class product_supplierinfo(orm.Model):
@@ -40,13 +43,12 @@
                 ('company','Company'),
                 ('supplier','Supplier'),
                 ('other','Other'),]
-        if self.pool.get('ir.module.module').search(cr, uid, [('name','like','product_brand'),('state','like','installed')]):
-            result.append(('brand','Brand manufacturer'),)
         return result
 
     # Get selected lines to add to exchange
     def _get_default_instructions(self, cr, uid, context=None):
-        instruction_ids = self.pool.get('return.instruction').search(cr, uid, [('is_default','=','FALSE')])
+        instruction_ids = self.pool.get('return.instruction').search(cr, uid,
+            [('is_default','=','FALSE')])
         if instruction_ids:
             return instruction_ids[0]
             # TODO f(supplier) + other.
@@ -54,7 +56,8 @@
 
     def _get_warranty_return_address(self, cr, uid, ids, field_names, arg, context=None):
         # Method to return the partner delivery address or if none, the default address
-        # dedicated_delivery_address stand for the case a new type of address more particularly dedicated to return delivery would be implemented.
+        # dedicated_delivery_address stand for the case a new type of address more particularly
+        # dedicated to return delivery would be implemented.
         result ={}
         address_obj = self.pool.get('res.partner')
         for supplier_info in self.browse(cr, uid, ids, context=context):
@@ -64,36 +67,33 @@
             if return_partner:
                 if return_partner == 'supplier':
                     partner_id = supplier_info.name.id
-                elif return_partner == 'brand':
-                    if not supplier_info.product_id.product_brand_id.partner_id:
-                        raise osv.except_osv(_('Error !'), _('You need to define a partner for the brand of the product !'))
-                    partner_id = supplier_info.product_id.product_brand_id.partner_id.id
                 else:
                     partner_id = supplier_info.company_id.partner_id.id
-# TODO : Find the partner with a delivery address, child of the partner
-# v6.1 code with res.partner.address :
-#                address_id = address_obj.search(cr, uid, [('partner_id', '=', partner_id), ('type', 'like', 'dedicated_delivery')], context=context)
-#                if not address_id:
-#                    address_id = address_obj.search(cr, uid, [('partner_id','=', partner_id), ('type','like','delivery')], context=context)
-#                    if not address_id:
-#                        address_id = address_obj.search(cr, uid, [('partner_id', '=', partner_id), ('type', 'like', 'default')], context=context)
-#                if not address_id:
-#                    raise osv.except_osv(_('Error !'), _('No address define for the %s!') % return_partner)
-#                #result[supplier_info.id] = address_id[0]
                 result[supplier_info.id] = partner_id
         return result
 
     _columns = {
-        "warranty_duration" : fields.float('Warranty', help="Warranty in month for this product/supplier relation. Only for company/supplier relation (purchase order) ; the customer/company relation (sale order) always use the product main warranty field"),
-        "warranty_return_partner" :  fields.selection(get_warranty_return_partner, 'Warrantee return', size=128, help="Who is in charge of the warranty return treatment toward the end customer. Company will use the current compagny delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be applied is the one of the return partner (ie: can be returned to the company and be under the brand warranty"),
-        'return_instructions': fields.many2one('return.instruction', 'Instructions',help="Instructions for product return"),
-        'active_supplier' : fields.boolean('Active supplier', help=""),
-        'warranty_return_address': fields.function(_get_warranty_return_address, type='many2one', relation='res.partner', string="Warranty return address"),
+        "warranty_duration": fields.float('Warranty',
+            help="Warranty in month for this product/supplier relation. Only for "
+                 "company/supplier relation (purchase order) ; the customer/company "
+                 "relation (sale order) always use the product main warranty field"),
+        "warranty_return_partner":  fields.selection(get_warranty_return_partner, 
+            'Warrantee return',
+            required=True,
+            help="Who is in charge of the warranty return treatment toward the end customer. "
+            "Company will use the current compagny delivery or default address and so on for "
+            "supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be "
+            "applied is the one of the return partner (ie: can be returned to the company and "
+            "be under the brand warranty"),
+        'return_instructions': fields.many2one('return.instruction',
+            'Instructions',
+            help="Instructions for product return"),
+        'active_supplier': fields.boolean('Active supplier'),
+        'warranty_return_address': fields.function(_get_warranty_return_address,
+            type='many2one', relation='res.partner', string="Warranty return address"),
         }
     _defaults = {
         'warranty_return_partner': lambda *a: 'company',
         'return_instructions': _get_default_instructions,
     }
 
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


Follow ups