From 99a7b0d150651b1aecf938a006f9adf6b3a489d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 18 Nov 2008 18:05:59 +0100 Subject: [PATCH 01/62] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index bd3a2a4446..fbe9cc5113 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -5,7 +5,7 @@ 'name_de_DE': 'Buchhaltung', 'name_fr_FR': 'Comptabilité', 'name_es_ES': 'Contabilidad', - 'version': '1.0.0', + 'version': '1.0.1', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 99fec158a4872275bcf851b33dfdc83ceca5e7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 18 Nov 2008 18:07:00 +0100 Subject: [PATCH 02/62] Allow egg installation --- CHANGELOG | 2 ++ setup.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index eacaaefa7d..44de11f380 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,4 @@ +* Allow egg installation + Version 1.0.0 - 2008-11-17 * Initial release diff --git a/setup.py b/setup.py index e1b28c1000..bbaa7b162b 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,8 @@ setup(name='trytond_account', author=info.get('author', ''), author_email=info.get('email', ''), url=info.get('website', ''), + download_url="http://downloads.tryton.org/" + \ + info.get('version', '0.0.1').rsplit('.', 1)[0] + '/', package_dir={'trytond.modules.account': '.'}, packages=[ 'trytond.modules.account', @@ -56,4 +58,9 @@ setup(name='trytond_account', ], license='GPL-3', install_requires=requires, + zip_safe=False, + entry_points=""" + [trytond.modules] + account = trytond.modules.account + """, ) From 358b10dda2a87845fdf1ecf0ac8ec40d80879105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 20 Nov 2008 19:35:06 +0100 Subject: [PATCH 03/62] Add update_account_taxes when creating account chart from template --- account.py | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index f4df7752e4..49553f7bc2 100644 --- a/account.py +++ b/account.py @@ -326,7 +326,6 @@ class AccountTemplate(OSV): res['kind'] = template.kind res['reconcile'] = template.reconcile res['deferral'] = template.deferral - res['taxes'] = [('add', x.id) for x in template.taxes] return res def create_account(self, cursor, user, template, company_id, context=None, @@ -380,6 +379,47 @@ class AccountTemplate(OSV): template2type=template2type, parent_id=new_id)) return new_id + def update_account_taxes(self, cursor, user, template, template2account, + template2tax, context=None, template_done=None): + ''' + Update recursively account taxes based on template. + + :param cursor: the database cursor + :param user: the user id + :param template: the template id or the BrowseRecord of template + used for account creation + :param template2account: a dictionary with template id as key + and account id as value, used to convert template id into + account. + :param template2tax: a dictionary with tax template id as key + and tax id as value, used to convert tax template id into + tax. + :param context: the context + :param template_done: a list of template id already updated. + The list is filled. + ''' + account_obj = self.pool.get('account.account') + + if template2account is None: + template2account = {} + if template2tax is None: + template2tax = {} + if template_done is None: + template_done = [] + + if isinstance(template, (int, long)): + template = self.browse(cursor, user, template, context=context) + + if template.id not in template_done: + account_obj.write(cursor, user, template2account[template.id], { + 'taxes': [('add', template2tax[x.id]) for x in template.taxes], + }, context=context) + template_done.append(template.id) + + for child in template.childs: + self.update_account_taxes(cursor, user, child, template2account, + template2tax, context=context, template_done=template_done) + AccountTemplate() @@ -1570,6 +1610,9 @@ class CreateChartAccount(Wizard): template2account=template2account, context=context, template2tax=template2tax) + account_template_obj.update_account_taxes(cursor, user, + account_template, template2account, template2tax, context=context) + return {'company': datas['form']['company']} def _action_create_properties(self, cursor, user, datas, context=None): From b845799d2120d734146098d956937483de62df38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 22 Nov 2008 14:53:02 +0100 Subject: [PATCH 04/62] Fix period name for issue600 --- fiscalyear.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fiscalyear.py b/fiscalyear.py index 2c37fd61a7..e9f52cae6f 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -136,9 +136,11 @@ class FiscalYear(OSV): mx.DateTime.RelativeDateTime(days=1) if period_end_date > end_date: period_end_date = end_date + name = period_start_date.strftime('%Y-%m') + if name != period_end_date.strftime('%Y-%m'): + name += ' - ' + period_end_date.strftime('%Y-%m') period_obj.create(cursor, user, { - 'name': period_start_date.strftime('%Y-%m') + ' - ' + \ - period_end_date.strftime('%Y-%m'), + 'name': name, 'start_date': period_start_date.strftime('%Y-%m-%d'), 'end_date': period_end_date.strftime('%Y-%m-%d'), 'fiscalyear': fiscalyear.id, From 1f29fa5c1cf6e1fdc3a669166dd2e440208726a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Nov 2008 12:44:53 +0100 Subject: [PATCH 05/62] Handle default value for sequence with context for issue609 --- fiscalyear.py | 6 ++++-- period.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fiscalyear.py b/fiscalyear.py index e9f52cae6f..496c0b1365 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -1,4 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. +#This file is part of Tryton. The COPYRIGHT file at the top level of +#this repository contains the full copyright notices and license terms. 'Fiscal Year' from trytond.osv import fields, OSV @@ -26,7 +27,8 @@ class FiscalYear(OSV): ('close', 'Close'), ], 'State', readonly=True, required=True) post_move_sequence = fields.Many2One('ir.sequence', 'Post Move Sequence', - required=True, domain="[('code', '=', 'account.move')]") + required=True, domain="[('code', '=', 'account.move')]", + context="{'code': 'account.move', 'company': company}") company = fields.Many2One('company.company', 'Company', required=True) def __init__(self): diff --git a/period.py b/period.py index 7c258df411..8c6d0958c6 100644 --- a/period.py +++ b/period.py @@ -1,4 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. +#This file is part of Tryton. The COPYRIGHT file at the top level of +#this repository contains the full copyright notices and license terms. 'Period' from trytond.osv import fields, OSV @@ -27,7 +28,8 @@ class Period(OSV): ('close', 'Close'), ], 'State', readonly=True, required=True) post_move_sequence =fields.Many2One('ir.sequence', 'Post Move Sequence', - required=True, domain="[('code', '=', 'account.move')]") + required=True, domain="[('code', '=', 'account.move')]", + context="{'code': 'account.move'}") type = fields.Selection([ ('standard', 'Standard'), ('adjustment', 'Adjustment'), From 8a38a6afa19f9f3e6a9ba7287042992a53923b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Nov 2008 17:51:17 +0100 Subject: [PATCH 06/62] Filter account view in General Ledger for issue615 --- account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account.py b/account.py index 49553f7bc2..ae900b708f 100644 --- a/account.py +++ b/account.py @@ -1042,6 +1042,7 @@ class GeneralLegder(Report): account_ids = account_obj.search(cursor, user, [ ('company', '=', datas['form']['company']), + ('kind', '!=', 'view'), ], order=[('code', 'ASC'), ('id', 'ASC')], context=context) start_period_ids = [0] From e5cd10474d6a175915647a9fa8a3f5d2213788bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Nov 2008 17:51:46 +0100 Subject: [PATCH 07/62] Filter account on compye for Trial Balance --- account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account.py b/account.py index ae900b708f..9715b6e30b 100644 --- a/account.py +++ b/account.py @@ -1230,6 +1230,7 @@ class TrialBalance(Report): datas['form']['company'], context=context) account_ids = account_obj.search(cursor, user, [ + ('company', '=', datas['form']['company']), ('kind', '!=', 'view'), ], context=context) From 437daf9173c706a123008362f09bb1f4d8604cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 1 Dec 2008 09:52:43 +0100 Subject: [PATCH 08/62] Don't use widget selection for type of account as type name is not unique --- account.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account.xml b/account.xml index 7e75e86b3f..18f12a8350 100644 --- a/account.xml +++ b/account.xml @@ -285,7 +285,7 @@ this repository contains the full copyright notices and license terms. -->