diff --git a/addons/base_geolocalize/models/res_partner.py b/addons/base_geolocalize/models/res_partner.py index 53f2c1d2dab..fd607426bf1 100644 --- a/addons/base_geolocalize/models/res_partner.py +++ b/addons/base_geolocalize/models/res_partner.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json -import urllib +import urllib2 from openerp import api, fields, models, tools, _ from openerp.exceptions import UserError @@ -9,10 +9,10 @@ from openerp.exceptions import UserError def geo_find(addr): url = 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' - url += urllib.quote(addr.encode('utf8')) + url += urllib2.quote(addr.encode('utf8')) try: - result = json.load(urllib.urlopen(url)) + result = json.load(urllib2.urlopen(url)) except Exception as e: raise UserError(_('Cannot contact geolocation servers. Please make sure that your Internet connection is up and running (%s).') % e) if result['status'] != 'OK': diff --git a/addons/crm/res_partner.py b/addons/crm/res_partner.py index eb1c3a65f1b..8f04b5541b7 100644 --- a/addons/crm/res_partner.py +++ b/addons/crm/res_partner.py @@ -37,7 +37,7 @@ class res_partner(osv.osv): 'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\ 'Opportunities', domain=[('type', '=', 'opportunity')]), 'meeting_ids': fields.many2many('calendar.event', 'calendar_event_res_partner_rel','res_partner_id', 'calendar_event_id', - 'Meetings'), + 'Meetings', copy=False), 'opportunity_count': fields.function(_opportunity_meeting_count, string="Opportunity", type='integer', multi='opp_meet'), 'meeting_count': fields.function(_opportunity_meeting_count, string="# Meetings", type='integer', multi='opp_meet'), 'activities_count': fields.function(_compute_activities_count, string="Activities", type="integer"), diff --git a/addons/hw_posbox_homepage/controllers/main.py b/addons/hw_posbox_homepage/controllers/main.py index 1d44e7da255..5f6fba5309c 100644 --- a/addons/hw_posbox_homepage/controllers/main.py +++ b/addons/hw_posbox_homepage/controllers/main.py @@ -57,9 +57,7 @@ index_template = """

If you need to grant remote debugging access to a developer, you can do it here.

-

- If you need to display the current customer basket on another device, you can do it here. -

+ %s

The PosBox software installed on this posbox is version 16, the posbox version number is independent from Odoo. You can upgrade @@ -74,10 +72,21 @@ index_template = """ class PosboxHomepage(openerp.addons.web.controllers.main.Home): + + def get_hw_screen_message(self): + return """ +

+ The activate the customer display feature, you will need to reinstall the PosBox software. + You can find the latest images on the Odoo Nightly builds website. + Make sure to download at least the version 16.
+ Odoo version 11, or above, is required to use the customer display feature. +

+""" + @http.route('/', type='http', auth='none', website=True) def index(self): #return request.render('hw_posbox_homepage.index',mimetype='text/html') - return index_template + return index_template % self.get_hw_screen_message() @http.route('/wifi', type='http', auth='none', website=True) def wifi(self): diff --git a/addons/hw_scanner/controllers/main.py b/addons/hw_scanner/controllers/main.py index ad0f47a2cda..2319a0c7c2e 100644 --- a/addons/hw_scanner/controllers/main.py +++ b/addons/hw_scanner/controllers/main.py @@ -120,7 +120,10 @@ class Scanner(Thread): def get_devices(self): try: if not evdev: - return None + return [] + + if not os.path.isdir(self.input_dir): + return [] new_devices = [device for device in listdir(self.input_dir) if join(self.input_dir, device) not in [dev.evdev.fn for dev in self.open_devices]] diff --git a/addons/hw_screen/controllers/main.py b/addons/hw_screen/controllers/main.py index 716f3117115..1281b18fa21 100644 --- a/addons/hw_screen/controllers/main.py +++ b/addons/hw_screen/controllers/main.py @@ -4,6 +4,7 @@ from openerp import http from openerp.tools import config from openerp.addons.web.controllers import main as web +from openerp.addons.hw_posbox_homepage.controllers import main as homepage import logging import netifaces as ni @@ -16,6 +17,14 @@ self_port = str(config['xmlrpc_port'] or 8069) _logger = logging.getLogger(__name__) +class Homepage(homepage.PosboxHomepage): + + def get_hw_screen_message(self): + return """ +

+If you need to display the current customer basket on another device, you can do it here. +

+""" class HardwareScreen(web.Home): diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 868769e6d62..7b959b32d1e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1223,8 +1223,13 @@ class mrp_production(osv.osv): source_location_id = production.location_src_id.id prod_location_id = source_location_id prev_move= False - if production.bom_id.routing_id and production.bom_id.routing_id.location_id and production.bom_id.routing_id.location_id.id != source_location_id: - source_location_id = production.bom_id.routing_id.location_id.id + if production.routing_id: + routing = production.routing_id + else: + routing = production.bom_id.routing_id + + if routing and routing.location_id and routing.location_id.id != source_location_id: + source_location_id = routing.location_id.id prev_move = True destination_location_id = production.product_id.property_stock_production.id diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 8a88ee059c0..3cd8a03c24c 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -268,7 +268,7 @@ class product_pricelist(osv.osv): class product_pricelist_item(osv.osv): _name = "product.pricelist.item" _description = "Pricelist item" - _order = "applied_on, min_quantity desc, categ_id desc" + _order = "applied_on, min_quantity desc, categ_id desc, id" def _check_recursion(self, cr, uid, ids, context=None): for obj_list in self.browse(cr, uid, ids, context=context): diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py index 175d6885b1b..ad9d83f163c 100644 --- a/addons/product_margin/product_margin.py +++ b/addons/product_margin/product_margin.py @@ -73,7 +73,7 @@ class product_product(osv.osv): #Cost price is calculated afterwards as it is a property sqlstr="""select - sum(l.price_unit * l.quantity)/sum(nullif(l.quantity,0)) as avg_unit_price, + sum(l.price_unit * l.quantity)/nullif(sum(l.quantity),0) as avg_unit_price, sum(l.quantity) as num_qty, sum(l.quantity * (l.price_subtotal/(nullif(l.quantity,0)))) as total, sum(l.quantity * pt.list_price) as sale_expected diff --git a/doc/cla/corporate/savoirfairelinux.md b/doc/cla/corporate/savoirfairelinux.md index 31be8b5f9b8..784518b093e 100644 --- a/doc/cla/corporate/savoirfairelinux.md +++ b/doc/cla/corporate/savoirfairelinux.md @@ -1,4 +1,4 @@ -Canada, France, 8-2-2015 +Canada, France, 2017-05-12 Savoir-faire Linux agrees to the terms of the Odoo Corporate Contributor License Agreement v1.0. @@ -8,22 +8,25 @@ declaration. Signed, -Maxime Chambreuil partners@savoirfairelinux.com https://github.com/savoirfairelinux +Jérome Boisvert-Chouinard jerome.boisvertchouinard@savoirfairelinux.com https://github.com/jbchouinard List of contributors: +Agathe Mollé agathe.molle@savoirfairelinux.com https://github.com/Ehtaga Bruno Joliveau bruno.joliveau@savoirfairelinux.com https://github.com/bjoliveau -David Cormier david.cormier@savoirfairelinux.com https://github.com/cormier David Dufresne david.dufresne@savoirfairelinux.com https://github.com/dufresnedavid -Davin Baragiotta davin.baragiotta@savoirfairelinux.com https://github.com/giotta -El Hadji Dem elhadji.dem@savoirfairelinux.com https://github.com/ehdem -Guillaume Auger guillaume.auger@savoirfairelinux.com https://github.com/jehog +Jérome Boisvert-Chouinard jerome.boisvertchouinard@savoirfairelinux.com https://github.com/jbchouinard Joao Alfredo Gama Batista joao.gama@savoirfairelinux.com https://github.com/joaoalf -Jordi Riera jordi.riera@savoirfairelinux.com https://github.com/foutoucour -Julien Roux julien.roux@savoirfairelinux.com https://github.com/jrouxsfl -Loïc Faure-Lacroix loic.lacroix@savoirfairelinux.com https://github.com/llacroix -Maxime Chambreuil maxime.chambreuil@savoirfairelinux.com https://github.com/max3903 -Pierre Gault pierre.gault@savoirfairelinux.com https://github.com/gaultp +Julie Moussu julie.mousse@savoirfairelinux.com https://github.com/JulieSFL Pierre Lamarche pierre.lamarche@savoirfairelinux.com https://github.com/plamarche -Sandy Carter sandy.carter@savoirfairelinux.com https://github.com/bwrsandman -Vincent Vinet vincent.vinet@savoirfairelinux.com https://github.com/veloutin +David Cormier david.cormier@savoirfairelinux.com https://github.com/cormier (up to 2017-05-12) +Davin Baragiotta davin.baragiotta@savoirfairelinux.com https://github.com/giotta (up to 2017-05-12) +El Hadji Dem elhadji.dem@savoirfairelinux.com https://github.com/ehdem (up to 2017-05-12) +Guillaume Auger guillaume.auger@savoirfairelinux.com https://github.com/jehog (up to 2017-05-12) +Jordi Riera jordi.riera@savoirfairelinux.com https://github.com/foutoucour (up to 2017-05-12) +Julien Roux julien.roux@savoirfairelinux.com https://github.com/jrouxsfl (up to 2017-05-12) +Loïc Faure-Lacroix loic.lacroix@savoirfairelinux.com https://github.com/llacroix (up to 2017-05-12) +Maxime Chambreuil maxime.chambreuil@savoirfairelinux.com https://github.com/max3903 (up to 2017-05-12) +Pierre Gault pierre.gault@savoirfairelinux.com https://github.com/gaultp (up to 2017-05-12) +Sandy Carter sandy.carter@savoirfairelinux.com https://github.com/bwrsandman (up to 2017-05-12) +Vincent Vinet vincent.vinet@savoirfairelinux.com https://github.com/veloutin (up to 2017-05-12) diff --git a/doc/cla/individual/JesusVMayor.md b/doc/cla/individual/JesusVMayor.md index c009f323be9..456778e94f5 100644 --- a/doc/cla/individual/JesusVMayor.md +++ b/doc/cla/individual/JesusVMayor.md @@ -9,4 +9,4 @@ declaration. Signed, Jesús Ventosinos Mayor jesus@pexego.es https://github.com/jesusVMayor - +Jesús Ventosinos Mayor jesus@comunitea.com https://github.com/jesusVMayor diff --git a/openerp/models.py b/openerp/models.py index 14cabe2ca00..1205c84e24c 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -850,7 +850,7 @@ class BaseModel(object): field = cls._fields.get(name) if not field: _logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name) - elif not (field.store or field.column and field.column._fnct_inv): + elif not (field.store or field.column and field.column._fnct_inv or field.inherited): _logger.warning("method %s.%s: @constrains parameter %r is not writeable", cls._name, attr, name) methods.append(func)