From 88392d8e6064a05eb84c8b4e9ed74a84853b1d9d Mon Sep 17 00:00:00 2001 From: Joel Grand-Guillaume Date: Mon, 11 Nov 2013 15:49:06 +0100 Subject: [PATCH] [IMP] Clean of the module, mainly: - Move unsused wizard in crm_claim_ext - Move unused view in crm_claim_ext - Move optionnal behavior (like hide the return button) to crm_claim_ext - Fix and improve all views and filter - Remove the field claim_picking as we can test claim_id for the same purpose - Change the author by adding Camptocamp - Adaptation of the description --- crm_claim_ext/__init__.py | 2 +- crm_claim_ext/__openerp__.py | 13 +- crm_claim_ext/crm_claim_ext.py | 2 +- crm_claim_ext/crm_claim_ext_view.xml | 117 ++++++++++++ crm_claim_ext/wizard/__init__.py | 26 +++ .../wizard/exchange_from_returned_lines.py | 0 ...change_from_returned_lines_wizard_view.xml | 0 .../wizard/picking_from_exchange_lines.py | 0 ...icking_from_exchange_lines_wizard_view.xml | 0 .../wizard/picking_from_returned_lines.py | 0 ...icking_from_returned_lines_wizard_view.xml | 0 .../wizard/refund_from_returned_lines.py | 0 ...refund_from_returned_lines_wizard_view.xml | 0 .../wizard/returned_lines_from_invoice.py | 0 ...eturned_lines_from_invoice_wizard_view.xml | 0 crm_claim_rma/__init__.py | 41 ++-- crm_claim_rma/__openerp__.py | 84 ++++----- crm_claim_rma/account_invoice.py | 41 ++-- crm_claim_rma/account_invoice_view.xml | 8 +- crm_claim_rma/crm_claim_rma.py | 42 ++--- crm_claim_rma/crm_claim_rma_view.xml | 177 +----------------- crm_claim_rma/res_company.py | 41 ++-- crm_claim_rma/res_company_view.xml | 8 +- crm_claim_rma/rma_data.xml | 65 ------- crm_claim_rma/stock.py | 63 ++++--- crm_claim_rma/stock_view.xml | 111 ++++++----- crm_claim_rma/wizard/__init__.py | 47 ++--- crm_claim_rma/wizard/claim_make_picking.py | 3 - 28 files changed, 388 insertions(+), 503 deletions(-) create mode 100644 crm_claim_ext/wizard/__init__.py rename {crm_claim_rma => crm_claim_ext}/wizard/exchange_from_returned_lines.py (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/exchange_from_returned_lines_wizard_view.xml (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/picking_from_exchange_lines.py (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/picking_from_exchange_lines_wizard_view.xml (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/picking_from_returned_lines.py (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/picking_from_returned_lines_wizard_view.xml (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/refund_from_returned_lines.py (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/refund_from_returned_lines_wizard_view.xml (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/returned_lines_from_invoice.py (100%) rename {crm_claim_rma => crm_claim_ext}/wizard/returned_lines_from_invoice_wizard_view.xml (100%) delete mode 100644 crm_claim_rma/rma_data.xml diff --git a/crm_claim_ext/__init__.py b/crm_claim_ext/__init__.py index 4f55782b..f6475beb 100644 --- a/crm_claim_ext/__init__.py +++ b/crm_claim_ext/__init__.py @@ -19,5 +19,5 @@ #You should have received a copy of the GNU General Public License # #along with this program. If not, see . # ######################################################################### - +import wizard import crm_claim_ext diff --git a/crm_claim_ext/__openerp__.py b/crm_claim_ext/__openerp__.py index 4cc620bf..61fa217f 100644 --- a/crm_claim_ext/__openerp__.py +++ b/crm_claim_ext/__openerp__.py @@ -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,6 +41,11 @@ Add some fields to CRM claim : canal, spirit 'init_xml': [], 'update_xml': [ 'crm_claim_ext_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': [], diff --git a/crm_claim_ext/crm_claim_ext.py b/crm_claim_ext/crm_claim_ext.py index 1c02c78b..893b5f44 100644 --- a/crm_claim_ext/crm_claim_ext.py +++ b/crm_claim_ext/crm_claim_ext.py @@ -36,7 +36,7 @@ class crm_claim_ext(osv.osv): _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'), } crm_claim_ext() diff --git a/crm_claim_ext/crm_claim_ext_view.xml b/crm_claim_ext/crm_claim_ext_view.xml index faf1f83b..7db71613 100644 --- a/crm_claim_ext/crm_claim_ext_view.xml +++ b/crm_claim_ext/crm_claim_ext_view.xml @@ -33,5 +33,122 @@ + + crm_claim_rma.picking_out_form + stock.picking.out + + + + + 1 + + + + + + crm_claim_rma.picking_in_form + stock.picking.in + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm_claim_ext/wizard/__init__.py b/crm_claim_ext/wizard/__init__.py new file mode 100644 index 00000000..6486a58c --- /dev/null +++ b/crm_claim_ext/wizard/__init__.py @@ -0,0 +1,26 @@ +# -*- 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 . +# +############################################################################## +#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 \ No newline at end of file diff --git a/crm_claim_rma/wizard/exchange_from_returned_lines.py b/crm_claim_ext/wizard/exchange_from_returned_lines.py similarity index 100% rename from crm_claim_rma/wizard/exchange_from_returned_lines.py rename to crm_claim_ext/wizard/exchange_from_returned_lines.py diff --git a/crm_claim_rma/wizard/exchange_from_returned_lines_wizard_view.xml b/crm_claim_ext/wizard/exchange_from_returned_lines_wizard_view.xml similarity index 100% rename from crm_claim_rma/wizard/exchange_from_returned_lines_wizard_view.xml rename to crm_claim_ext/wizard/exchange_from_returned_lines_wizard_view.xml diff --git a/crm_claim_rma/wizard/picking_from_exchange_lines.py b/crm_claim_ext/wizard/picking_from_exchange_lines.py similarity index 100% rename from crm_claim_rma/wizard/picking_from_exchange_lines.py rename to crm_claim_ext/wizard/picking_from_exchange_lines.py diff --git a/crm_claim_rma/wizard/picking_from_exchange_lines_wizard_view.xml b/crm_claim_ext/wizard/picking_from_exchange_lines_wizard_view.xml similarity index 100% rename from crm_claim_rma/wizard/picking_from_exchange_lines_wizard_view.xml rename to crm_claim_ext/wizard/picking_from_exchange_lines_wizard_view.xml diff --git a/crm_claim_rma/wizard/picking_from_returned_lines.py b/crm_claim_ext/wizard/picking_from_returned_lines.py similarity index 100% rename from crm_claim_rma/wizard/picking_from_returned_lines.py rename to crm_claim_ext/wizard/picking_from_returned_lines.py diff --git a/crm_claim_rma/wizard/picking_from_returned_lines_wizard_view.xml b/crm_claim_ext/wizard/picking_from_returned_lines_wizard_view.xml similarity index 100% rename from crm_claim_rma/wizard/picking_from_returned_lines_wizard_view.xml rename to crm_claim_ext/wizard/picking_from_returned_lines_wizard_view.xml diff --git a/crm_claim_rma/wizard/refund_from_returned_lines.py b/crm_claim_ext/wizard/refund_from_returned_lines.py similarity index 100% rename from crm_claim_rma/wizard/refund_from_returned_lines.py rename to crm_claim_ext/wizard/refund_from_returned_lines.py diff --git a/crm_claim_rma/wizard/refund_from_returned_lines_wizard_view.xml b/crm_claim_ext/wizard/refund_from_returned_lines_wizard_view.xml similarity index 100% rename from crm_claim_rma/wizard/refund_from_returned_lines_wizard_view.xml rename to crm_claim_ext/wizard/refund_from_returned_lines_wizard_view.xml diff --git a/crm_claim_rma/wizard/returned_lines_from_invoice.py b/crm_claim_ext/wizard/returned_lines_from_invoice.py similarity index 100% rename from crm_claim_rma/wizard/returned_lines_from_invoice.py rename to crm_claim_ext/wizard/returned_lines_from_invoice.py diff --git a/crm_claim_rma/wizard/returned_lines_from_invoice_wizard_view.xml b/crm_claim_ext/wizard/returned_lines_from_invoice_wizard_view.xml similarity index 100% rename from crm_claim_rma/wizard/returned_lines_from_invoice_wizard_view.xml rename to crm_claim_ext/wizard/returned_lines_from_invoice_wizard_view.xml diff --git a/crm_claim_rma/__init__.py b/crm_claim_rma/__init__.py index bd13e30e..1d2703af 100644 --- a/crm_claim_rma/__init__.py +++ b/crm_claim_rma/__init__.py @@ -1,25 +1,24 @@ # -*- 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 . # -######################################################################### +############################################################################## +# +# 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 . +# +############################################################################## import wizard import crm_claim_rma diff --git a/crm_claim_rma/__openerp__.py b/crm_claim_rma/__openerp__.py index ae9ce9bd..e4ecc4de 100644 --- a/crm_claim_rma/__openerp__.py +++ b/crm_claim_rma/__openerp__.py @@ -1,62 +1,53 @@ # -*- 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 . # -######################################################################### - - +############################################################################## +# +# 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 . +# +############################################################################## { 'name': 'CRM Product Return', 'version': '1.0', '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 : +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 lot, 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) +* access to related customer data (orders, invoices, refunds, picking in/out) from a claim -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', +""", + 'author': 'Akretion, Camptocamp', + 'website': 'http://www.akretion.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', @@ -65,12 +56,7 @@ on this branch : https://code.launchpad.net/~akretion-team/openobject-addons/ope '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, diff --git a/crm_claim_rma/account_invoice.py b/crm_claim_rma/account_invoice.py index d4df6c03..90dd3eda 100644 --- a/crm_claim_rma/account_invoice.py +++ b/crm_claim_rma/account_invoice.py @@ -1,25 +1,24 @@ # -*- 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 . # -######################################################################### +############################################################################## +# +# 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 . +# +############################################################################## from osv import fields, osv from tools.translate import _ diff --git a/crm_claim_rma/account_invoice_view.xml b/crm_claim_rma/account_invoice_view.xml index e4d699aa..5609e25b 100644 --- a/crm_claim_rma/account_invoice_view.xml +++ b/crm_claim_rma/account_invoice_view.xml @@ -1,15 +1,9 @@ - - - + crm_claim_rma.invoice_form account.invoice diff --git a/crm_claim_rma/crm_claim_rma.py b/crm_claim_rma/crm_claim_rma.py index 1543214c..5fa63eed 100644 --- a/crm_claim_rma/crm_claim_rma.py +++ b/crm_claim_rma/crm_claim_rma.py @@ -1,25 +1,24 @@ # -*- 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 . # -######################################################################### +############################################################################## +# +# 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 . +# +############################################################################## from openerp.osv import fields, orm, osv from crm import crm @@ -185,7 +184,6 @@ class crm_claim(orm.Model): ('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), diff --git a/crm_claim_rma/crm_claim_rma_view.xml b/crm_claim_rma/crm_claim_rma_view.xml index e03c408e..85d53912 100644 --- a/crm_claim_rma/crm_claim_rma_view.xml +++ b/crm_claim_rma/crm_claim_rma_view.xml @@ -1,26 +1,4 @@ - @@ -102,7 +80,7 @@ - + @@ -132,87 +110,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -242,7 +139,6 @@ crm.claim -<<<<<<< TREE @@ -295,62 +191,6 @@ -======= - - - - - - - - - - - - -