rename ui_designation to transaction_rights

This commit is contained in:
Luc De Meyer 2023-06-25 17:04:49 +02:00
parent ce6d3da66c
commit 739a0b202a
4 changed files with 10 additions and 9 deletions

View File

@ -84,16 +84,17 @@ class EbicsUserID(models.Model):
"This default can be overriden for specific "
"EBICS transactions (cf. File Formats).",
)
ui_designation = fields.Selection(
[
transaction_rights = fields.Selection(
selection=[
("both", "Download and Upload"),
("down", "Download Only"),
("up", "Upload Only"),
],
string="UI Designation",
string="Allowed Transactions",
default="both",
required=True,
help="Defines in what form this User will be available for selection.",
help="Use this parameter to limit the transactions for this User "
"to downloads or uploads.",
)
ebics_keys_fn = fields.Char(compute="_compute_ebics_keys_fn")
ebics_keys_found = fields.Boolean(compute="_compute_ebics_keys_found")

View File

@ -94,8 +94,8 @@
attrs="{'required': [('ebics_passphrase_store', '=', True)], 'invisible': [('state', '!=', 'draft')]}"
/>
<field name="ebics_passphrase_store" />
<field name="transaction_rights" />
<field name="active" />
<field name="ui_designation" />
</group>
<group name="main-right">
<field name="signature_class" />

View File

@ -122,14 +122,14 @@ class EbicsXfer(models.TransientModel):
lambda r: r.type == "down"
)
avail_userids = avail_userids.filtered(
lambda r: r.ui_designation in ["both", 'down']
lambda r: r.transaction_rights in ["both", "down"]
)
else: # Upload Form
avail_formats = self.ebics_config_id.ebics_file_format_ids.filtered(
lambda r: r.type == "up"
)
avail_userids = avail_userids.filtered(
lambda r: r.ui_designation in ["both", "up"]
lambda r: r.transaction_rights in ["both", "up"]
)
if avail_formats and len(avail_formats) == 1:

View File

@ -16,7 +16,7 @@
/>
<field
name="ebics_userid_id"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('ui_designation', 'in', ['both', 'down'])]"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'down'])]"
required="1"
options="{'no_create': True, 'no_open': True}"
/>
@ -69,7 +69,7 @@
/>
<field
name="ebics_userid_id"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('ui_designation', 'in', ['both', 'up'])]"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'up'])]"
required="1"
options="{'no_create': True, 'no_open': True}"
/>