From 7b445112bcab9288077fe1497d0dbce3f6f78ccb Mon Sep 17 00:00:00 2001 From: Yoshi Tashiro Date: Mon, 15 Feb 2016 20:59:57 +0800 Subject: [PATCH 1/7] [CLA] add contributor to roomsfor CLA Adding @manamirfhk Closes #10932 --- doc/cla/corporate/roomsfor.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/cla/corporate/roomsfor.md b/doc/cla/corporate/roomsfor.md index f2aa1d0c2ce..522ffffe78a 100644 --- a/doc/cla/corporate/roomsfor.md +++ b/doc/cla/corporate/roomsfor.md @@ -11,3 +11,4 @@ Yoshi Tashiro tashiro@roomsfor.hk https://github.com/yostashiro List of contributors: Yoshi Tashiro tashiro@roomsfor.hk https://github.com/yostashiro +Manami Hashi manami@roomsfor.hk https://github.com/manamirfhk From 1d7c12022dcffce4792b9eec85706e19338cfa9f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 16 Feb 2016 16:23:05 +0100 Subject: [PATCH 2/7] [FIX] stock_account: valuation history with moves having multiple quant prices The revision 29bd62252158803cdad351a2966af6eeac4cca74 aimed to improve the performance by changing the view index, to use a BIGINT instead of a text. It was assumed that the index used (`stock_move.id`) could not appear multiple times with the JOINs and group bys defined. This was in fact possible, if a stock move is associated to several quants with different costs, because of the JOIN on the many2many table `stock_quant_move_rel` linking quants to moves, and the GROUP BY `price_unit_on_quant` that caused the different moves/quants association not to be merged within one unique line if the costs on the quants are different. Instead of the group by, we now aggregate the quants costs, using the weighted average, so the index used can be unique, as expected. From now, the inventory value per line in this report view can therefore be different than what can be found on the quants, but this report view is based on the stock moves rather than the stock quants, and this is therefore accepted. In other words, the inventory value is computed for the stock move rather than for the stock quant. opw-658903 --- addons/stock_account/wizard/stock_valuation_history.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index 5fc94f8106f..fad5a454454 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -125,7 +125,7 @@ class stock_history(osv.osv): product_categ_id, SUM(quantity) as quantity, date, - price_unit_on_quant, + SUM(price_unit_on_quant * quantity) / SUM(quantity) as price_unit_on_quant, source FROM ((SELECT @@ -193,5 +193,5 @@ class stock_history(osv.osv): dest_location.usage not in ('internal', 'transit')) )) AS foo - GROUP BY move_id, location_id, company_id, product_id, product_categ_id, date, price_unit_on_quant, source + GROUP BY move_id, location_id, company_id, product_id, product_categ_id, date, source )""") From 5e940643a51a617b80845a7b6e17475348a32db1 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 15 Feb 2016 16:07:44 +0100 Subject: [PATCH 3/7] [FIX] In some cases, the half hours are not considered in intervals computation --- addons/resource/resource.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/resource/resource.py b/addons/resource/resource.py index ca31366ba40..dd96c15bce7 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -20,6 +20,7 @@ ############################################################################## import datetime +from datetime import timedelta from dateutil import rrule from dateutil.relativedelta import relativedelta from operator import itemgetter @@ -338,8 +339,8 @@ class resource_calendar(osv.osv): working_intervals = [] tz_info = fields.datetime.context_timestamp(cr, uid, work_dt, context=context).tzinfo for calendar_working_day in self.get_attendances_for_weekdays(cr, uid, id, [start_dt.weekday()], context): - x = work_dt.replace(hour=int(calendar_working_day.hour_from)) - y = work_dt.replace(hour=int(calendar_working_day.hour_to)) + x = work_dt.replace(hour=0, minute=0, second=0) + timedelta(seconds=(calendar_working_day.hour_from * 3600)) + y = work_dt.replace(hour=0, minute=0, second=0) + timedelta(seconds=(calendar_working_day.hour_to * 3600)) x = x.replace(tzinfo=tz_info).astimezone(pytz.UTC).replace(tzinfo=None) y = y.replace(tzinfo=tz_info).astimezone(pytz.UTC).replace(tzinfo=None) working_interval = (x, y) From b21773456c973c9dce8e2bae50892ff2059b684f Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 15 Feb 2016 13:47:40 +0100 Subject: [PATCH 4/7] [ADD] Add test with half hours to compute working hours. --- addons/resource/tests/test_resource.py | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/addons/resource/tests/test_resource.py b/addons/resource/tests/test_resource.py index fd6e27742a7..02e939c75b6 100644 --- a/addons/resource/tests/test_resource.py +++ b/addons/resource/tests/test_resource.py @@ -422,6 +422,35 @@ class TestResource(TestResourceCommon): default_interval=(8, 16), context=context) self.assertEqual(res, 32.0, 'resource_calendar: wrong get_working_hours computation') + self.att0_0_id = self.resource_attendance.create( + cr, uid, { + 'name': 'Att0', + 'dayofweek': '0', + 'hour_from': 7.5, + 'hour_to': 12.5, + 'calendar_id': self.calendar_id, + }, context=context + ) + self.att0_1_id = self.resource_attendance.create( + cr, uid, { + 'name': 'Att0', + 'dayofweek': '0', + 'hour_from': 13, + 'hour_to': 14, + 'calendar_id': self.calendar_id, + }, context=context + ) + date1 = datetime.strptime('2013-02-11 07:30:00', '%Y-%m-%d %H:%M:%S') + date2 = datetime.strptime('2013-02-11 14:00:00', '%Y-%m-%d %H:%M:%S') + res = self.resource_calendar.get_working_hours( + cr, uid, self.calendar_id, + date1, + date2, + compute_leaves=False, resource_id=self.resource1_id, context=context) + # 7h30 -> 12h30 = 5 / 13h -> 14h = 1 / -> 6h + self.assertEqual(res, 6, 'resource_calendar: wrong get_working_hours computation') + + def test_50_calendar_schedule_days(self): """ Testing calendar days scheduling """ cr, uid = self.cr, self.uid From eafebcb308a6214330479359ee00f460387df7d1 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 16 Feb 2016 17:41:59 +0100 Subject: [PATCH 5/7] [FIX] mrp: for the consume move lines, the expected date should also be the planned date of the production order It was like that for the date field, which is taken into account for the forecast quantity, but in the view the scheduled date field is shown. We put the scheduled date equal to the date. That way it is clear to the user when the products are foreseen to be consumed. --- addons/mrp/mrp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 099ae0fbacc..563e3a8d1c3 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1204,6 +1204,7 @@ class mrp_production(osv.osv): move_id = stock_move.create(cr, uid, { 'name': production.name, 'date': production.date_planned, + 'date_expected': production.date_planned, 'product_id': product.id, 'product_uom_qty': qty, 'product_uom': uom_id, From fab7902924d64ea1bbad8004b023287ac071f46d Mon Sep 17 00:00:00 2001 From: MORIN Fabien Date: Thu, 11 Feb 2016 14:07:32 +0100 Subject: [PATCH 6/7] [CLA] signature for fabienmorin Closes #10878 --- doc/cla/individual/fabienmorin.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/fabienmorin.md diff --git a/doc/cla/individual/fabienmorin.md b/doc/cla/individual/fabienmorin.md new file mode 100644 index 00000000000..3478578d9fc --- /dev/null +++ b/doc/cla/individual/fabienmorin.md @@ -0,0 +1,11 @@ +France, 2016-02-11 + +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, + +MORIN Fabien fabien.morin@gmail.com https://github.com/fabienmorin From 0f46e6a04c25b43c3e825bd15a0221bad0ad23e8 Mon Sep 17 00:00:00 2001 From: MORIN Fabien Date: Thu, 11 Feb 2016 13:44:15 +0100 Subject: [PATCH 7/7] [FIX] l10n_fr_hr_payroll: update plafond_secu to 2016 values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous amount was for 2011. New amount is 3218€ https://fr.wikipedia.org/wiki/Plafond_de_la_S%C3%A9curit%C3%A9_sociale#Historique_des_valeurs --- addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml index 1893d1f1824..d144de3b0e7 100644 --- a/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml +++ b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml @@ -21,7 +21,7 @@ - 2946 + 3218