Tryton - Issues

 

Issue7897

Title Remove constraint of positive sign on analytic move lines
Priority bug Status unread
Superseder Nosy List ptarra
Type behavior Components analytic_account
Assigned To Keywords easy
Reviews

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

Messages
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
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)