Tryton - Issues

 

Issue7897

Title Remove constraint of positive sign on analytic move lines
Priority bug Status resolved
Superseder Nosy List ced, ptarra, reviewbot, roundup-bot
Type behavior Components analytic_account
Assigned To ced Keywords easy, review
Reviews 60471002
View: 60471002

Created on 2018-11-30.16:18:06 by ptarra, last changed by roundup-bot.

Messages
New changeset 13216efc8fe9 by Cédric Krier in branch 'default':
Remove positive constraint on debit/credit
https://hg.tryton.org/tryton-env/rev/13216efc8fe9
New changeset 6c704c8bfdb6 by Cédric Krier in branch 'default':
Remove positive constraint on debit/credit
https://hg.tryton.org/modules/analytic_account/rev/6c704c8bfdb6
review60471002 updated at https://codereview.tryton.org/60471002/#ps1
msg45096 (view) Author: [hidden] (ptarra) Date: 2018-11-30.16:18:06
Analytic account move lines have a constraint so that negative values are not allowed. This constraint does not exist in account move lines so it might cause some inconsistencies between both. Apparently the constraint should have been removed in rev 0 but wasn't.

I was suggested to propose here the change ( https://discuss.tryton.org/t/rationale-behind-positive-sign-constraint-in-analytic-move-lines/917/4 ). I'm not an active developer of the project so excuse me for not posting a proper patch. Anyway here's what should be changed:

The __setup__ method of the Line class (line.py on module analytic_account) should replace this:

        cls._sql_constraints += [
            ('credit_debit',
                'CHECK((credit * debit = 0.0) AND (credit + debit >= 0.0))',
                'Wrong credit/debit values.'),

with this:

        cls._sql_constraints += [
            ('credit_debit',
                'CHECK((credit * debit = 0.0))',
                'Wrong credit/debit values.'),
History
Date User Action Args
2019-01-14 23:53:16roundup-botsetmessages: + msg45957
2019-01-14 23:53:11roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg45956
2019-01-04 23:43:54reviewbotsetnosy: + reviewbot
messages: + msg45847
2019-01-04 23:26:46cedsetstatus: unread -> testing
reviews: 60471002
nosy: + ced
keyword: + review
assignedto: ced
2018-11-30 16:45:13cedsetpriority: wish -> bug
type: behavior
2018-11-30 16:23:19pokolisetcomponent: + analytic_account
keyword: + easy
2018-11-30 16:18:06ptarracreate

Showing 10 items. Show all history (warning: this could be VERY long)