[IMP] website, website_partner: use fields from mixin on res.partner
Currently, res.partner has: 1. `website_id` field hardcoded in website module 2. `website_published` field from website `website.published.mixin` in website_partner module. At the end, the res.partner model has all the field of the mixin `website.published.multi.mixin` without having the mixin. As a result, we have all the multi-website fields but we don't have access to the mixins methods & computes. Now, we use the `website.published.multi.mixin` on res.partner in website module even if `website_published` is not needed if website_partner is not installed. + add tooltip to `website` field to prevent warning since 2 fields would have the same label closes odoo/odoo#29711
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
def urlplus(url, params):
|
||||
@@ -11,9 +11,8 @@ def urlplus(url, params):
|
||||
|
||||
|
||||
class Partner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
website_id = fields.Many2one('website', string='Registration Website')
|
||||
_name = 'res.partner'
|
||||
_inherit = ['res.partner', 'website.published.multi.mixin']
|
||||
|
||||
@api.multi
|
||||
def google_map_img(self, zoom=8, width=298, height=298):
|
||||
|
||||
@@ -6,7 +6,7 @@ from odoo.addons.http_routing.models.ir_http import slug
|
||||
|
||||
class WebsiteResPartner(models.Model):
|
||||
_name = 'res.partner'
|
||||
_inherit = ['res.partner', 'website.seo.metadata', 'website.published.mixin']
|
||||
_inherit = ['res.partner', 'website.seo.metadata']
|
||||
|
||||
website_description = fields.Html('Website Partner Full Description', strip_style=True)
|
||||
website_short_description = fields.Text('Website Partner Short Description')
|
||||
|
||||
@@ -163,7 +163,7 @@ class Partner(models.Model):
|
||||
help='The internal user in charge of this contact.')
|
||||
vat = fields.Char(string='Tax ID', help="The Tax Identification Number. Complete it if the contact is subjected to government taxes. Used in some legal statements.")
|
||||
bank_ids = fields.One2many('res.partner.bank', 'partner_id', string='Banks')
|
||||
website = fields.Char()
|
||||
website = fields.Char('Website Link')
|
||||
comment = fields.Text(string='Notes')
|
||||
|
||||
category_id = fields.Many2many('res.partner.category', column1='partner_id',
|
||||
|
||||
Reference in New Issue
Block a user