[13.0][MIGRATE] migrate module account_ebics.

This commit is contained in:
phanupong 2020-05-29 09:24:49 +07:00 committed by Luc De Meyer
parent 28cb01670c
commit 6773222e03
9 changed files with 9 additions and 41 deletions

View File

@ -3,7 +3,7 @@
{
'name': 'EBICS banking protocol',
'version': '12.0.1.0.1',
'version': '13.0.1.0.1',
'license': 'LGPL-3',
'author': 'Noviat',
'category': 'Accounting & Finance',
@ -21,4 +21,5 @@
],
'installable': True,
'application': True,
'external_dependencies': {'python': ['fintech', ]},
}

View File

@ -1,13 +1,6 @@
# Copyright 2009-2019 Noviat.
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
"""
import logging
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s] %(levelname)s - %(name)s: %(message)s')
"""
import base64
import logging
import re
@ -222,14 +215,12 @@ class EbicsConfig(models.Model):
self._cr.dbname,
'mykeys'])
@api.multi
@api.depends('ebics_keys')
def _compute_ebics_keys_found(self):
for cfg in self:
cfg.ebics_keys_found = (
cfg.ebics_keys and os.path.isfile(cfg.ebics_keys))
@api.multi
@api.constrains('order_number')
def _check_order_number(self):
for cfg in self:
@ -247,7 +238,6 @@ class EbicsConfig(models.Model):
"Order Number should comply with the following pattern:"
"\n[A-Z]{1}[A-Z0-9]{3}"))
@api.multi
def unlink(self):
for ebics_config in self:
if ebics_config.state == 'active':
@ -255,19 +245,15 @@ class EbicsConfig(models.Model):
"You cannot remove active EBICS congirations."))
return super(EbicsConfig, self).unlink()
@api.multi
def set_to_draft(self):
return self.write({'state': 'draft'})
@api.multi
def set_to_get_bank_keys(self):
return self.write({'state': 'get_bank_keys'})
@api.multi
def set_to_active(self):
return self.write({'state': 'active'})
@api.multi
def ebics_init_1(self):
"""
Initialization of bank keys - Step 1:
@ -387,7 +373,6 @@ class EbicsConfig(models.Model):
return self.write({'state': 'init'})
@api.multi
def ebics_init_2(self):
"""
Initialization of bank keys - Step 2:
@ -399,7 +384,6 @@ class EbicsConfig(models.Model):
self.ensure_one()
return self.write({'state': 'get_bank_keys'})
@api.multi
def ebics_init_3(self):
"""
Initialization of bank keys - Step 3:
@ -437,7 +421,6 @@ class EbicsConfig(models.Model):
return True
@api.multi
def ebics_init_4(self):
"""
Initialization of bank keys - Step 2:
@ -456,7 +439,6 @@ class EbicsConfig(models.Model):
bank.activate_keys()
return self.write({'state': 'active'})
@api.multi
def change_passphrase(self):
self.ensure_one()
ctx = dict(self._context, default_ebics_config_id=self.id)

View File

@ -66,7 +66,6 @@ class EbicsFile(models.Model):
"""
return self.env.user.company_id
@api.multi
def unlink(self):
ff_methods = self._file_format_methods()
for ebics_file in self:
@ -82,15 +81,12 @@ class EbicsFile(models.Model):
ebics_file.bank_statement_ids.unlink()
return super(EbicsFile, self).unlink()
@api.multi
def set_to_draft(self):
return self.write({'state': 'draft'})
@api.multi
def set_to_done(self):
return self.write({'state': 'done'})
@api.multi
def process(self):
self.ensure_one()
self.note_process = ''
@ -104,7 +100,6 @@ class EbicsFile(models.Model):
else:
return self._process_undefined_format()
@api.multi
def action_open_bank_statements(self):
self.ensure_one()
action = self.env['ir.actions.act_window'].for_xml_id(
@ -114,7 +109,6 @@ class EbicsFile(models.Model):
action.update({'domain': domain})
return action
@api.multi
def button_close(self):
self.ensure_one()
return {'type': 'ir.actions.act_window_close'}

View File

@ -5,7 +5,7 @@
<field name="name">ebics.config.tree</field>
<field name="model">ebics.config</field>
<field name="arch" type="xml">
<tree string="EBICS Configuration" colors="blue:state!='active'">
<tree string="EBICS Configuration" decoration-muted="state!='active'">
<field name="name"/>
<field name="bank_id"/>
<field name="ebics_host"/>
@ -113,7 +113,7 @@
<record id="ebics_config_action" model="ir.actions.act_window">
<field name="name">EBICS Configuration</field>
<field name="res_model">ebics.config</field>
<field name="view_type">form</field>
<!-- <field name="view_type">form</field> -->
<field name="view_mode">tree,form</field>
</record>

View File

@ -36,7 +36,7 @@
<field name="name">ebics.file.tree</field>
<field name="model">ebics.file</field>
<field name="arch" type="xml">
<tree string="EBICS Files" colors="blue:state=='draft'" create="false">
<tree string="EBICS Files" decoration-muted="state=='draft'" create="false">
<field name="date" string="Download Date"/>
<field name="name"/>
<field name="date_from"/>
@ -111,7 +111,6 @@
<field name="name">EBICS Download Files</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.file</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
<field name="domain">[('type','=','down')]</field>
@ -144,7 +143,7 @@
<field name="name">ebics.file.tree</field>
<field name="model">ebics.file</field>
<field name="arch" type="xml">
<tree string="EBICS Files" colors="blue:state=='draft'" create="false">
<tree string="EBICS Files" decoration-muted="state=='draft'" create="false">
<field name="date" string="Upload Date"/>
<field name="name"/>
<field name="user_id"/>
@ -187,7 +186,6 @@
<field name="name">EBICS Upload Files</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.file</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
<field name="domain">[('type','=','up')]</field>

View File

@ -36,7 +36,7 @@
<record id="ebics_file_format_action" model="ir.actions.act_window">
<field name="name">EBICS File Formats</field>
<field name="res_model">ebics.file.format</field>
<field name="view_type">form</field>
<!-- <field name="view_type">form</field> -->
<field name="view_mode">tree,form</field>
</record>

View File

@ -35,7 +35,6 @@ class EbicsChangePassphrase(models.TransientModel):
required=True)
note = fields.Text(string='Notes', readonly=True)
@api.multi
def change_passphrase(self):
self.ensure_one()
if self.old_pass != self.ebics_config_id.ebics_passphrase:
@ -71,7 +70,6 @@ class EbicsChangePassphrase(models.TransientModel):
'type': 'ir.actions.act_window',
}
@api.multi
def button_close(self):
self.ensure_one()
return {'type': 'ir.actions.act_window_close'}

View File

@ -125,7 +125,6 @@ class EbicsXfer(models.TransientModel):
def _onchange_format_id(self):
self.order_type = self.format_id.order_type
@api.multi
def ebics_upload(self):
self.ensure_one()
ctx = self._context.copy()
@ -147,7 +146,6 @@ class EbicsXfer(models.TransientModel):
'type': 'ir.actions.act_window',
}
@api.multi
def ebics_download(self):
self.ensure_one()
self.ebics_config_id._check_ebics_files()
@ -238,12 +236,10 @@ class EbicsXfer(models.TransientModel):
'type': 'ir.actions.act_window',
}
@api.multi
def button_close(self):
self.ensure_one()
return {'type': 'ir.actions.act_window_close'}
@api.multi
def view_ebics_file(self):
self.ensure_one()
module = __name__.split('addons.')[1].split('.')[0]
@ -335,7 +331,6 @@ class EbicsXfer(models.TransientModel):
return ebics_file
@api.multi
def _setup_client(self):
self.ebics_config_id._check_ebics_keys()
passphrase = self._get_passphrase()

View File

@ -70,7 +70,7 @@
<field name="name">EBICS File Transfer</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.xfer</field>
<field name="view_type">form</field>
<!-- <field name="view_type">form</field> -->
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'ebics_download': 1}</field>
@ -81,7 +81,7 @@
<field name="name">EBICS File Transfer</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.xfer</field>
<field name="view_type">form</field>
<!-- <field name="view_type">form</field> -->
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'ebics_upload': 1}</field>