diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-10-02 11:23:09 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-10-02 11:23:09 +0200 |
| commit | 81b0266ac300de9fb6cdce2888c2b0166bb2e967 (patch) | |
| tree | 773bac5616f73bdb8a7d7489f9fdc456472195b7 /addons/website_partner | |
| parent | 86159fe4b054b475c2db8007986e0881cc1ad5d2 (diff) | |
[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
Diffstat (limited to 'addons/website_partner')
| -rw-r--r-- | addons/website_partner/__init__.py | 22 | ||||
| -rw-r--r-- | addons/website_partner/__openerp__.py | 40 | ||||
| -rw-r--r-- | addons/website_partner/models/__init__.py | 1 | ||||
| -rw-r--r-- | addons/website_partner/models/res_partner.py | 21 |
4 files changed, 84 insertions, 0 deletions
diff --git a/addons/website_partner/__init__.py b/addons/website_partner/__init__.py new file mode 100644 index 00000000000..d95d47860af --- /dev/null +++ b/addons/website_partner/__init__.py @@ -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 diff --git a/addons/website_partner/__openerp__.py b/addons/website_partner/__openerp__.py new file mode 100644 index 00000000000..94596478756 --- /dev/null +++ b/addons/website_partner/__openerp__.py @@ -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, +} diff --git a/addons/website_partner/models/__init__.py b/addons/website_partner/models/__init__.py new file mode 100644 index 00000000000..f6dfb12ddc8 --- /dev/null +++ b/addons/website_partner/models/__init__.py @@ -0,0 +1 @@ +import res_partner
\ No newline at end of file diff --git a/addons/website_partner/models/res_partner.py b/addons/website_partner/models/res_partner.py new file mode 100644 index 00000000000..bdaaa986fad --- /dev/null +++ b/addons/website_partner/models/res_partner.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +from openerp.osv import osv, fields + + +class WebsiteResPartner(osv.Model): + _inherit = 'res.partner' + + _columns = { + 'website_published': fields.boolean( + 'Publish', help="Publish on 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): + return "/website/image?model=%s&field=%s&id=%s" % (self._name, field, ids[0]) |
