Before this commit, the sitemap will crash if you have some res.partner
without country that are publish and with an assigned_partner_id.
Now, we only search for customer with country that are set and avoid to have
a traceback:
File "/home/odoo/src/odoo/11.0/addons/website_customer/controllers/main.py", line 31, in sitemap_industry
loc = '/customers/country/%s' % slug(country['country_id'])
File "/home/odoo/src/odoo/11.0/addons/http_routing/models/ir_http.py", line 91, in slug
identifier, name = value
TypeError: 'bool' object is not iterable
Don't add useless routes or route that will return 404.
Improve generate function from ModelConverter to have a better management of
query_string.
Now we have an helper sitemap_qs2dom that will analyse the current route and
check if query string is plausible and if yes, generate a domain, when the
query_string don't seems to match the route, we return a Falsy domain.
Before this commit, if qs was /product/ipad, enumerate_page check for each
modelconverter of the route a name ilike '/product/ipad'.
Now we check all routes that contains product and one converter that match ipad
or routes that contains ipad and one converter that match product.
This commit a new way to declare the sitemap for a route.
def sitemap_xx(env, rule, query_string):
yield {'loc': '/my_url'}
@http.route(..., sitemap=sitemap_xx)
In this case, only the loc returned by this function will be in the sitemap
for all rules.
You can pass sitempa=False, if you don't want that route are into the sitemap
Slug and unslug API is now available in http_routing. Indeed there is no
link to any website or any reason to not support slufigied URLs when
website is not installed. A new unslug_url method is added as a tool
coming from an embedded method from website. Doing it allows to have all
slug related methods defined at the same point.
Support of slug and unslug in qweb rendering is also moved directly in
http_routing version of ir_ui_view instead of website inheritance. This
is done in order to keep things coherent.
Some code from website about ModelConverter is also moved. Indeed both
versions of ir_http uses some kind of placeholder to store the uid
when converting urls to python. This commit unifies it by using the
website one directly in base to simplify the override.
This commit also updates all module importing slug. Enterprise modules
will have to be updated, see related commit.
- Add a "Filter by Industry" filter on top of the "Filter by Country" on the main /customers page. It should work similarly to the filter by "Level" in the /partners page of crm_partner_assign, but would filter on the customer's industry (With "All Industries") etc.
- (Cfr www.odoo.com/customers vs www.odoo.com/partners for live examples)
- The search input field on the main /customer page should search on the Industry field as well
- Add the "Industry" info to the /customers index, e.g. like a badge: http://i.imgur.com/Nzjeck9.png
- Add the "Industry" info to the website_customer.details template, e.g. like a badge or in the address block on the left
In Python 3:
* various builtins and dict methods were changed to return
view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
removed altogether
This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).
Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.
issue #8530
Avoid traceback 'list indices must be integers, not str' when country_id not in sidebar.
env.browse(id).read(['name']) return a list, so country['name'] should be country[0]['name']
As of June 22 2016, the use of API key is required to access the
following:
- Google Maps JavaScript API
- Google Static Maps API
- Google Street View Image API
https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update
For domains accessing the API before June 22, it will still work without
an API key. Since Google advises to use the API key, we hide the Maps if
no API key is defined.
Since saas-3, website controllers use `request.website.render`
to render the template of a web page. This was kept for retro
compatibility. It's time to stop using deprecated stuff.
Same for `_render` method on website.
'json' route don't use `request.render` since
`JsonRequest` has no `render` method.
Add country != False in main domain will be not the right fix, because if people doesn't activate the sort by country in customize, they are no reason to hide customer without country_id.
Change xmlid from ir rule
Uses odoo unslug function
Rename CamelCase variable / function
Replace SQL by ORM search
Replace 1 by True for boolean
Improve name for ir model access
Add missing coding
Reindent long line
Reindent xml
Typo singular/plural
The forward port of the fix 3609ba10f2 will be done separately, as the mrp scheduler has been completely refactored from saas-5.
Conflicts:
addons/l10n_be_coda/wizard/account_coda_import.py
addons/point_of_sale/static/src/xml/pos.xml
addons/procurement/schedulers.py