Permit to use deposit account for payment
97281a746606 removed this option that was available since 3255a31c30a2. Closes #12910 (grafted from b835e9473ea18bfcc8aa10b58bca7edb544e0a88) --HG-- branch : 7.0
This commit is contained in:
@@ -20,3 +20,7 @@ def register():
|
||||
invoice.DepositRecall,
|
||||
party.Erase,
|
||||
module='account_deposit', type_='wizard')
|
||||
Pool.register(
|
||||
account.Payment,
|
||||
module='account_deposit', type_='model',
|
||||
depends=['account_payment_clearing'])
|
||||
|
||||
@@ -51,3 +51,14 @@ class Reconcile(metaclass=PoolMeta):
|
||||
_balanced = True
|
||||
return super().get_currencies(
|
||||
account, party, currency=None, _balanced=_balanced)
|
||||
|
||||
|
||||
class Payment(metaclass=PoolMeta):
|
||||
__name__ = 'account.payment'
|
||||
|
||||
@classmethod
|
||||
def _account_type_domain(cls):
|
||||
return ['OR',
|
||||
super()._account_type_domain(),
|
||||
('type.deposit', '=', True),
|
||||
]
|
||||
|
||||
@@ -47,7 +47,10 @@ for dep in info.get('depends', []):
|
||||
requires.append(get_require_version('trytond_%s' % dep))
|
||||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = [get_require_version('proteus')]
|
||||
tests_require = [
|
||||
get_require_version('proteus'),
|
||||
get_require_version('trytond_account_payment_clearing'),
|
||||
]
|
||||
|
||||
setup(name=name,
|
||||
version=version,
|
||||
|
||||
@@ -10,6 +10,7 @@ class AccountDepositTestCase(
|
||||
PartyCompanyCheckEraseMixin, CompanyTestMixin, ModuleTestCase):
|
||||
'Test Account Deposit module'
|
||||
module = 'account_deposit'
|
||||
extras = ['account_payment_clearing']
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
|
||||
@@ -7,6 +7,8 @@ depends:
|
||||
ir
|
||||
party
|
||||
res
|
||||
extras_depend:
|
||||
account_payment_clearing
|
||||
xml:
|
||||
account.xml
|
||||
invoice.xml
|
||||
|
||||
@@ -116,10 +116,6 @@ class Payment(metaclass=PoolMeta):
|
||||
domain=[
|
||||
('closed', '!=', True),
|
||||
('company', '=', Eval('company', -1)),
|
||||
If(Eval('kind') == 'receivable',
|
||||
('type.receivable', '=', True),
|
||||
('type.payable', '=', True),
|
||||
),
|
||||
['OR',
|
||||
('second_currency', '=', Eval('currency', None)),
|
||||
[
|
||||
@@ -176,6 +172,17 @@ class Payment(metaclass=PoolMeta):
|
||||
cls._buttons.update({
|
||||
'succeed_wizard': cls._buttons['succeed'],
|
||||
})
|
||||
cls.account.domain = [
|
||||
cls.account.domain,
|
||||
cls._account_type_domain(),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def _account_type_domain(cls):
|
||||
return If(Eval('kind') == 'receivable',
|
||||
('type.receivable', '=', True),
|
||||
('type.payable', '=', True),
|
||||
)
|
||||
|
||||
@fields.depends('party', 'kind', 'date')
|
||||
def on_change_party(self):
|
||||
|
||||
Reference in New Issue
Block a user