diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-01-02 11:22:45 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-01-02 11:22:45 +0100 |
| commit | 7be1a1c55bcb4a86fc0c6ede7a3bef8136e7c3d6 (patch) | |
| tree | 62093a6519d34d2349b75b5a5157e6e16052322c | |
| parent | a9a9f624e47251fa8bd966bc2118836350ddff01 (diff) | |
| parent | 2b8fcfc08b08b753f97e24c458a4be9b96f367a2 (diff) | |
[MERGE] forward port branch 8.0 up to 2b8fcfc08b0
| -rw-r--r-- | addons/account/account.py | 2 | ||||
| -rw-r--r-- | addons/account/report/report_vat.py | 1 | ||||
| -rw-r--r-- | addons/account_voucher/voucher_payment_receipt_view.xml | 2 | ||||
| -rw-r--r-- | addons/calendar/calendar.py | 12 | ||||
| -rw-r--r-- | addons/event_sale/models/event.py | 2 | ||||
| -rw-r--r-- | addons/google_calendar/google_calendar.py | 4 | ||||
| -rw-r--r-- | addons/hr_holidays/hr_holidays.py | 4 | ||||
| -rw-r--r-- | addons/mrp/stock.py | 2 | ||||
| -rw-r--r-- | addons/payment_paypal/controllers/main.py | 6 | ||||
| -rw-r--r-- | addons/portal/wizard/portal_wizard.py | 4 | ||||
| -rw-r--r-- | addons/product/product.py | 2 | ||||
| -rw-r--r-- | addons/website_sale_options/static/src/js/website_sale.js | 2 | ||||
| -rw-r--r-- | doc/cla/individual/javierjcf.md | 11 | ||||
| -rw-r--r-- | doc/cla/individual/jclopezar.md | 11 | ||||
| -rw-r--r-- | doc/cla/individual/rigo1985.md | 11 |
15 files changed, 59 insertions, 17 deletions
diff --git a/addons/account/account.py b/addons/account/account.py index a68b65f865a..fcfb2a41088 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2602,7 +2602,7 @@ class account_account_template(osv.osv): children_acc_criteria = [('chart_template_id','=', chart_template_id)] if template.account_root_id.id: children_acc_criteria = ['|'] + children_acc_criteria + ['&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False)] - children_acc_template = self.search(cr, uid, [('nocreate','!=',True)] + children_acc_criteria, order='id') + children_acc_template = self.search(cr, uid, [('nocreate','!=',True)] + children_acc_criteria, order='id', context=context) for account_template in self.browse(cr, uid, children_acc_template, context=context): # skip the root of COA if it's not the main one if (template.account_root_id.id == account_template.id) and template.parent_id: diff --git a/addons/account/report/report_vat.py b/addons/account/report/report_vat.py index edbd81845dc..338a14de89b 100644 --- a/addons/account/report/report_vat.py +++ b/addons/account/report/report_vat.py @@ -38,6 +38,7 @@ class tax_report(report_sxw.rml_parse, common_report_header): 'based_on': 'invoices', 'company_id': company_id, 'display_detail': False, + 'chart_tax_id': self.pool['account.vat.declaration']._get_tax(self.cr, self.uid), } } self.period_ids = [] diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 07a7b1f2cab..5c4aa9afde8 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -141,7 +141,7 @@ <field name="type" invisible="True"/> <group> <group> - <field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" string="Supplier"/> + <field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" domain="[('supplier','=',True)]" string="Supplier"/> <field name="currency_id" invisible="1"/> <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}'/> <field name="journal_id" diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 9dc22b7d322..7f8463cc8a5 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -721,15 +721,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), @@ -1017,12 +1017,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 @@ -1350,7 +1350,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 b1b81db9d60..0afba5cdc15 100644 --- a/addons/event_sale/models/event.py +++ b/addons/event_sale/models/event.py @@ -38,7 +38,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 ae9fc9c69f3..378d2db3972 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -205,8 +205,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 c122b5f5aab..c81451d57a2 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -32,6 +32,7 @@ from operator import attrgetter 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 _ @@ -488,7 +489,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/mrp/stock.py b/addons/mrp/stock.py index 35acbf72e53..6ad7150bded 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -228,7 +228,7 @@ class StockMove(osv.osv): production_obj.signal_workflow(cr, uid, [prod_id], 'button_produce') if move.production_id.id: self.write(cr, uid, new_moves, {'production_id': move.production_id.id}, context=context) - res.append(new_moves) + res.extend(new_moves) return res def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/payment_paypal/controllers/main.py b/addons/payment_paypal/controllers/main.py index f0bd3bb04ae..92db9af6408 100644 --- a/addons/payment_paypal/controllers/main.py +++ b/addons/payment_paypal/controllers/main.py @@ -6,6 +6,7 @@ except ImportError: import json import logging import pprint +import urllib import urllib2 import werkzeug @@ -29,7 +30,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 @@ -40,6 +41,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 22bc745c136..1a85ae31daa 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -118,7 +118,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'), } diff --git a/addons/product/product.py b/addons/product/product.py index b3af4829b0a..ed3e819b7d1 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -630,7 +630,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 9f2d704ceab..d9665802a3f 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -33,7 +33,7 @@ $(document).ready(function () { data: {lang: openerp.website.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 |
