合并企业版代码(未测试,先提交到测试分支)

This commit is contained in:
qihao.gong@jikimo.com
2023-04-14 17:42:23 +08:00
parent 7a7b3d7126
commit d28525526a
1300 changed files with 513579 additions and 5426 deletions

21
web_map/models/models.py Normal file
View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, models
from lxml.builder import E
from odoo.exceptions import UserError
class Base(models.AbstractModel):
_inherit = 'base'
@api.model
def _get_default_map_view(self):
view = E.map()
if 'partner_id' in self._fields:
view.set('res_partner', 'partner_id')
else:
raise UserError(_("You need to set a Contact field on this model to use the Map View"))
return view