mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
Merge pull request #11 from akretion/70_port_categ_as_name
[PORT] port crm_claim_categ_as_name to v 7.0
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
###############################################################################
|
||||
# #
|
||||
# crm_claim_categ_as_name for OpenERP #
|
||||
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> #
|
||||
# #
|
||||
# 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 crm_claim_rma
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
###############################################################################
|
||||
# #
|
||||
# crm_claim_categ_as_name for OpenERP #
|
||||
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> #
|
||||
# #
|
||||
# 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_claim_categ_as_name',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'license': 'AGPL-3',
|
||||
'description': """
|
||||
|
||||
""",
|
||||
'author': 'akretion',
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': ['crm_claim_rma'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'crm_claim_rma_view.xml',
|
||||
],
|
||||
'demo_xml': [],
|
||||
'installable': False,
|
||||
'active': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,33 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
###############################################################################
|
||||
# #
|
||||
# crm_claim_categ_as_name for OpenERP #
|
||||
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> #
|
||||
# #
|
||||
# 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 osv import fields, osv
|
||||
|
||||
class crm_claim(osv.osv):
|
||||
_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),
|
||||
}
|
||||
|
||||
23
crm_claim_categ_as_name/__init__.py
Normal file
23
crm_claim_categ_as_name/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# Module for OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion. All Rights Reserved
|
||||
# @author Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
#
|
||||
# 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
|
||||
43
crm_claim_categ_as_name/__openerp__.py
Normal file
43
crm_claim_categ_as_name/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# Module for OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion. All Rights Reserved
|
||||
# @author Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
#
|
||||
# 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_claim_categ_as_name',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'license': 'AGPL-3',
|
||||
'description':
|
||||
"""
|
||||
Replace claim name by category. It makes easier to filter on claims.
|
||||
""",
|
||||
'author': 'akretion',
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': ['crm_claim_rma'],
|
||||
'data': [
|
||||
'claim_view.xml',
|
||||
],
|
||||
'demo': [],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
44
crm_claim_categ_as_name/claim.py
Normal file
44
crm_claim_categ_as_name/claim.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# Module for OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion. All Rights Reserved
|
||||
# @author Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
#
|
||||
# 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 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),
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
crm_claim_categ_as_name for OpenERP
|
||||
Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
Copyright (C) 2012-2014 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
<openerp>
|
||||
@@ -10,12 +10,12 @@
|
||||
<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="inherit_id" ref="crm_claim_rma.crm_claim_rma_form_view2"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/group/field[@name='name']" position="replace">
|
||||
<field name="categ_id" string='Name' />
|
||||
</xpath>
|
||||
<xpath expr="/form/group/notebook/page[@string='Claim Description']/group/field[@name='categ_id']" position="replace">
|
||||
<field name="name" position="replace">
|
||||
<field name="categ_id" string="Name"/>
|
||||
</field>
|
||||
<xpath expr="/form/sheet/group/notebook/page[@string='Claim Description']/group/field[@name='categ_id']" position="replace">
|
||||
<field name="name" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
Reference in New Issue
Block a user