minor fix
This commit is contained in:
parent
7077e395bb
commit
66bc8cf3af
|
@ -9,6 +9,8 @@ from trytond.wizard import Wizard, StateView, Button, StateAction, StateReport
|
|||
from trytond.report import Report
|
||||
from decimal import Decimal
|
||||
import copy
|
||||
from .exceptions import ProcedureError
|
||||
from trytond.i18n import gettext
|
||||
|
||||
_STATES = {
|
||||
'readonly': Eval('state') == 'done',
|
||||
|
@ -732,6 +734,8 @@ class PortfolioStatusReport(Report):
|
|||
], fields_names=['accounts'])
|
||||
for procedure in procedures:
|
||||
accounts.extend(list(procedure['accounts']))
|
||||
if not accounts:
|
||||
raise ProcedureError(gettext('collection.msg_missing_account_procedure'))
|
||||
dom_invoices.append(['account', 'in', accounts])
|
||||
order = [('party.name', 'DESC'), ('invoice_date', 'ASC')]
|
||||
invoices = Invoice.search(dom_invoices, order=order)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.exceptions import UserError, UserWarning
|
||||
from trytond.model.exceptions import ValidationError
|
||||
|
||||
|
||||
class ProcedureError(UserError):
|
||||
pass
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data grouped="1">
|
||||
<record model="ir.message" id="msg_missing_account_procedure">
|
||||
<field name="text">Missing the configuration accounts in procedure selected.</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</tryton>
|
|
@ -10,3 +10,4 @@ depends:
|
|||
xml:
|
||||
collection.xml
|
||||
configuration.xml
|
||||
message.xml
|
||||
|
|
Loading…
Reference in New Issue