From dfdad2735f1bbb868eed9b0964e52665afe5cd33 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] 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 adcb31e81f..c25304a21f 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 @@ -28,7 +29,8 @@ class FiscalYear(OSV): post_move_sequence = fields.Many2One('ir.sequence', 'Post Move Sequence', required=True, domain="[('code', '=', 'account.move')," \ "['OR', ('company', '=', company)," \ - "('company', '=', False)]]") + "('company', '=', False)]]", + 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 4939847534..0fa153fcf5 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'),