From 0d824501d25e454a0783bed724c2558beed412dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Apr 2013 12:26:37 +0200 Subject: [PATCH 01/12] Increase version number --- tryton.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton.cfg b/tryton.cfg index 83f64fdd09..5b8bba16b9 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=2.8.0 +version=2.8.1 depends: company currency From d125258998410528d3530d2f2f7cfa143fcda1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 4 May 2013 11:55:46 +0200 Subject: [PATCH 02/12] Fix Open Chart of Tax Codes when no fiscalyear is selected issue3202 (transplanted from a230e872a27cfbeb077f9f1470351011cc267160) --- tax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tax.py b/tax.py index 332cdd8f86..edc830d088 100644 --- a/tax.py +++ b/tax.py @@ -318,7 +318,8 @@ class OpenChartTaxCode(Wizard): def do_open_(self, action): if self.start.method == 'fiscalyear': action['pyson_context'] = PYSONEncoder().encode({ - 'fiscalyear': self.start.fiscalyear.id, + 'fiscalyear': (self.start.fiscalyear.id + if self.start.fiscalyear else None), }) if self.start.fiscalyear: action['name'] += ' - %s' % self.start.fiscalyear.rec_name From d7727ec0f4b7775b8df58c28f5f7d3c3dd964c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Jun 2013 22:52:22 +0200 Subject: [PATCH 03/12] Prepare release 2.8.1 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e19d8f002d..8224b4571c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 2.8.1 - 2013-06-09 +* Bug fixes (see mercurial logs for details) + Version 2.8.0 - 2013-04-22 * Bug fixes (see mercurial logs for details) * Make period's post_move_sequence optional and use fiscal year's one if empty From 2a14fd56debe87b6db5197e205e4088b723c3a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Jun 2013 22:52:23 +0200 Subject: [PATCH 04/12] Added tag 2.8.1 for changeset fe998a280516 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index deef2840d6..588f0fac04 100644 --- a/.hgtags +++ b/.hgtags @@ -8,3 +8,4 @@ a8c16bf00272129b9797a6efc12c9983420b2993 1.6.0 4eb06cd8e318992e19b19eba0858cff4a0dd4b3b 2.4.0 0cff8a0b9011ea4f9b8b75db0350013156a3c1ad 2.6.0 1f53b2073b99ca85ae3cfda949ad11e46d9a321a 2.8.0 +fe998a280516f8dfed826d5d407fd22702a06f4f 2.8.1 From 10d5ec287bc98bfada36946c530fc43ab0062c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Jun 2013 22:52:36 +0200 Subject: [PATCH 05/12] Increase version number --- tryton.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton.cfg b/tryton.cfg index 5b8bba16b9..e47ec541af 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=2.8.1 +version=2.8.2 depends: company currency From b50738c2c8e6e144c6f7d9f8d974351b2e9dcc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Jul 2013 13:15:45 +0200 Subject: [PATCH 06/12] Add missing migration to remove active field on move line review975003 (transplanted from 599d686c4cd2c223e4b3e1127357dac6036d3a59) --- move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index ed7cdefe63..c6381c811a 100644 --- a/move.py +++ b/move.py @@ -645,8 +645,10 @@ class Line(ModelSQL, ModelView): # Migration from 1.2 table.not_null_action('blocked', action='remove') - # Migration from 2.4: remove name + # Migration from 2.4: remove name, active table.not_null_action('name', action='remove') + table.not_null_action('active', action='remove') + table.index_action('active', action='remove') @classmethod def default_date(cls): From 12d6362540dbbbb165bf354907c8e6d56e3d605f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 8 Aug 2013 02:34:15 +0200 Subject: [PATCH 07/12] Fix domain concatenation between list and tuple (transplanted from a4a8b60d192f53fce094e81390736316f72a0089) --- account.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/account.py b/account.py index ccc21df044..9238cd0bfd 100644 --- a/account.py +++ b/account.py @@ -390,11 +390,11 @@ class AccountTemplate(ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): templates = cls.search([ - ('code',) + clause[1:], + ('code',) + tuple(clause[1:]), ], limit=1) if templates: - return [('code',) + clause[1:]] - return [(cls._rec_name,) + clause[1:]] + return [('code',) + tuple(clause[1:])] + return [(cls._rec_name,) + tuple(clause[1:])] def _get_account_value(self, account=None): ''' @@ -830,11 +830,11 @@ class Account(ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): accounts = cls.search([ - ('code',) + clause[1:], + ('code',) + tuple(clause[1:]), ], limit=1) if accounts: - return [('code',) + clause[1:]] - return [(cls._rec_name,) + clause[1:]] + return [('code',) + tuple(clause[1:])] + return [(cls._rec_name,) + tuple(clause[1:])] @classmethod def copy(cls, accounts, default=None): @@ -1001,8 +1001,8 @@ class AccountDeferral(ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): deferrals = cls.search(['OR', - ('account.rec_name',) + clause[1:], - ('fiscalyear.rec_name',) + clause[1:], + ('account.rec_name',) + tuple(clause[1:]), + ('fiscalyear.rec_name',) + tuple(clause[1:]), ]) return [('id', 'in', [d.id for d in deferrals])] From 40a678787dc5b9c4ebd59d6bb55f635df5356fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 Sep 2013 14:29:23 +0200 Subject: [PATCH 08/12] Fix domain concatenation between list and tuple (transplanted from 9be102d4bcd667f21a19430c36dc31c173fd4ffd) --- journal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/journal.py b/journal.py index 21d5c63d67..2d3f12bcb4 100644 --- a/journal.py +++ b/journal.py @@ -171,11 +171,11 @@ class Journal(ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): journals = cls.search([ - ('code',) + clause[1:], + ('code',) + tuple(clause[1:]), ], limit=1, order=[]) if journals: - return [('code',) + clause[1:]] - return [(cls._rec_name,) + clause[1:]] + return [('code',) + tuple(clause[1:])] + return [(cls._rec_name,) + tuple(clause[1:])] class JournalPeriod(ModelSQL, ModelView): From 53d7c6cab4ea2aa198f7cbbfe3552273b20403e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 1 Oct 2013 21:51:22 +0200 Subject: [PATCH 09/12] Prepare release 2.8.2 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8224b4571c..950ee18894 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 2.8.2 - 2013-10-01 +* Bug fixes (see mercurial logs for details) + Version 2.8.1 - 2013-06-09 * Bug fixes (see mercurial logs for details) From 6ce76d4f459fac3daf2bf443ca0a97f74fcaf0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 1 Oct 2013 21:51:23 +0200 Subject: [PATCH 10/12] Added tag 2.8.2 for changeset 014b85b6e893 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 588f0fac04..6390a9ac2a 100644 --- a/.hgtags +++ b/.hgtags @@ -9,3 +9,4 @@ a8c16bf00272129b9797a6efc12c9983420b2993 1.6.0 0cff8a0b9011ea4f9b8b75db0350013156a3c1ad 2.6.0 1f53b2073b99ca85ae3cfda949ad11e46d9a321a 2.8.0 fe998a280516f8dfed826d5d407fd22702a06f4f 2.8.1 +014b85b6e893505f1c18c17a68cbb2d7436198c3 2.8.2 From a6d2ea713fe1338d757fb84218ebe418d72bebb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 1 Oct 2013 21:51:42 +0200 Subject: [PATCH 11/12] Increase version number --- tryton.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton.cfg b/tryton.cfg index e47ec541af..a8552449cb 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=2.8.2 +version=2.8.3 depends: company currency From 8d9051d8ea668ed6820cb1eae9550c547ee6966e Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 11 Feb 2014 16:28:50 +0100 Subject: [PATCH 12/12] Fix update chart of accounts with changes on taxes or rule lines - invoice_account, credit_note_account, invoice_base_code, invoice_tax_code, credit_note_base_code and credit_note_tax_code where not properly compared when upgrading the chart of accounts. - Origin tax of rule_lines was updated with the value of the template, so it raised a domain validation error. issue3617 review2961002 (transplanted from def3be51ee2b7625c15c46351250ecb77d8f8f4b) --- tax.py | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/tax.py b/tax.py index edc830d088..49c2410917 100644 --- a/tax.py +++ b/tax.py @@ -767,48 +767,60 @@ class Tax(ModelSQL, ModelView): if self.template: vals = self.template._get_tax_value(tax=self) - if (self.template.invoice_account - and self.invoice_account.id != template2account.get( - self.template.invoice_account.id)): + invoice_account_id = (self.invoice_account.id + if self.invoice_account else None) + if (self.template.invoice_account and + invoice_account_id != template2account.get( + self.template.invoice_account.id)): vals['invoice_account'] = template2account.get( self.template.invoice_account.id) elif (not self.template.invoice_account and self.invoice_account): vals['invoice_account'] = None - if (self.template.credit_note_account - and self.credit_note_account.id != template2account.get( + credit_note_account_id = (self.credit_note_account.id + if self.credit_note_account else None) + if (self.template.credit_note_account and + credit_note_account_id != template2account.get( self.template.credit_note_account.id)): vals['credit_note_account'] = template2account.get( self.template.credit_note_account.id) elif (not self.template.credit_note_account and self.credit_note_account): vals['credit_note_account'] = None - if (self.template.invoice_base_code - and self.invoice_base_code.id != template2tax_code.get( - self.template.invoice_base_code.id)): + invoice_base_code_id = (self.invoice_base_code.id + if self.invoice_base_code else None) + if (self.template.invoice_base_code and + invoice_base_code_id != template2tax_code.get( + self.template.invoice_base_code.id)): vals['invoice_base_code'] = template2tax_code.get( self.template.invoice_base_code.id) elif (not self.template.invoice_base_code and self.invoice_base_code): vals['invoice_base_code'] = None + invoice_tax_code_id = (self.invoice_tax_code.id + if self.invoice_tax_code else None) if (self.template.invoice_tax_code - and self.invoice_tax_code.id != template2tax_code.get( + and invoice_tax_code_id != template2tax_code.get( self.template.invoice_tax_code.id)): vals['invoice_tax_code'] = template2tax_code.get( self.template.invoice_tax_code.id) elif (not self.template.invoice_tax_code and self.invoice_tax_code): vals['invoice_tax_code'] = None + credit_note_base_code_id = (self.credit_note_base_code.id + if self.credit_note_base_code else None) if (self.template.credit_note_base_code - and self.credit_note_base_code.id != template2tax_code.get( + and credit_note_base_code_id != template2tax_code.get( self.template.credit_note_base_code.id)): vals['credit_note_base_code'] = template2tax_code.get( self.template.credit_note_base_code.id) elif (not self.template.credit_note_base_code and self.credit_note_base_code): vals['credit_note_base_code'] = None + credit_note_tax_code_id = (self.credit_note_tax_code.id + if self.credit_note_tax_code else None) if (self.template.credit_note_tax_code - and self.credit_note_tax_code.id != template2tax_code.get( + and credit_note_tax_code_id != template2tax_code.get( self.template.credit_note_tax_code.id)): vals['credit_note_tax_code'] = template2tax_code.get( self.template.credit_note_tax_code.id) @@ -1079,8 +1091,6 @@ class TaxRuleLineTemplate(ModelSQL, ModelView): res = {} if not rule_line or rule_line.group != self.group: res['group'] = self.group.id if self.group else None - if not rule_line or rule_line.origin_tax != self.origin_tax: - res['origin_tax'] = self.origin_tax.id if self.origin_tax else None if not rule_line or rule_line.sequence != self.sequence: res['sequence'] = self.sequence if not rule_line or rule_line.template != self: @@ -1230,14 +1240,22 @@ class TaxRuleLine(ModelSQL, ModelView): vals['rule'] = template2rule[self.template.rule.id] if self.origin_tax: if self.template.origin_tax: - if self.origin_tax.id != \ - template2tax[self.template.origin_tax.id]: + if (self.origin_tax.id != + template2tax[self.template.origin_tax.id]): vals['origin_tax'] = template2tax[ self.template.origin_tax.id] + else: + vals['origin_tax'] = None + elif self.template.origin_tax: + vals['origin_tax'] = template2tax[self.template.origin_tax.id] if self.tax: if self.template.tax: if self.tax.id != template2tax[self.template.tax.id]: vals['tax'] = template2tax[self.template.tax.id] + else: + vals['tax'] = None + elif self.template.tax: + vals['tax'] = template2tax[self.template.tax.id] if vals: self.write([self], vals) template2rule_line[self.template.id] = self.id