-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.0][BR000275][MIG] Migrate website_baidu_map_multi from 8.0 to 12.0 #240
Open
ruter-lyu
wants to merge
8
commits into
Elico-Corp:12.0
Choose a base branch
from
ruter-lyu:12.0-mig-bd_map_multi
base: 12.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d4cba8b
[ADD] website_baidu_map_multi
5b8b7ff
[UPD] for code review
572e8d7
[UPD] update readme.rst
9fe1178
[UPD] update readme.rst, remove dead code
2deaf8b
fix flake8+pylint
elicoidal 48a1207
[MIG] Migrate website_baidu_map_multi from 8.0 to 12.0
d9b8a58
fix ACL and view error
2d9b378
Code improve
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.png | ||
:alt: License | ||
|
||
================================== | ||
Website Baidu Map (Multi location) | ||
================================== | ||
|
||
This module inherits from the website_baidu_map module. It allows you to display multiple addresses on the map. | ||
|
||
|
||
Contributors | ||
------------ | ||
|
||
* Liu Lixia <[email protected]> | ||
* Ruter Lyu <[email protected]> | ||
|
||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://www.elico-corp.com/logo.png | ||
:alt: Elico Corp | ||
:target: https://www.elico-corp.com | ||
|
||
This module is maintained by Elico Corporation. | ||
|
||
Elico Corporation offers consulting services to implement open source management software in SMEs, with a strong involvement in quality of service. | ||
|
||
Our headquarters are located in Shanghai with branches in Hong Kong, ShenZhen and Singapore servicing customers from Greater China, Asia Pacific, Europe, Americas, etc... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 2016-2019 Elico Corp (https://www.elico-corp.com). | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
'name': 'Website Baidu Map Multi', | ||
'version': '12.0.1.0.0', | ||
'category': 'Hidden', | ||
'depends': ['website_baidu_map'], | ||
'author': 'Elico-Corp', | ||
'support': 'Elico-Corp', | ||
'license': 'LGPL-3', | ||
'website': 'https://www.elico-corp.com', | ||
'data': [ | ||
'views/company_shop_view.xml', | ||
'security/ir.model.access.csv', | ||
'views/templates.xml', | ||
], | ||
'installable': True, | ||
'application': False | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import company_shop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 2016-2019 Elico Corp (https://www.elico-corp.com). | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo import fields, models | ||
|
||
|
||
class CompanyShop(models.Model): | ||
_name = 'company.shop' | ||
|
||
name = fields.Char('Name', required=True) | ||
city = fields.Char('City', required=True) | ||
address = fields.Char('Address', required=True) | ||
company_id = fields.Many2one(comodel_name='res.company', string='Company') | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = 'res.company' | ||
|
||
shop_ids = fields.One2many( | ||
comodel_name='company.shop', inverse_name='company_id', string='shop') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_company_shop,company_shop,website_baidu_map_multi.model_company_shop,website.group_website_designer,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
© 2018-2019 Shanghai Elico Limited. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
--> | ||
<odoo> | ||
<record id="view_company_form" model="ir.ui.view"> | ||
<field name="name">Company Shop</field> | ||
<field name="model">res.company</field> | ||
<field name="type">form</field> | ||
<field name="inherit_id" ref="base.view_company_form"/> | ||
<field name="arch" type="xml"> | ||
<data> | ||
<xpath expr="//page[last()]" position="after"> | ||
<page string="Shops"> | ||
<field name="shop_ids"/> | ||
</page> | ||
</xpath> | ||
</data> | ||
</field> | ||
</record> | ||
|
||
<record id="company_shop_action" model="ir.actions.act_window"> | ||
<field name="name">Company Shop</field> | ||
<field name="res_model">company.shop</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">tree</field> | ||
</record> | ||
|
||
<record id="company_shop_view_tree" model="ir.ui.view"> | ||
<field name="name">Company Shop Tree</field> | ||
<field name="model">company.shop</field> | ||
<field name="arch" type="xml"> | ||
<tree editable="top"> | ||
<field name="name"/> | ||
<field name="city"/> | ||
<field name="address"/> | ||
<field name="company_id" invisible="1"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
© 2018-2019 Shanghai Elico Limited. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
--> | ||
<odoo> | ||
ruter-lyu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<template id="baidu_map_muti" name="map_multi" | ||
inherit_id="website.company_description"> | ||
<xpath expr="//div[@id='baidu_map']" position="replace"> | ||
<div id="baidu_map"> | ||
<script type="text/javascript"> | ||
var map = new BMap.Map("baidu_map"); | ||
var citys = []; | ||
var myKeys = []; | ||
<t t-foreach="res_company.shop_ids" t-as="shops"> | ||
citys.push('<t t-esc="shops.city"/>'); | ||
myKeys.push('<t t-esc="shops.address"/>'); | ||
</t> | ||
for(var i=0; i<myKeys.length; i++){ | ||
map.centerAndZoom(citys[i],11); | ||
map.enableScrollWheelZoom(); | ||
var local = new BMap.LocalSearch(map, { | ||
renderOptions:{map: map} | ||
}); | ||
local.search(myKeys[i]); | ||
} | ||
</script> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
</odoo> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to newest