mirror of
https://github.com/NaN-tic/trytond-analytic_line_state.git
synced 2023-12-14 03:33:02 +01:00
Add 'state' treatment in AnalyticLine.query_get()
This commit is contained in:
parent
f133fdb2cc
commit
f6181c7808
11
analytic.py
11
analytic.py
|
@ -283,6 +283,17 @@ class AnalyticLine:
|
|||
return self.currency.digits
|
||||
return 2
|
||||
|
||||
@classmethod
|
||||
def query_get(cls, table):
|
||||
'''
|
||||
Return SQL clause for analytic line depending of the context.
|
||||
table is the SQL instance of the analytic_account_line table.
|
||||
'''
|
||||
clause = super(AnalyticLine, cls).query_get(table)
|
||||
if Transaction().context.get('posted'):
|
||||
clause &= table.state == 'posted'
|
||||
return clause
|
||||
|
||||
@classmethod
|
||||
def validate(cls, lines):
|
||||
super(AnalyticLine, cls).validate(lines)
|
||||
|
|
Loading…
Reference in a new issue