mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] account_statement_completion_label: account should be a required field and we only add the result if the partner_id is not empty.
This commit is contained in:
committed by
Sebastien Beau
parent
c44cc51f08
commit
7de1c3fa0c
@@ -105,7 +105,8 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
raise ErrorTooManyPartner(_('Line named "%s" (Ref:%s) was matched by '
|
raise ErrorTooManyPartner(_('Line named "%s" (Ref:%s) was matched by '
|
||||||
'more than one statement label.') %
|
'more than one statement label.') %
|
||||||
(st_line['name'], st_line['ref']))
|
(st_line['name'], st_line['ref']))
|
||||||
res['partner_id'] = label_info[0]['partner_id']
|
if label_info[0]['partner_id']:
|
||||||
|
res['partner_id'] = label_info[0]['partner_id']
|
||||||
res['account_id'] = label_info[0]['account_id']
|
res['account_id'] = label_info[0]['account_id']
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -122,6 +123,7 @@ class AccountStatementLabel(orm.Model):
|
|||||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||||
'label': fields.char('Bank Statement Label', size=100),
|
'label': fields.char('Bank Statement Label', size=100),
|
||||||
'account_id': fields.many2one('account.account', 'Account',
|
'account_id': fields.many2one('account.account', 'Account',
|
||||||
|
required = True,
|
||||||
help='Account corresponding to the label '
|
help='Account corresponding to the label '
|
||||||
'for a given partner'),
|
'for a given partner'),
|
||||||
'company_id': fields.many2one('res.company', 'Company'),
|
'company_id': fields.many2one('res.company', 'Company'),
|
||||||
|
|||||||
Reference in New Issue
Block a user