mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] change for multiple statement line + change domain to fit the account cancel
This commit is contained in:
@@ -66,9 +66,12 @@ class AccountBankStatementLine(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def _is_account_cancel_installed(self):
|
def _is_account_cancel_installed(self):
|
||||||
ir_module = self.env['ir.module.module']
|
ir_module = self.env['ir.module.module']
|
||||||
account_cancel = ir_module.search([('name', '=', 'account_cancel'),
|
res_found_module = ir_module.search_count([
|
||||||
|
('name', '=', 'account_cancel'),
|
||||||
('state', '=', 'installed')])
|
('state', '=', 'installed')])
|
||||||
return bool(account_cancel)
|
if res_found_module:
|
||||||
|
for line in self:
|
||||||
|
line.account_cancel_installed = True
|
||||||
|
|
||||||
account_cancel_installed = fields.Boolean(
|
account_cancel_installed = fields.Boolean(
|
||||||
compute='_is_account_cancel_installed',
|
compute='_is_account_cancel_installed',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<xpath expr="//field[@name='bank_account_id']" position="after">
|
<xpath expr="//field[@name='bank_account_id']" position="after">
|
||||||
<field name="state" invisible="1"/>
|
<field name="state" invisible="1"/>
|
||||||
<field name='account_cancel_installed' invisible="1"/>
|
<field name='account_cancel_installed' invisible="1"/>
|
||||||
<button name="cancel" attrs="{'invisible': ['|', ('journal_entry_id', '=', False),('account_cancel_installed','=',True) ,('state', '=', 'confirm')]}" string="Cancel" type="object" icon="gtk-undo"/>
|
<button name="cancel" attrs="{'invisible': ['|', ('journal_entry_id', '=', False),('account_cancel_installed','=', True)]}" string="Cancel" type="object" icon="gtk-undo"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user