minor fix
This commit is contained in:
parent
ec8da7b068
commit
66b0990391
|
@ -11,6 +11,7 @@ from . import product
|
|||
from . import voucher
|
||||
from . import purchase
|
||||
from . import ir
|
||||
from . import move
|
||||
|
||||
|
||||
def register():
|
||||
|
@ -35,6 +36,7 @@ def register():
|
|||
purchase.Purchase,
|
||||
purchase.Line,
|
||||
ir.Cron,
|
||||
move.Move,
|
||||
module='laboratory', type_='model')
|
||||
Pool.register(
|
||||
service_order.CreateInvoice,
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
from trytond.pool import PoolMeta
|
||||
from trytond.modules.analytic_co.exceptions import AnalyticError
|
||||
|
||||
|
||||
class Move(metaclass=PoolMeta):
|
||||
__name__ = 'account.move'
|
||||
|
||||
@classmethod
|
||||
def validate_move(cls, moves):
|
||||
super(Move, cls).validate_move(moves)
|
||||
for move in moves:
|
||||
if move.state != 'draft' and move.period.type != 'adjustment':
|
||||
for line in move.lines:
|
||||
if line.account and line.account.type.statement != 'balance' and \
|
||||
not line.analytic_lines and not line.account.code.startswith('4'):
|
||||
raise AnalyticError(
|
||||
gettext('analytic_co.msg_analytic_error',
|
||||
line=line.rec_name, account=line.account.rec_name)
|
||||
)
|
|
@ -6,6 +6,7 @@ depends:
|
|||
product
|
||||
sale
|
||||
company_operation
|
||||
analytic_co
|
||||
# log
|
||||
xml:
|
||||
laboratory.xml
|
||||
|
|
Loading…
Reference in New Issue