mirror of
				https://github.com/brain-tec/account_ebics.git
				synced 2025-10-31 11:37:01 +00:00 
			
		
		
		
	Merge branch '17-imp-account_ebics' into '17.0'
[IMP] account_ebics: add draft, done filters on ebics.file search view See merge request Noviat/Noviat_Generic/accounting-ebics!74
This commit is contained in:
		| @@ -1,9 +1,9 @@ | ||||
| # Copyright 2009-2024 Noviat. | ||||
| # Copyright 2009-2025 Noviat. | ||||
| # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). | ||||
|  | ||||
| { | ||||
|     "name": "EBICS banking protocol", | ||||
|     "version": "17.0.1.1.2", | ||||
|     "version": "17.0.1.2.0", | ||||
|     "license": "LGPL-3", | ||||
|     "author": "Noviat", | ||||
|     "website": "https://www.noviat.com", | ||||
|   | ||||
							
								
								
									
										15
									
								
								account_ebics/migrations/17.0.1.2/post-migration.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								account_ebics/migrations/17.0.1.2/post-migration.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| # Copyright 2009-2025 Noviat. | ||||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||||
|  | ||||
|  | ||||
| def migrate(cr, version): | ||||
|     cr.execute(  # pylint: disable=E8103 | ||||
|         """ | ||||
|     UPDATE ebics_file ef | ||||
|     SET state = 'done' | ||||
|     FROM ebics_file_format eff | ||||
|     WHERE ef.format_id = eff.id | ||||
|           AND eff.type = 'down' | ||||
|           AND eff.download_process_method IS NULL; | ||||
|         """ | ||||
|     ) | ||||
| @@ -1,4 +1,4 @@ | ||||
| # Copyright 2009-2024 Noviat. | ||||
| # Copyright 2009-2025 Noviat. | ||||
| # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). | ||||
|  | ||||
| import base64 | ||||
| @@ -36,7 +36,10 @@ class EbicsFile(models.Model): | ||||
|     format_id = fields.Many2one( | ||||
|         comodel_name="ebics.file.format", string="EBICS File Formats", readonly=True | ||||
|     ) | ||||
|     type = fields.Selection(related="format_id.type", readonly=True) | ||||
|     download_process_method = fields.Selection( | ||||
|         related="format_id.download_process_method" | ||||
|     ) | ||||
|     type = fields.Selection(related="format_id.type") | ||||
|     date_from = fields.Date( | ||||
|         readonly=True, help="'Date From' as entered in the download wizard." | ||||
|     ) | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| <?xml version="1.0" ?> | ||||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <odoo> | ||||
|  | ||||
|   <record id="ebics_config_view_tree" model="ir.ui.view"> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| <?xml version="1.0" ?> | ||||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <odoo> | ||||
|  | ||||
|     <record id="ebics_file_format_view_tree" model="ir.ui.view"> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| <?xml version="1.0" ?> | ||||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <odoo> | ||||
|  | ||||
|     <record id="ebics_file_view_search" model="ir.ui.view"> | ||||
| @@ -6,7 +6,6 @@ | ||||
|         <field name="model">ebics.file</field> | ||||
|         <field name="arch" type="xml"> | ||||
|             <search string="Search EBICS Files"> | ||||
|         <group col="10" colspan="4"> | ||||
|                 <field name="date_from" /> | ||||
|                 <field name="date_to" /> | ||||
|                 <field name="name" /> | ||||
| @@ -17,16 +16,32 @@ | ||||
|                     widget="selection" | ||||
|                     groups="base.group_multi_company" | ||||
|                 /> | ||||
|         </group> | ||||
|         <newline /> | ||||
|                 <filter | ||||
|                     string="Draft" | ||||
|                     name="draft" | ||||
|                     domain="[('state', '=', 'draft')]" | ||||
|                 /> | ||||
|                 <filter | ||||
|                     string="Done" | ||||
|                     name="done" | ||||
|                     domain="[('state', '=', 'confirm')]" | ||||
|                 /> | ||||
|                 <group expand="0" string="Group By"> | ||||
|                     <filter | ||||
|                         string="File Format" | ||||
|                         name="file_format" | ||||
|                         context="{'group_by':'format_id'}" | ||||
|                     /> | ||||
|           <filter string="State" name="state" context="{'group_by':'state'}" /> | ||||
|           <filter string="User" name="user" context="{'group_by':'user_id'}" /> | ||||
|                     <filter | ||||
|                         string="State" | ||||
|                         name="state" | ||||
|                         context="{'group_by':'state'}" | ||||
|                     /> | ||||
|                     <filter | ||||
|                         string="User" | ||||
|                         name="user" | ||||
|                         context="{'group_by':'user_id'}" | ||||
|                     /> | ||||
|                 </group> | ||||
|             </search> | ||||
|         </field> | ||||
| @@ -62,9 +77,10 @@ | ||||
|         <field name="arch" type="xml"> | ||||
|             <form string="EBICS File" create="false"> | ||||
|                 <header> | ||||
|                     <field name="download_process_method" invisible="1" /> | ||||
|                     <button | ||||
|                         name="set_to_draft" | ||||
|                         invisible="state != 'done'" | ||||
|                         invisible="not download_process_method or state != 'done'" | ||||
|                         string="Set to Draft" | ||||
|                         type="object" | ||||
|                         groups="account.group_account_manager" | ||||
| @@ -72,7 +88,7 @@ | ||||
|                     <button | ||||
|                         name="process" | ||||
|                         class="oe_highlight" | ||||
|                         invisible="state != 'draft'" | ||||
|                         invisible="not download_process_method or state != 'draft'" | ||||
|                         string="Process" | ||||
|                         type="object" | ||||
|                         groups="account.group_account_invoice" | ||||
| @@ -80,28 +96,38 @@ | ||||
|                     /> | ||||
|                     <button | ||||
|                         name="set_to_done" | ||||
|                         invisible="state != 'draft'" | ||||
|                         invisible="not download_process_method or state != 'draft'" | ||||
|                         string="Set to Done" | ||||
|                         type="object" | ||||
|                         groups="account.group_account_manager" | ||||
|                     /> | ||||
|           <field name="state" widget="statusbar" /> | ||||
|                     <field | ||||
|                         name="state" | ||||
|                         widget="statusbar" | ||||
|                         invisible="not download_process_method" | ||||
|                     /> | ||||
|                 </header> | ||||
|         <group colspan="4" col="4"> | ||||
|           <field name="date" string="Download Date" /> | ||||
|                 <group name="main"> | ||||
|                     <group name="main-full-screen" colspan="2" col="2"> | ||||
|                         <field name="name" /> | ||||
|                         <field name="data" filename="name" /> | ||||
|                         <field name="format_id" /> | ||||
|           <field name="date_from" /> | ||||
|           <field name="date_to" /> | ||||
|                     </group> | ||||
|                     <group name="main-left"> | ||||
|                         <field name="date" string="Download Date" /> | ||||
|                         <field name="user_id" /> | ||||
|                         <field name="ebics_userid_id" /> | ||||
|                     </group> | ||||
|                     <group name="main-right"> | ||||
|                         <field name="date_from" /> | ||||
|                         <field name="date_to" /> | ||||
|                         <field | ||||
|                             name="company_ids" | ||||
|                             widget="many2many_tags" | ||||
|                             groups="base.group_multi_company" | ||||
|                         /> | ||||
|                     </group> | ||||
|                 </group> | ||||
|                 <notebook> | ||||
|                     <page string="Additional Information"> | ||||
|                         <field name="note" nolabel="1" /> | ||||
| @@ -121,7 +147,13 @@ | ||||
|         <field name="arch" type="xml"> | ||||
|             <form string="Process EBICS File"> | ||||
|                 <separator colspan="4" string="Results :" /> | ||||
|         <field name="note_process" colspan="4" nolabel="1" width="850" height="400" /> | ||||
|                 <field | ||||
|                     name="note_process" | ||||
|                     colspan="4" | ||||
|                     nolabel="1" | ||||
|                     width="850" | ||||
|                     height="400" | ||||
|                 /> | ||||
|                 <footer> | ||||
|                     <button | ||||
|                         name="action_open_bank_statements" | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| <?xml version="1.0" ?> | ||||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <odoo> | ||||
|  | ||||
|   <record id="ebics_userid_view_tree" model="ir.ui.view"> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| <?xml version="1.0" ?> | ||||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <odoo> | ||||
|  | ||||
|   <menuitem | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| # Copyright 2009-2024 Noviat. | ||||
| # Copyright 2009-2025 Noviat. | ||||
| # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). | ||||
|  | ||||
| import base64 | ||||
| @@ -605,6 +605,7 @@ class EbicsXfer(models.TransientModel): | ||||
|             "date_from": self.date_from, | ||||
|             "date_to": self.date_to, | ||||
|             "format_id": file_format.id, | ||||
|             "state": file_format.download_process_method and "draft" or "done", | ||||
|             "user_id": self._uid, | ||||
|             "ebics_userid_id": self.ebics_userid_id.id, | ||||
|             "company_ids": self.ebics_config_id.company_ids.ids, | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| # Copyright 2009-2024 Noviat. | ||||
| # Copyright 2009-2025 Noviat. | ||||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||||
|  | ||||
| { | ||||
|     "name": "EBICS Files batch import", | ||||
|     "version": "17.0.1.0.0", | ||||
|     "version": "17.0.1.0.1", | ||||
|     "license": "AGPL-3", | ||||
|     "author": "Noviat", | ||||
|     "website": "https://www.noviat.com", | ||||
|   | ||||
| @@ -179,7 +179,9 @@ class EbicsBatchLog(models.Model): | ||||
|         return file_ids | ||||
|  | ||||
|     def _ebics_process(self, import_dict): | ||||
|         to_process = self.file_ids.filtered(lambda r: r.state == "draft") | ||||
|         to_process = self.file_ids.filtered( | ||||
|             lambda r: r.download_process_method and r.state == "draft" | ||||
|         ) | ||||
|         for ebics_file in to_process: | ||||
|             ebics_file.process() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user