From 4a3801bc58a38551fba59c9830b68a582e4857c1 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 26 Oct 2017 11:10:13 +0200 Subject: [PATCH 1/3] [FIX] google_calendar: allow to use the function number_of_week for synchro get_param return string, but timedelta wait a integer --- addons/google_calendar/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 48950928199..39f4a075ba5 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -954,7 +954,7 @@ class google_calendar(osv.AbstractModel): def get_minTime(self, cr, uid, context=None): number_of_week = int(self.pool['ir.config_parameter'].get_param(cr, uid, 'calendar.week_synchro', default=13)) - return datetime.now() - timedelta(weeks=number_of_week) + return datetime.now() - timedelta(weeks=int(number_of_week)) def get_need_synchro_attendee(self, cr, uid, context=None): return self.pool['ir.config_parameter'].get_param(cr, uid, 'calendar.block_synchro_attendee', default=True) From b80b13a572e478192e09715b68cdbe0404b196ee Mon Sep 17 00:00:00 2001 From: Pierre Rousseau Date: Thu, 26 Oct 2017 10:22:21 +0200 Subject: [PATCH 2/3] [FIX] l10n_fr_fec: change EcritureNum opw-777652 --- addons/l10n_fr_fec/wizard/fec.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/l10n_fr_fec/wizard/fec.py b/addons/l10n_fr_fec/wizard/fec.py index 1b1ddf20e9b..d56762b537c 100644 --- a/addons/l10n_fr_fec/wizard/fec.py +++ b/addons/l10n_fr_fec/wizard/fec.py @@ -5,6 +5,8 @@ from openerp import models, fields, api, _ from openerp.exceptions import Warning +from datetime import datetime +from openerp.tools import DEFAULT_SERVER_DATE_FORMAT import base64 import StringIO import csv @@ -32,7 +34,7 @@ class AccountFrFec(models.TransientModel): SELECT 'OUV' AS JournalCode, 'Balance initiale' AS JournalLib, - 'Balance initiale PL' AS EcritureNum, + 'OUVERTURE/' || %s AS EcritureNum, %s AS EcritureDate, '120/129' AS CompteNum, 'Benefice (perte) reporte(e)' AS CompteLib, @@ -66,8 +68,10 @@ class AccountFrFec(models.TransientModel): ''' company = self.env.user.company_id formatted_date_from = self.date_from.replace('-', '') + date_from = datetime.strptime(self.date_from, DEFAULT_SERVER_DATE_FORMAT) + formatted_date_year = date_from.year self._cr.execute( - sql_query, (formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id)) + sql_query, (formatted_date_year, formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id)) listrow = [] row = self._cr.fetchone() listrow = list(row) @@ -129,7 +133,7 @@ class AccountFrFec(models.TransientModel): SELECT 'OUV' AS JournalCode, 'Balance initiale' AS JournalLib, - 'Balance initiale ' || MIN(aa.name) AS EcritureNum, + 'OUVERTURE/' || %s AS EcritureNum, %s AS EcritureDate, MIN(aa.code) AS CompteNum, replace(MIN(aa.name), '|', '/') AS CompteLib, @@ -169,8 +173,10 @@ class AccountFrFec(models.TransientModel): HAVING sum(aml.balance) != 0 ''' formatted_date_from = self.date_from.replace('-', '') + date_from = datetime.strptime(self.date_from, DEFAULT_SERVER_DATE_FORMAT) + formatted_date_year = date_from.year self._cr.execute( - sql_query, (formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id)) + sql_query, (formatted_date_year, formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id)) for row in self._cr.fetchall(): listrow = list(row) From ab9b5a13e4a610ae74a633e989620d5c3da240be Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 26 Oct 2017 17:23:14 +0200 Subject: [PATCH 3/3] [FIX] l10n_ca: default stock input account for products categories Since Odoo 8.0, the default stock input account for product categories in the Canadian localization is set to `214100 CANADA REVENUE AGENCY` This is the case since this commit: https://github.com/odoo/odoo/commit/13dacd11c10dac853def763432829b8976604a7d#diff-2e65e26a4efc4ab95e72dbe2033141ecL294 In which the account with the XML ID 2141_en 214100 Stock Received But Not Billed has been renamed 214100 CANADA REVENUE AGENCY In this very same commit, the account "Stock Received But Not Billed" has been moved to the account 217100, under the XML ID chart2171_en: https://github.com/odoo/odoo/commit/13dacd11c10dac853def763432829b8976604a7d#diff-2e65e26a4efc4ab95e72dbe2033141ecR447 While the default value for the products categories stock input account remained the same, the account with as code 2141: https://github.com/odoo/odoo/blob/8.0/addons/l10n_ca/account_chart_template_en.xml#L8 This is an oversight. It was not meant that way. The default stock input account for products should well be "Stock Received But Not Billed". In addition, a stock account is supposed to be of type assets, and not of type liabilities. I contacted @max3903, who was a contributor of the l10n_ca localization, and who is therefore a better expert than me regarding the Canadian localization. He confirmed me all the above findings. opw-775413 --- addons/l10n_ca/account_chart.xml | 2 +- addons/l10n_ca/account_chart_template_after.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_ca/account_chart.xml b/addons/l10n_ca/account_chart.xml index 0a463374290..8610079a78f 100644 --- a/addons/l10n_ca/account_chart.xml +++ b/addons/l10n_ca/account_chart.xml @@ -217,7 +217,7 @@ 2171 - + Stock Received But Not Billed diff --git a/addons/l10n_ca/account_chart_template_after.xml b/addons/l10n_ca/account_chart_template_after.xml index ccf130b9f0e..815fcea8b59 100644 --- a/addons/l10n_ca/account_chart_template_after.xml +++ b/addons/l10n_ca/account_chart_template_after.xml @@ -9,7 +9,7 @@ - +