From 7b3d7735d26d18ef97aaa0484387331bb7c21a39 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Tue, 2 Dec 2014 09:24:55 +0100 Subject: [PATCH 1/3] [PORT] port crm_claim_categ_as_name to v 7.0 --- .../__init__.py | 7 ++--- .../__openerp__.py | 19 ++++++------- .../claim.py | 28 +++++++++++++------ .../claim_view.xml | 12 ++++---- 4 files changed, 37 insertions(+), 29 deletions(-) rename {__unported__/crm_claim_categ_as_name => crm_claim_categ_as_name}/__init__.py (92%) rename {__unported__/crm_claim_categ_as_name => crm_claim_categ_as_name}/__openerp__.py (86%) rename __unported__/crm_claim_categ_as_name/crm_claim_rma.py => crm_claim_categ_as_name/claim.py (71%) rename __unported__/crm_claim_categ_as_name/crm_claim_rma_view.xml => crm_claim_categ_as_name/claim_view.xml (54%) diff --git a/__unported__/crm_claim_categ_as_name/__init__.py b/crm_claim_categ_as_name/__init__.py similarity index 92% rename from __unported__/crm_claim_categ_as_name/__init__.py rename to crm_claim_categ_as_name/__init__.py index 0170dbc3..3d04a9db 100644 --- a/__unported__/crm_claim_categ_as_name/__init__.py +++ b/crm_claim_categ_as_name/__init__.py @@ -1,8 +1,8 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2012 Akretion Benoît GUILLOT # +# Copyright (C) 2014 Akretion Benoît GUILLOT # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -19,5 +19,4 @@ # # ############################################################################### -import crm_claim_rma - +from . import claim diff --git a/__unported__/crm_claim_categ_as_name/__openerp__.py b/crm_claim_categ_as_name/__openerp__.py similarity index 86% rename from __unported__/crm_claim_categ_as_name/__openerp__.py rename to crm_claim_categ_as_name/__openerp__.py index ab3b243a..45bbb21a 100644 --- a/__unported__/crm_claim_categ_as_name/__openerp__.py +++ b/crm_claim_categ_as_name/__openerp__.py @@ -1,8 +1,8 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2012 Akretion Benoît GUILLOT # +# Copyright (C) 2014 Akretion Benoît GUILLOT # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -25,19 +25,18 @@ 'version': '1.0', 'category': 'Generic Modules/CRM & SRM', 'license': 'AGPL-3', - 'description': """ - + 'description': + """ + Replace claim name by category. It makes easier to filter on claims. """, 'author': 'akretion', 'website': 'http://www.akretion.com/', 'depends': ['crm_claim_rma'], - 'init_xml': [], - 'update_xml': [ - 'crm_claim_rma_view.xml', + 'data': [ + 'claim_view.xml', ], - 'demo_xml': [], - 'installable': False, - 'active': False, + 'demo': [], + 'installable': True, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/__unported__/crm_claim_categ_as_name/crm_claim_rma.py b/crm_claim_categ_as_name/claim.py similarity index 71% rename from __unported__/crm_claim_categ_as_name/crm_claim_rma.py rename to crm_claim_categ_as_name/claim.py index 6fd0a13e..6dc247cc 100644 --- a/__unported__/crm_claim_categ_as_name/crm_claim_rma.py +++ b/crm_claim_categ_as_name/claim.py @@ -1,8 +1,8 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2012 Akretion Benoît GUILLOT # +# Copyright (C) 2014 Akretion Benoît GUILLOT # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -19,15 +19,25 @@ # # ############################################################################### -from osv import fields, osv +from openerp.osv import fields, orm -class crm_claim(osv.osv): + +class crm_claim(orm.Model): _inherit = 'crm.claim' _columns = { - 'name': fields.related('categ_id', 'name', relation='crm.case.categ', type='char', string='Claim Subject', size=128, store=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', \ - domain="[('section_id','=',section_id),\ - ('object_id.model', '=', 'crm.claim')]", required=True), + 'name': fields.related( + 'categ_id', + 'name', + relation='crm.case.categ', + type='char', + string='Claim Subject', + size=128, + store=True), + 'categ_id': fields.many2one( + 'crm.case.categ', + 'Category', + domain="[('section_id', '=', section_id), \ + ('object_id.model', '=', 'crm.claim')]", + required=True), } - \ No newline at end of file diff --git a/__unported__/crm_claim_categ_as_name/crm_claim_rma_view.xml b/crm_claim_categ_as_name/claim_view.xml similarity index 54% rename from __unported__/crm_claim_categ_as_name/crm_claim_rma_view.xml rename to crm_claim_categ_as_name/claim_view.xml index 559dc4fd..abd249da 100644 --- a/__unported__/crm_claim_categ_as_name/crm_claim_rma_view.xml +++ b/crm_claim_categ_as_name/claim_view.xml @@ -1,7 +1,7 @@ @@ -10,12 +10,12 @@ CRM - Claim product return Form crm.claim - + - - - - + + + + From bb368ad8e50fa06476615d11724fd2c91b0c77f9 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Tue, 2 Dec 2014 14:01:11 +0100 Subject: [PATCH 2/3] [FIX] fix copyrights --- crm_claim_categ_as_name/__init__.py | 35 +++++++++++++------------- crm_claim_categ_as_name/__openerp__.py | 35 +++++++++++++------------- crm_claim_categ_as_name/claim.py | 35 +++++++++++++------------- 3 files changed, 54 insertions(+), 51 deletions(-) diff --git a/crm_claim_categ_as_name/__init__.py b/crm_claim_categ_as_name/__init__.py index 3d04a9db..6877a51a 100644 --- a/crm_claim_categ_as_name/__init__.py +++ b/crm_claim_categ_as_name/__init__.py @@ -1,22 +1,23 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2014 Akretion Benoît GUILLOT # -# # -# 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 . # -# # +# +# Module for OpenERP +# Copyright (C) 2012-2014 Akretion. All Rights Reserved +# @author Benoît GUILLOT +# +# 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 . import claim diff --git a/crm_claim_categ_as_name/__openerp__.py b/crm_claim_categ_as_name/__openerp__.py index 45bbb21a..72e77811 100644 --- a/crm_claim_categ_as_name/__openerp__.py +++ b/crm_claim_categ_as_name/__openerp__.py @@ -1,22 +1,23 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2014 Akretion Benoît GUILLOT # -# # -# 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 . # -# # +# +# Module for OpenERP +# Copyright (C) 2012-2014 Akretion. All Rights Reserved +# @author Benoît GUILLOT +# +# 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 . +# ############################################################################### diff --git a/crm_claim_categ_as_name/claim.py b/crm_claim_categ_as_name/claim.py index 6dc247cc..01beec75 100644 --- a/crm_claim_categ_as_name/claim.py +++ b/crm_claim_categ_as_name/claim.py @@ -1,22 +1,23 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# crm_claim_categ_as_name for OpenERP # -# Copyright (C) 2014 Akretion Benoît GUILLOT # -# # -# 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 . # -# # +# +# Module for OpenERP +# Copyright (C) 2012-2014 Akretion. All Rights Reserved +# @author Benoît GUILLOT +# +# 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 From b6e630f1d3067e63c5a6d56b7b5244863744d4bd Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Fri, 12 Dec 2014 17:56:42 +0100 Subject: [PATCH 3/3] [FIX] fix copyrights --- crm_claim_categ_as_name/claim_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm_claim_categ_as_name/claim_view.xml b/crm_claim_categ_as_name/claim_view.xml index abd249da..4b344d20 100644 --- a/crm_claim_categ_as_name/claim_view.xml +++ b/crm_claim_categ_as_name/claim_view.xml @@ -1,7 +1,7 @@