diff --git a/addons/payment_paypal/controllers/main.py b/addons/payment_paypal/controllers/main.py
index 967059e59ae..e07fa3d738f 100644
--- a/addons/payment_paypal/controllers/main.py
+++ b/addons/payment_paypal/controllers/main.py
@@ -40,13 +40,21 @@ class PaypalController(http.Controller):
Once data is validated, process it. """
res = False
new_post = dict(post, cmd='_notify-validate')
- urequest = urllib2.Request("https://www.sandbox.paypal.com/cgi-bin/webscr", werkzeug.url_encode(new_post))
+ cr, uid, context = request.cr, request.uid, request.context
+ reference = post.get('item_number')
+ tx = None
+ if reference:
+ tx_ids = request.registry['payment.transaction'].search(cr, uid, [('reference', '=', reference)], context=context)
+ if tx_ids:
+ tx = request.registry['payment.transaction'].browse(cr, uid, tx_ids[0], context=context)
+ paypal_urls = request.registry['payment.acquirer']._get_paypal_urls(cr, uid, tx and tx.acquirer_id and tx.acquirer_id.env or 'prod', context=context)
+ validate_url = paypal_urls['paypal_form_url']
+ urequest = urllib2.Request(validate_url, werkzeug.url_encode(new_post))
uopen = urllib2.urlopen(urequest)
resp = uopen.read()
if resp == 'VERIFIED':
_logger.info('Paypal: validated data')
- cr, uid, context = request.cr, SUPERUSER_ID, request.context
- res = request.registry['payment.transaction'].form_feedback(cr, uid, post, 'paypal', context=context)
+ res = request.registry['payment.transaction'].form_feedback(cr, SUPERUSER_ID, post, 'paypal', context=context)
elif resp == 'INVALID':
_logger.warning('Paypal: answered INVALID on data verification')
else:
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 7740020e37f..65cc85a1292 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -60,6 +60,7 @@
+
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 02c6374578b..1267b74c18d 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -780,7 +780,7 @@
Phone:
- User:
+ User:
Shop:
diff --git a/addons/portal_claim/__init__.py b/addons/portal_claim/__init__.py
index 26c654db9dd..dbd07a05428 100644
--- a/addons/portal_claim/__init__.py
+++ b/addons/portal_claim/__init__.py
@@ -19,3 +19,4 @@
#
##############################################################################
+import portal_claim
\ No newline at end of file
diff --git a/addons/portal_claim/portal_claim.py b/addons/portal_claim/portal_claim.py
new file mode 100644
index 00000000000..0a3aa40eb56
--- /dev/null
+++ b/addons/portal_claim/portal_claim.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-today OpenERP SA ()
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from openerp import SUPERUSER_ID
+from openerp.osv import osv
+
+
+class crm_claim(osv.osv):
+ _inherit = "crm.claim"
+
+ def _get_default_partner_id(self, cr, uid, context=None):
+ """ Gives default partner_id """
+ if context is None:
+ context = {}
+ if context.get('portal'):
+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+ # Special case for portal users, as they are not allowed to call name_get on res.partner
+ # We save this call for the web client by returning it in default get
+ return self.pool['res.partner'].name_get(cr, SUPERUSER_ID, [user.partner_id.id], context=context)[0]
+ return False
+
+ _defaults = {
+ 'partner_id': lambda s, cr, uid, c: s._get_default_partner_id(cr, uid, c),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/portal_sale/portal_sale_data.xml b/addons/portal_sale/portal_sale_data.xml
index 2da55bcb081..dc015777288 100644
--- a/addons/portal_sale/portal_sale_data.xml
+++ b/addons/portal_sale/portal_sale_data.xml
@@ -7,7 +7,7 @@
Sales Order - Send by Email (Portal)${(object.user_id.email or '')|safe}
- ${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })
+ ${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })${object.partner_invoice_id.id}
@@ -97,7 +97,7 @@
Invoice - Send by Email (Portal)${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}
- ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })
+ ${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a' })${object.partner_id.id}
diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml
index 4ad5e5b9849..50df0027b5b 100644
--- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml
+++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml
@@ -16,9 +16,7 @@
cost_method: standard
mes_type: fixed
name: HR Manger
- procure_method: make_to_stock
standard_price: 1.0
- supply_method: buy
type: service
uom_id: product.product_uom_hour
uom_po_id: product.product_uom_hour
diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml
index 51d075b0ce0..b164261ddff 100644
--- a/addons/purchase/edi/purchase_order_action_data.xml
+++ b/addons/purchase/edi/purchase_order_action_data.xml
@@ -20,7 +20,7 @@
Purchase Order - Send by mail${(object.validator.email or '')|safe}
- ${object.company_id.name} Order (Ref ${object.name or 'n/a' })
+ ${object.company_id.name|safe} Order (Ref ${object.name or 'n/a' })${object.partner_id.id}
diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml
index 4ad657d7f82..d17443a7577 100644
--- a/addons/sale/edi/sale_order_action_data.xml
+++ b/addons/sale/edi/sale_order_action_data.xml
@@ -21,7 +21,7 @@
Sales Order - Send by Email${(object.user_id.email or '')|safe}
- ${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })
+ ${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })${object.partner_invoice_id.id}
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 3e0a7d55e3a..99d420f49bb 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1930,14 +1930,13 @@ class stock_move(osv.osv):
product = self.pool.get('product.product').browse(cr, uid, [prod_id], context=ctx)[0]
uos_id = product.uos_id and product.uos_id.id or False
result = {
+ 'name': product.partner_ref,
'product_uom': product.uom_id.id,
'product_uos': uos_id,
'product_qty': 1.00,
'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty'],
'prodlot_id' : False,
}
- if not ids:
- result['name'] = product.partner_ref
if loc_id:
result['location_id'] = loc_id
if loc_dest_id:
diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js
index 5e5d39203a6..83f99ef50e0 100644
--- a/addons/web_kanban/static/src/js/kanban.js
+++ b/addons/web_kanban/static/src/js/kanban.js
@@ -300,6 +300,9 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
self.do_clear_groups();
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) {
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
+ if (!_.isEmpty(self.dataset.ids) && (self.dataset.index === null || self.dataset.index >= self.dataset.ids.length)) {
+ self.dataset.index = 0;
+ }
self.do_add_groups([kgroup]).done(function() {
if (_.isEmpty(records)) {
self.no_result();
diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py
index b19614410b5..b23836ecb92 100644
--- a/addons/website_quote/models/order.py
+++ b/addons/website_quote/models/order.py
@@ -64,11 +64,14 @@ class sale_quote_line(osv.osv):
def on_change_product_id(self, cr, uid, ids, product, context=None):
vals = {}
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
+ name = product_obj.name
+ if product_obj.description_sale:
+ name += '\n' + product_obj.description_sale
vals.update({
'price_unit': product_obj.list_price,
'product_uom_id': product_obj.uom_id.id,
'website_description': product_obj.website_description,
- 'name': product_obj.name,
+ 'name': name,
})
return {'value': vals}
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py
index 418fb3da3bb..9f6c27ecb63 100644
--- a/addons/website_sale/models/website.py
+++ b/addons/website_sale/models/website.py
@@ -224,4 +224,8 @@ class Website(orm.Model):
return super(Website, self).preprocess_request(cr, uid, ids, request, context=None)
def ecommerce_get_product_domain(self):
- return [("sale_ok", "=", True),("product_variant_ids","!=",False)]
+ return [
+ ("sale_ok", "=", True),
+ # force search on product.product to use the orm (exclude active, acl,..)
+ ("product_variant_ids.id", "!=", False),
+ ]
diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py
index 78e0af7d6fe..76533b20777 100644
--- a/openerp/report/report_sxw.py
+++ b/openerp/report/report_sxw.py
@@ -267,7 +267,9 @@ class rml_parse(object):
elif (hasattr(obj, '_field') and\
isinstance(obj._field, (float_field, function_field)) and\
obj._field.digits):
- d = obj._field.digits[1] or DEFAULT_DIGITS
+ d = obj._field.digits[1]
+ if not d and d is not 0:
+ d = DEFAULT_DIGITS
return d
def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):
diff --git a/openerp/tools/yaml_import.py b/openerp/tools/yaml_import.py
index 060d261ef18..c3b0fbc388f 100644
--- a/openerp/tools/yaml_import.py
+++ b/openerp/tools/yaml_import.py
@@ -446,16 +446,15 @@ class YamlInterpreter(object):
args = map(lambda x: eval(x, ctx), match.group(2).split(','))
result = getattr(model, match.group(1))(self.cr, SUPERUSER_ID, [], *args)
for key, val in (result or {}).get('value', {}).items():
- assert key in fg, (
- "The field %r returned from the onchange call %r "
- "does not exist in the source view %r (of object "
- "%r). This field will be ignored (and thus not "
- "populated) when clients saves the new record" % (
- key, match.group(1), view_info.get('name', '?'), model._name
- ))
- if key not in fields:
- # do not shadow values explicitly set in yaml.
- record_dict[key] = process_val(key, val)
+ if key in fg:
+ if key not in fields:
+ # do not shadow values explicitly set in yaml.
+ record_dict[key] = process_val(key, val)
+ else:
+ _logger.warning("The returning field '%s' from your on_change call '%s'"
+ " does not exist either on the object '%s', either in"
+ " the view '%s'",
+ key, match.group(1), model._name, view_info['name'])
else:
nodes = list(el) + nodes
else: