diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 1a14a141aa7..010d79be851 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -17,16 +17,27 @@ class ReportAgedPartnerBalance(models.AbstractModel):
# Do an invoice and a payment and unreconcile. The amount will be nullified
# By default, the partner wouldn't appear in this report.
# The context key allow it to appear
+ # In case of a period_length of 30 days as of 2019-02-08, we want the following periods:
+ # Name Stop Start
+ # 1 - 30 : 2019-02-07 - 2019-01-09
+ # 31 - 60 : 2019-01-08 - 2018-12-10
+ # 61 - 90 : 2018-12-09 - 2018-11-10
+ # 91 - 120 : 2018-11-09 - 2018-10-11
+ # +120 : 2018-10-10
periods = {}
start = datetime.strptime(date_from, "%Y-%m-%d")
for i in range(5)[::-1]:
stop = start - relativedelta(days=period_length)
+ period_name = str((5-(i+1)) * period_length + 1) + '-' + str((5-i) * period_length)
+ period_stop = (start - relativedelta(days=1)).strftime('%Y-%m-%d')
+ if i == 0:
+ period_name = '+' + str(4 * period_length)
periods[str(i)] = {
- 'name': (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))),
- 'stop': start.strftime('%Y-%m-%d'),
+ 'name': period_name,
+ 'stop': period_stop,
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
}
- start = stop - relativedelta(days=1)
+ start = stop
res = []
total = []
@@ -77,7 +88,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
WHERE (l.account_id = account_account.id) AND (l.move_id = am.id)
AND (am.state IN %s)
AND (account_account.internal_type IN %s)
- AND (COALESCE(l.date_maturity,l.date) > %s)\
+ AND (COALESCE(l.date_maturity,l.date) >= %s)\
AND ((l.partner_id IN %s) OR (l.partner_id IS NULL))
AND (l.date <= %s)
AND l.company_id IN %s'''
diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py
index b4924a0caea..5c1f444557a 100644
--- a/addons/account/tests/test_reconciliation.py
+++ b/addons/account/tests/test_reconciliation.py
@@ -784,7 +784,7 @@ class TestReconciliation(AccountingTestCase):
def test_aged_report(self):
AgedReport = self.env['report.account.report_agedpartnerbalance'].with_context(include_nullified_amount=True)
account_type = ['receivable']
- report_date_to = time.strftime('%Y') + '-07-15'
+ report_date_to = time.strftime('%Y') + '-07-16'
partner = self.env['res.partner'].create({'name': 'AgedPartner'})
currency = self.env.user.company_id.currency_id
diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py
index 5d12f49f2c4..153fc8c3a8d 100644
--- a/addons/maintenance/models/maintenance.py
+++ b/addons/maintenance/models/maintenance.py
@@ -348,8 +348,8 @@ class MaintenanceRequest(models.Model):
res = super(MaintenanceRequest, self).write(vals)
if vals.get('owner_user_id') or vals.get('technician_user_id'):
self._add_followers()
- if self.stage_id.done and 'stage_id' in vals:
- self.write({'close_date': fields.Date.today()})
+ if 'stage_id' in vals:
+ self.filtered(lambda m: m.stage_id.done).write({'close_date': fields.Date.today()})
self.activity_feedback(['maintenance.mail_act_maintenance_request'])
if 'schedule_date' in vals:
self.activity_update()
diff --git a/addons/mass_mailing/static/src/less/themes/theme_default.less b/addons/mass_mailing/static/src/less/themes/theme_default.less
index aba67dbeb64..a1f394719c1 100644
--- a/addons/mass_mailing/static/src/less/themes/theme_default.less
+++ b/addons/mass_mailing/static/src/less/themes/theme_default.less
@@ -89,7 +89,6 @@ td {
}
.btn.btn-primary {
- -webkit-user-select: none;
color: @o_mm_def_btn_text;
border: none;
text-decoration: none;
diff --git a/addons/purchase_mrp/models/purchase_mrp.py b/addons/purchase_mrp/models/purchase_mrp.py
index b498f4a63e5..ebfb1f0bc10 100644
--- a/addons/purchase_mrp/models/purchase_mrp.py
+++ b/addons/purchase_mrp/models/purchase_mrp.py
@@ -21,7 +21,8 @@ class PurchaseOrderLine(models.Model):
# In the case of a kit, we need to check if all components are shipped. Since the BOM might
# have changed, we don't compute the quantities but verify the move state.
if bom:
- bom_delivered = all([move.state == 'done' for move in self.move_ids])
+ moves = self.move_ids.filtered(lambda m: m.picking_id and m.picking_id.state != 'cancel')
+ bom_delivered = all([move.state == 'done' for move in moves])
if bom_delivered:
return self.product_qty
else:
diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml
index d742ec75b0e..44d337b2884 100644
--- a/addons/stock/views/stock_picking_views.xml
+++ b/addons/stock/views/stock_picking_views.xml
@@ -325,6 +325,7 @@
+
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js
index 8f87b36c874..d3f4d134229 100644
--- a/addons/web/static/src/js/widgets/date_picker.js
+++ b/addons/web/static/src/js/widgets/date_picker.js
@@ -22,8 +22,6 @@ var DateWidget = Widget.extend({
init: function(parent, options) {
this._super.apply(this, arguments);
- var l10n = _t.database.parameters;
-
this.name = parent.name;
this.options = _.defaults(options || {}, {
format : this.type_of_date === 'datetime' ? time.getLangDatetimeFormat() : time.getLangDateFormat(),
@@ -51,12 +49,8 @@ var DateWidget = Widget.extend({
*/
start: function() {
this.$input = this.$('input.o_datepicker_input');
- this.$input.focus(function(e) {
- e.stopImmediatePropagation();
- });
this.$input.datetimepicker(this.options);
this.picker = this.$input.data('DateTimePicker');
- this.$input.click(this.picker.toggle.bind(this.picker));
this._setReadonly(false);
},
/**
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index 03f9a3606af..4b1e6248624 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -2226,7 +2226,7 @@ QUnit.module('basic_fields', {
});
QUnit.test('date field value should not set on first click', function (assert) {
- assert.expect(2);
+ assert.expect(3);
var form = createView({
View: FormView,
@@ -2236,10 +2236,10 @@ QUnit.module('basic_fields', {
res_id: 4,
});
form.$buttons.find('.o_form_button_edit').click();
- form.$('.o_datepicker_input').click();
+ assert.strictEqual($('.bootstrap-datetimepicker-widget').length, 1, "there should be a datepicker (autofocus)");
assert.strictEqual(form.$('.o_datepicker_input').val(), '', "date field's input should be empty on first click");
$('.day:contains(22)').click();
- form.$('.o_datepicker_input').click(); // Open Datepicker second time
+ form.$('.o_datepicker_input').focus(); // Open Datepicker second time
assert.strictEqual($('.day.active').text(), '22', 'datepicker should be highlight with 22nd day of month');
form.destroy();
});
@@ -2277,8 +2277,7 @@ QUnit.module('basic_fields', {
assert.strictEqual(form.$('.o_datepicker_input').val(), '02/03/2017',
'the date should be correct in edit mode');
- // click on the input and select another value
- form.$('.o_datepicker_input').click();
+ // select another value
assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open');
assert.strictEqual($('.day.active').data('day'), '02/03/2017', 'datepicker should be highlight February 3');
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection
@@ -2361,8 +2360,7 @@ QUnit.module('basic_fields', {
assert.strictEqual(list.$('input.o_datepicker_input').val(), '02/03/2017',
'the date should be correct in edit mode');
- // click on the input and select another value
- list.$('input.o_datepicker_input').click();
+ // select another value
assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open');
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection
@@ -2479,8 +2477,7 @@ QUnit.module('basic_fields', {
form.$buttons.find('.o_form_button_edit').click();
assert.strictEqual(form.$('.o_datepicker_input').val(), expectedDateString,
'the datetime should be correct in edit mode');
- // click on the input and select 22 February at 8:23:33
- form.$('.o_datepicker_input').click();
+ // select 22 February at 8:23:33
assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open');
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection
@@ -2578,8 +2575,7 @@ QUnit.module('basic_fields', {
assert.strictEqual(list.$('input.o_datepicker_input').val(), expectedDateString,
'the date should be correct in edit mode');
- // click on the input and select 22 February at 8:23:33
- list.$('input.o_datepicker_input').click();
+ // select 22 February at 8:23:33
assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open');
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection
$('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection
@@ -2755,7 +2751,6 @@ QUnit.module('basic_fields', {
});
form.$buttons.find('.o_form_button_create').click();
- form.$('.o_datepicker_input.o_input').click();
assert.ok($('.day:last-child(),.day:nth-child(2)').hasClass('disabled'),
'first and last days must be disabled');
assert.notOk($('.day:not(:last-child()):not(:nth-child(2))').hasClass('disabled'),
diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js
index f9662308e22..5e1f07dfd53 100644
--- a/addons/web/static/tests/views/calendar_tests.js
+++ b/addons/web/static/tests/views/calendar_tests.js
@@ -645,14 +645,14 @@ QUnit.module('Views', {
"should display the datetime from the date with the timezone");
// use datepicker to enter a date: 12/13/2016 08:00:00
- $('.o_field_widget[name="start"] input').trigger('click');
+ $('.o_field_widget[name="start"] input').trigger('focus');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="togglePicker"]').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker .timepicker-hour').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker-hours td.hour:contains(08)').trigger('click');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="close"]').trigger('click');
// use datepicker to enter a date: 12/13/2016 10:00:00
- $('.o_field_widget[name="stop"] input').trigger('click');
+ $('.o_field_widget[name="stop"] input').trigger('focus');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="togglePicker"]').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker .timepicker-hour').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker-hours td.hour:contains(10)').trigger('click');
@@ -894,14 +894,14 @@ QUnit.module('Views', {
"should display the datetime from the date with the timezone");
// use datepicker to enter a date: 12/13/2016 08:00:00
- $('.o_field_widget[name="start"] input').trigger('click');
+ $('.o_field_widget[name="start"] input').trigger('focus');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="togglePicker"]').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker .timepicker-hour').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker-hours td.hour:contains(08)').trigger('click');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="close"]').trigger('click');
// use datepicker to enter a date: 12/13/2016 10:00:00
- $('.o_field_widget[name="stop"] input').trigger('click');
+ $('.o_field_widget[name="stop"] input').trigger('focus');
$('.bootstrap-datetimepicker-widget .picker-switch a[data-action="togglePicker"]').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker .timepicker-hour').trigger('click');
$('.bootstrap-datetimepicker-widget .timepicker-hours td.hour:contains(10)').trigger('click');
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index 097f3d3b12f..5e404d97c10 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -754,6 +754,7 @@ registry.colorpicker = SnippetOption.extend({
*/
_onColorResetButtonClick: function () {
this.$target.removeClass(this.classes);
+ self.$target.trigger('content_changed');
this.$el.find('.colorpicker button.selected').removeClass('selected');
},
});
diff --git a/addons/web_editor/static/src/less/web_editor.ui.less b/addons/web_editor/static/src/less/web_editor.ui.less
index 76e86b98cb9..43f218a4294 100644
--- a/addons/web_editor/static/src/less/web_editor.ui.less
+++ b/addons/web_editor/static/src/less/web_editor.ui.less
@@ -1037,6 +1037,9 @@ body.editor_enable {
left: 0;
}
}
+ .btn {
+ -webkit-user-select: initial;
+ }
}
#web_editor_inside_iframe {
diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js
index 75876b55c35..98aebba58a4 100644
--- a/addons/website_links/static/src/js/website_links_charts.js
+++ b/addons/website_links/static/src/js/website_links_charts.js
@@ -61,6 +61,7 @@ if (!$('.o_website_links_chart').length) {
var chart = nv.models.lineChart()
.x(function (d) { return getDate(d); })
.y(function (d) { return getNbClicks(d); })
+ .margin({top: 10, right: 60, bottom: 60, left: 60})
.showYAxis(true)
.showXAxis(true);
@@ -74,7 +75,7 @@ if (!$('.o_website_links_chart').length) {
chart.yAxis
.tickFormat(d3.format("d"))
- .ticks(chart_data[0]['values'].length - 1);
+ .ticks(Math.min(chart_data[0]['values'].length - 1, 10));
d3.select(self.$element + ' svg')
.datum(chart_data)
diff --git a/doc/cla/individual/stijnh92.md b/doc/cla/individual/stijnh92.md
new file mode 100644
index 00000000000..b969df67c38
--- /dev/null
+++ b/doc/cla/individual/stijnh92.md
@@ -0,0 +1,11 @@
+Belgium, 2018-09-05
+
+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,
+
+Stijn Houben stijnhouben92@gmail.com https://github.com/stijnh92
diff --git a/odoo/addons/base/data/res_country_data.xml b/odoo/addons/base/data/res_country_data.xml
index 0b508cd4e27..d924f2ee042 100644
--- a/odoo/addons/base/data/res_country_data.xml
+++ b/odoo/addons/base/data/res_country_data.xml
@@ -457,7 +457,7 @@
Ecuador
ec
-
+
diff --git a/odoo/addons/base/security/ir.model.access.csv b/odoo/addons/base/security/ir.model.access.csv
index 579390d9e4c..380dda058fd 100644
--- a/odoo/addons/base/security/ir.model.access.csv
+++ b/odoo/addons/base/security/ir.model.access.csv
@@ -95,4 +95,4 @@
"access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0
"access_ir_logging","ir_logging admin","model_ir_logging","group_erp_manager",1,1,1,1
"paperformat_access_portal","ir_actions_report_paperformat group_portal","model_report_paperformat",,1,0,0,0
-"paperformat_access_employee","ir_actions_report_paperformat group_hr_user","model_report_paperformat",,1,0,1,0
+"paperformat_access_employee","ir_actions_report_paperformat group_system","model_report_paperformat",group_system,1,1,1,1
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index 5256da34968..feed019a4c7 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -467,6 +467,8 @@ class configmanager(object):
os.path.abspath(os.path.expanduser(os.path.expandvars(x.strip())))
for x in self.options['addons_path'].split(','))
+ self.options['data_dir'] = os.path.abspath(os.path.expanduser(os.path.expandvars(self.options['data_dir'].strip())))
+
self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {}
self.options['demo'] = (dict(self.options['init'])
if not self.options['without_demo'] else {})