mirror of
https://github.com/brain-tec/account_ebics.git
synced 2025-04-11 13:12:24 +00:00
[IMP]EBICS File Format on Payment Mode
This commit is contained in:
parent
49158f34a0
commit
e9be5e48e9
@ -141,21 +141,26 @@ class EbicsXfer(models.TransientModel):
|
|||||||
avail_formats = self.ebics_config_id.ebics_file_format_ids.filtered(
|
avail_formats = self.ebics_config_id.ebics_file_format_ids.filtered(
|
||||||
lambda r: r.type == "down"
|
lambda r: r.type == "down"
|
||||||
)
|
)
|
||||||
|
if avail_formats and len(avail_formats) == 1:
|
||||||
|
self.format_id = avail_formats
|
||||||
|
else:
|
||||||
|
self.format_id = False
|
||||||
avail_userids = avail_userids.filtered(
|
avail_userids = avail_userids.filtered(
|
||||||
lambda r: r.transaction_rights in ["both", "down"]
|
lambda r: r.transaction_rights in ["both", "down"]
|
||||||
)
|
)
|
||||||
else: # Upload Form
|
else: # Upload Form
|
||||||
avail_formats = self.ebics_config_id.ebics_file_format_ids.filtered(
|
if not self.env.context.get("active_model") == "account.payment.order":
|
||||||
lambda r: r.type == "up"
|
avail_formats = self.ebics_config_id.ebics_file_format_ids.filtered(
|
||||||
)
|
lambda r: r.type == "up"
|
||||||
|
)
|
||||||
|
if avail_formats and len(avail_formats) == 1:
|
||||||
|
self.format_id = avail_formats
|
||||||
|
else:
|
||||||
|
self.format_id = False
|
||||||
avail_userids = avail_userids.filtered(
|
avail_userids = avail_userids.filtered(
|
||||||
lambda r: r.transaction_rights in ["both", "up"]
|
lambda r: r.transaction_rights in ["both", "up"]
|
||||||
)
|
)
|
||||||
|
|
||||||
if avail_formats and len(avail_formats) == 1:
|
|
||||||
self.format_id = avail_formats
|
|
||||||
else:
|
|
||||||
self.format_id = False
|
|
||||||
if avail_userids:
|
if avail_userids:
|
||||||
if len(avail_userids) == 1:
|
if len(avail_userids) == 1:
|
||||||
self.ebics_userid_id = avail_userids
|
self.ebics_userid_id = avail_userids
|
||||||
@ -170,6 +175,8 @@ class EbicsXfer(models.TransientModel):
|
|||||||
|
|
||||||
@api.onchange("upload_data")
|
@api.onchange("upload_data")
|
||||||
def _onchange_upload_data(self):
|
def _onchange_upload_data(self):
|
||||||
|
if self.env.context.get("active_model") == "account.payment.order":
|
||||||
|
return
|
||||||
self.upload_fname_dummy = self.upload_fname
|
self.upload_fname_dummy = self.upload_fname
|
||||||
self.format_id = False
|
self.format_id = False
|
||||||
self._detect_upload_format()
|
self._detect_upload_format()
|
||||||
@ -187,10 +194,6 @@ class EbicsXfer(models.TransientModel):
|
|||||||
if len(upload_formats) == 1:
|
if len(upload_formats) == 1:
|
||||||
self.format_id = upload_formats
|
self.format_id = upload_formats
|
||||||
|
|
||||||
@api.onchange("format_id")
|
|
||||||
def _onchange_format_id(self):
|
|
||||||
self.order_type = self.format_id.order_type
|
|
||||||
|
|
||||||
def ebics_upload(self):
|
def ebics_upload(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
ctx = self._context.copy()
|
ctx = self._context.copy()
|
||||||
|
@ -94,8 +94,9 @@
|
|||||||
<field name="upload_format_ids" invisible="1" />
|
<field name="upload_format_ids" invisible="1" />
|
||||||
<field
|
<field
|
||||||
name="format_id"
|
name="format_id"
|
||||||
domain="[('id', 'in', upload_format_ids)]"
|
|
||||||
required="1"
|
required="1"
|
||||||
|
domain="[('type', '=', 'up'), ('id', 'in', allowed_format_ids)]"
|
||||||
|
readonly="context.get('active_model') == 'account.payment.order'"
|
||||||
/>
|
/>
|
||||||
<field name="order_type" />
|
<field name="order_type" />
|
||||||
<field name="test_mode" invisible="order_type not in ('FUL', 'BTU')" />
|
<field name="test_mode" invisible="order_type not in ('FUL', 'BTU')" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user