summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-01-02 11:42:52 +0100
committerChristophe Simonis <chs@odoo.com>2017-01-02 11:42:52 +0100
commit3805eb620aaf602389a69b5bef9921d650e06f83 (patch)
tree963e1c39b6f09f3caa18c7fc23611a758ce53bcc
parent072906795c61ba6a9bd12f8eafeb9b3fc96be3d4 (diff)
parent7be1a1c55bcb4a86fc0c6ede7a3bef8136e7c3d6 (diff)
[MERGE] forward port branch saas-6 up to 7be1a1c55bc
-rw-r--r--addons/calendar/calendar.py12
-rw-r--r--addons/event_sale/models/event.py2
-rw-r--r--addons/google_calendar/google_calendar.py4
-rw-r--r--addons/hr_holidays/hr_holidays.py4
-rw-r--r--addons/payment_paypal/controllers/main.py6
-rw-r--r--addons/portal/wizard/portal_wizard.py4
-rw-r--r--addons/product/product.py2
-rw-r--r--addons/website_sale_options/static/src/js/website_sale.js2
-rw-r--r--doc/cla/individual/javierjcf.md11
-rw-r--r--doc/cla/individual/jclopezar.md11
-rw-r--r--doc/cla/individual/rigo1985.md11
11 files changed, 55 insertions, 14 deletions
diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py
index 917db516349..d37f3149aa7 100644
--- a/addons/calendar/calendar.py
+++ b/addons/calendar/calendar.py
@@ -694,15 +694,15 @@ class calendar_event(osv.Model):
return [d.astimezone(pytz.UTC) for d in rset1]
def _get_recurrency_end_date(self, cr, uid, id, context=None):
- data = self.read(cr, uid, id, ['final_date', 'recurrency', 'rrule_type', 'count', 'end_type', 'stop'], context=context)
+ data = self.read(cr, uid, id, ['final_date', 'recurrency', 'rrule_type', 'count', 'end_type', 'stop', 'interval'], context=context)
if not data.get('recurrency'):
return False
end_type = data.get('end_type')
final_date = data.get('final_date')
- if end_type == 'count' and all(data.get(key) for key in ['count', 'rrule_type', 'stop']):
- count = data['count'] + 1
+ if end_type == 'count' and all(data.get(key) for key in ['count', 'rrule_type', 'stop', 'interval']):
+ count = (data['count'] + 1) * data['interval']
delay, mult = {
'daily': ('days', 1),
'weekly': ('days', 7),
@@ -982,12 +982,12 @@ class calendar_event(osv.Model):
startdatetime = startdatetime or start
if startdatetime:
start = datetime.strptime(startdatetime, DEFAULT_SERVER_DATETIME_FORMAT)
- value['start_date'] = datetime.strftime(start, DEFAULT_SERVER_DATE_FORMAT)
+ value['start_date'] = fields.date.context_today(self, cr, uid, context=context, timestamp=start)
enddatetime = enddatetime or end
if enddatetime:
end = datetime.strptime(enddatetime, DEFAULT_SERVER_DATETIME_FORMAT)
- value['stop_date'] = datetime.strftime(end, DEFAULT_SERVER_DATE_FORMAT)
+ value['stop_date'] = fields.date.context_today(self, cr, uid, context=context, timestamp=end)
else: # from date to datetime
user = self.pool['res.users'].browse(cr, uid, uid, context)
tz = pytz.timezone(user.tz) if user.tz else pytz.utc
@@ -1322,7 +1322,7 @@ class calendar_event(osv.Model):
data['rrule_type'] = 'monthly'
if r._bymonthday:
- data['day'] = r._bymonthday[0]
+ data['day'] = list(r._bymonthday)[0]
data['month_by'] = 'date'
data['rrule_type'] = 'monthly'
diff --git a/addons/event_sale/models/event.py b/addons/event_sale/models/event.py
index 94bed87bed3..d63b934c813 100644
--- a/addons/event_sale/models/event.py
+++ b/addons/event_sale/models/event.py
@@ -34,7 +34,7 @@ class event_ticket(models.Model):
event_id = fields.Many2one('event.event', "Event", required=True, ondelete='cascade')
product_id = fields.Many2one(
'product.product', 'Product',
- required=True, domain=[("event_type_id", "!=", False)],
+ required=True, domain=["|", ("event_type_id", "!=", False), ("event_ok", "=", True)],
default=lambda self: self._default_product_id())
registration_ids = fields.One2many('event.registration', 'event_ticket_id', 'Registrations')
price = fields.Float('Price', digits=dp.get_precision('Product Price'))
diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py
index 9520cfd4ccb..acd214703b8 100644
--- a/addons/google_calendar/google_calendar.py
+++ b/addons/google_calendar/google_calendar.py
@@ -201,8 +201,8 @@ class google_calendar(osv.AbstractModel):
if not context:
context = {}
if event.allday:
- start_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.start, tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context).isoformat('T').split('T')[0]
- final_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.stop, tools.DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(days=1), context=context).isoformat('T').split('T')[0]
+ start_date = event.start_date
+ final_date = (datetime.strptime(event.stop_date, tools.DEFAULT_SERVER_DATE_FORMAT) + timedelta(days=1)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
type = 'date'
vstype = 'dateTime'
else:
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 0c3ab256965..33616d33192 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -18,6 +18,7 @@ from dateutil.relativedelta import relativedelta
from openerp.exceptions import UserError, AccessError
from openerp import tools
from openerp.osv import fields, osv
+from openerp.tools import float_compare
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
@@ -486,7 +487,8 @@ class hr_holidays(osv.osv):
if record.holiday_type != 'employee' or record.type != 'remove' or not record.employee_id or record.holiday_status_id.limit:
continue
leave_days = self.pool.get('hr.holidays.status').get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, context=context)[record.holiday_status_id.id]
- if leave_days['remaining_leaves'] < 0 or leave_days['virtual_remaining_leaves'] < 0:
+ if float_compare(leave_days['remaining_leaves'], 0, precision_digits=2) == -1 or \
+ float_compare(leave_days['virtual_remaining_leaves'], 0, precision_digits=2) == -1:
return False
return True
diff --git a/addons/payment_paypal/controllers/main.py b/addons/payment_paypal/controllers/main.py
index e71ef8d2546..87b68e19510 100644
--- a/addons/payment_paypal/controllers/main.py
+++ b/addons/payment_paypal/controllers/main.py
@@ -3,6 +3,7 @@
import json
import logging
import pprint
+import urllib
import urllib2
import werkzeug
@@ -26,7 +27,7 @@ class PaypalController(http.Controller):
return return_url
def _parse_pdt_response(self, response):
- """ Parse a text reponse for a PDT verification .
+ """ Parse a text response for a PDT verification .
:param response str: text response, structured in the following way:
STATUS\nkey1=value1\nkey2=value2...\n
@@ -37,6 +38,9 @@ class PaypalController(http.Controller):
lines = filter(None, response.split('\n'))
status = lines.pop(0)
pdt_post = dict(line.split('=', 1) for line in lines)
+ # html unescape
+ for post in pdt_post:
+ pdt_post[post] = urllib.unquote_plus(pdt_post[post]).decode('utf8')
return status, pdt_post
def paypal_validate_data(self, **post):
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index ccef7eb0bd5..27bc21835e5 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -81,7 +81,9 @@ class wizard_user(osv.osv_memory):
_columns = {
'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade'),
- 'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
+ 'partner_id': fields.many2one(
+ 'res.partner', string='Contact', required=True, readonly=True,
+ ondelete='cascade'),
'email': fields.char(string='Email', size=240),
'in_portal': fields.boolean('In Portal'),
'user_id': fields.many2one('res.users', string='Login User'),
diff --git a/addons/product/product.py b/addons/product/product.py
index 44d97b0a048..c59054f323b 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -561,7 +561,7 @@ class product_template(osv.osv):
else:
company_id = context.get('force_company') or product.env.user.company_id.id
product = product.with_context(force_company=company_id)
- res[product.id] = res[product.id] = product.sudo()[ptype]
+ res[product.id] = product.sudo()[ptype]
if ptype == 'list_price':
res[product.id] += product._name == "product.product" and product.price_extra or 0.0
if 'uom' in context:
diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js
index e614ee8664b..bb246713e5d 100644
--- a/addons/website_sale_options/static/src/js/website_sale.js
+++ b/addons/website_sale_options/static/src/js/website_sale.js
@@ -41,7 +41,7 @@ $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit')
data: {lang: base.get_context().lang},
success: function (quantity) {
if (!$a.hasClass('js_goto_shop')) {
- window.location.href = window.location.href.replace(/shop([\/?].*)?$/, "shop/cart");
+ window.location.pathname = window.location.pathname.replace(/shop([\/?].*)?$/, "shop/cart");
}
var $q = $(".my_cart_quantity");
$q.parent().parent().removeClass("hidden", !quantity);
diff --git a/doc/cla/individual/javierjcf.md b/doc/cla/individual/javierjcf.md
new file mode 100644
index 00000000000..9b1a479941b
--- /dev/null
+++ b/doc/cla/individual/javierjcf.md
@@ -0,0 +1,11 @@
+Spain, 2016-04-15
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Javier Colmenero Fernández javierjcf@gmail.com https://github.com/javierjcf
diff --git a/doc/cla/individual/jclopezar.md b/doc/cla/individual/jclopezar.md
new file mode 100644
index 00000000000..577d7061759
--- /dev/null
+++ b/doc/cla/individual/jclopezar.md
@@ -0,0 +1,11 @@
+Ecuador, 2016-12-13
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Juan Cristobal Lopez Arrieta juancristobal@gmail.com https://github.com/jclopezar
diff --git a/doc/cla/individual/rigo1985.md b/doc/cla/individual/rigo1985.md
new file mode 100644
index 00000000000..f58ef8491de
--- /dev/null
+++ b/doc/cla/individual/rigo1985.md
@@ -0,0 +1,11 @@
+Cuba, 2016-12-01
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Rigoberto Martínez rigo1985@gmail.com https://github.com/rigo1985