[REF] website_google_map, website_crm, website_crm_partner_assign, website_membership: extracted res.partner model stuff into dedicated module and moved model-related stuff inside a models directory.

Website related fields on res.partner are now located inside their own module, in website_partner.
This module is a dependency for other modules that previously (re)defined various website fields.

Next step is to refactor a bit those modules, but one thing at a time. All glory to the hypnotoad.

bzr revid: tde@openerp.com-20131002092309-jlov4j1v6s9r6jyk
This commit is contained in:
Thibault Delavallée 2013-10-02 11:23:09 +02:00
parent 86159fe4b0
commit 81b0266ac3
18 changed files with 91 additions and 47 deletions

View File

@ -1,2 +1 @@
import controllers
import website_crm

View File

@ -9,7 +9,7 @@ OpenERP Contact Form
""",
'author': 'OpenERP SA',
'depends': ['website', 'crm'],
'depends': ['website_partner', 'crm'],
'data': [
'website_crm_data.xml',
'views/website_crm.xml',

View File

@ -1,9 +0,0 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'website_published': fields.boolean('Available in the website'),
}

View File

@ -1,2 +1,2 @@
import controllers
import website_crm_partner_assign
import models

View File

@ -1,5 +1,5 @@
{
'name': 'Public Partners References',
'name': 'Public Partners References',
'category': 'Website',
'summary': 'Publish Customer References',
'version': '1.0',
@ -9,7 +9,7 @@ OpenERP Public Partners References
""",
'author': 'OpenERP SA',
'depends': ['website', 'website_google_map'],
'depends': ['website_partner', 'website_google_map'],
'data': [
'views/website_crm_partner_assign.xml',
],

View File

@ -0,0 +1 @@
import res_partner

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class res_partner_grade(osv.osv):
_inherit = 'res.partner.grade'
_columns = {
'website_description': fields.html('Description for the website'),
}

View File

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'website_description': fields.html('Description for the website'),
'website_short_description': fields.text('Sort description for the website'),
}
def img(self, cr, uid, ids, field='image_small', context=None):
return "/website/image?model=%s&field=%s&id=%s" % (self._name, field, ids[0])
class res_partner_grade(osv.osv):
_inherit = 'res.partner.grade'
_columns = {
'website_description': fields.html('Description for the website'),
}

View File

@ -1,2 +1,2 @@
import controllers
import website_google_map
import models

View File

@ -9,7 +9,7 @@ OpenERP Website Google Map
""",
'author': 'OpenERP SA',
'depends': ['website', 'crm_partner_assign'],
'depends': ['website_partner', 'crm_partner_assign'],
'data': [
'views/google_map.xml',
],

View File

@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
from openerp.osv import osv
import simplejson
import werkzeug.wrappers
class res_partner(osv.osv):
class res_partner(osv.Model):
_inherit = 'res.partner'
_columns = {
'website_published': fields.boolean('Available in the website'),
}
def google_map_json(self, cr, uid, ids, context=None):
data = {

View File

@ -22,7 +22,7 @@
{
'name': 'Website Mail',
'category': 'Website',
'summary': 'Glue Module',
'summary': 'Website Module for Mail',
'version': '0.1',
'description': """Glue module holding mail improvements for website.""",
'author': 'OpenERP SA',

View File

@ -1,2 +1 @@
import controllers
import models

View File

@ -1,5 +1,5 @@
{
'name': 'Public Partners Members',
'name': 'Public Partners Members',
'category': 'Website',
'summary': 'Publish Members',
'version': '1.0',
@ -9,7 +9,7 @@ OpenERP Partners Members
""",
'author': 'OpenERP SA',
'depends': ['website', 'association'],
'depends': ['website_partner', 'association'],
'data': [
'views/website_membership.xml',
],

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.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 models

View File

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.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': 'Website Partner',
'category': 'Website',
'summary': 'Partner Module for Website',
'version': '0.1',
'description': """Base module holding website-related stuff for partner model""",
'author': 'OpenERP SA',
'depends': ['website'],
'data': [
],
'css': [
],
'js': [
],
'qweb': [
],
'installable': True,
'auto_install': False,
}

View File

@ -9,8 +9,12 @@ class WebsiteResPartner(osv.Model):
_columns = {
'website_published': fields.boolean(
'Publish', help="Publish on the website"),
'website_description': fields.html('Description for the website'),
'website_short_description': fields.text('Sort description for the website'),
'website_description': fields.html(
'Website Partner Full Description'
),
'website_short_description': fields.text(
'Website artner Short Description'
),
}
def img(self, cr, uid, ids, field='image_small', context=None):