odoo-addon-sql-export-delta 16.0.1.0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,99 @@
1
+ ==========================
2
+ SQL Export (delta support)
3
+ ==========================
4
+
5
+ ..
6
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+ !! This file is generated by oca-gen-addon-readme !!
8
+ !! changes will be overwritten. !!
9
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ !! source digest: sha256:9494034b2f072b0d68ca3c3736ce6176299e3fede3f85b06ae004461e90f8431
11
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
14
+ :target: https://odoo-community.org/page/development-status
15
+ :alt: Alpha
16
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
+ :alt: License: AGPL-3
19
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
20
+ :target: https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta
21
+ :alt: OCA/reporting-engine
22
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
+ :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-sql_export_delta
24
+ :alt: Translate me on Weblate
25
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0
27
+ :alt: Try me on Runboat
28
+
29
+ |badge1| |badge2| |badge3| |badge4| |badge5|
30
+
31
+ This module extends the functionality of ``sql_export`` to allow you to
32
+ only export changes between export runs.
33
+
34
+ .. IMPORTANT::
35
+ This is an alpha version, the data model and design can change at any time without warning.
36
+ Only for development or testing purpose, do not use in production.
37
+ `More details on development status <https://odoo-community.org/page/development-status>`_
38
+
39
+ **Table of contents**
40
+
41
+ .. contents::
42
+ :local:
43
+
44
+ Configuration
45
+ =============
46
+
47
+ To configure this module, you need to:
48
+
49
+ 1. Go to an export in draft mode
50
+ 2. Check the flag 'Delta'
51
+
52
+ Bug Tracker
53
+ ===========
54
+
55
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
56
+ In case of trouble, please check there if your issue has already been reported.
57
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
58
+ `feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20sql_export_delta%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
59
+
60
+ Do not contact contributors directly about support or help with technical issues.
61
+
62
+ Credits
63
+ =======
64
+
65
+ Authors
66
+ -------
67
+
68
+ * Hunki Enterprises BV
69
+
70
+ Contributors
71
+ ------------
72
+
73
+ - Holger Brunn <mail@hunki-enterprises.com>
74
+ (https://hunki-enterprises.com)
75
+
76
+ Maintainers
77
+ -----------
78
+
79
+ This module is maintained by the OCA.
80
+
81
+ .. image:: https://odoo-community.org/logo.png
82
+ :alt: Odoo Community Association
83
+ :target: https://odoo-community.org
84
+
85
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
86
+ mission is to support the collaborative development of Odoo features and
87
+ promote its widespread use.
88
+
89
+ .. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px
90
+ :target: https://github.com/hbrunn
91
+ :alt: hbrunn
92
+
93
+ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
94
+
95
+ |maintainer-hbrunn|
96
+
97
+ This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta>`_ project on GitHub.
98
+
99
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1,3 @@
1
+ from . import models
2
+ from . import wizards
3
+ from .hooks import uninstall_hook
@@ -0,0 +1,26 @@
1
+ # Copyright 2024 Hunki Enterprises BV
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
3
+
4
+ {
5
+ "name": "SQL Export (delta support)",
6
+ "summary": "Support exporting only the changes from last export",
7
+ "version": "16.0.1.0.0",
8
+ "development_status": "Alpha",
9
+ "category": "Extra Tools",
10
+ "website": "https://github.com/OCA/reporting-engine",
11
+ "author": "Hunki Enterprises BV, Odoo Community Association (OCA)",
12
+ "maintainers": ["hbrunn"],
13
+ "license": "AGPL-3",
14
+ "uninstall_hook": "uninstall_hook",
15
+ "external_dependencies": {
16
+ "python": [],
17
+ "bin": [],
18
+ },
19
+ "depends": [
20
+ "sql_export",
21
+ ],
22
+ "data": [
23
+ "views/sql_export.xml",
24
+ ],
25
+ "demo": [],
26
+ }
@@ -0,0 +1,9 @@
1
+ # Copyright 2024 Hunki Enterprises BV
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
3
+ from odoo import SUPERUSER_ID, api
4
+
5
+
6
+ def uninstall_hook(cr, registry):
7
+ env = api.Environment(cr, SUPERUSER_ID, {})
8
+ for export in env["sql.export"].search([]):
9
+ export._export_delta_cleanup(keep_last=False)
@@ -0,0 +1,37 @@
1
+ # Translation of Odoo Server.
2
+ # This file contains the translation of the following modules:
3
+ # * sql_export_delta
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Odoo Server 16.0\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: \n"
14
+ "Plural-Forms: \n"
15
+
16
+ #. module: sql_export_delta
17
+ #: model:ir.model,name:sql_export_delta.model_sql_file_wizard
18
+ msgid "Allow the user to save the file with sql request's data"
19
+ msgstr ""
20
+
21
+ #. module: sql_export_delta
22
+ #: model:ir.model.fields,field_description:sql_export_delta.field_sql_export__export_delta
23
+ msgid "Delta"
24
+ msgstr ""
25
+
26
+ #. module: sql_export_delta
27
+ #: model:ir.model,name:sql_export_delta.model_sql_export
28
+ msgid "SQL export"
29
+ msgstr ""
30
+
31
+ #. module: sql_export_delta
32
+ #: model:ir.model.fields,help:sql_export_delta.field_sql_export__export_delta
33
+ msgid ""
34
+ "With this checked, the full result of the query will be stored as table in "
35
+ "the database, but the file generated will only contain rows not existing in "
36
+ "the n-1st export"
37
+ msgstr ""
@@ -0,0 +1 @@
1
+ from . import sql_export
@@ -0,0 +1,98 @@
1
+ # Copyright 2024 Hunki Enterprises BV
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
3
+
4
+ from psycopg2.sql import SQL, Identifier
5
+
6
+ from odoo import fields, models
7
+
8
+
9
+ class SqlExport(models.Model):
10
+ _inherit = "sql.export"
11
+
12
+ export_delta = fields.Boolean(
13
+ string="Delta",
14
+ help="With this checked, the full result of the query "
15
+ "will be stored as table in the database, but the file generated will "
16
+ "only contain rows not existing in the n-1st export",
17
+ )
18
+
19
+ def write(self, vals):
20
+ """Delete previous results when we change the query"""
21
+ if "query" in vals:
22
+ for this in self:
23
+ this._export_delta_cleanup(keep_last=False)
24
+ return super().write(vals)
25
+
26
+ def _execute_sql_request(
27
+ self,
28
+ params=None,
29
+ mode="fetchall",
30
+ rollback=True,
31
+ view_name=False,
32
+ copy_options="CSV HEADER DELIMITER ';'",
33
+ header=False,
34
+ ):
35
+ delta_id = self.env.context.get("export_delta_id")
36
+
37
+ if delta_id:
38
+ original_query = self.env.cr.mogrify(self.query, params).decode("utf-8")
39
+ result_table = self._export_delta_table_name(delta_id)
40
+ table_query = SQL(
41
+ "WITH result as ({0}) SELECT * INTO TABLE {1} FROM result"
42
+ ).format(SQL(original_query), Identifier(result_table))
43
+ previous_result_table = self._export_delta_existing_tables()[-1:]
44
+ if previous_result_table:
45
+ result_query = SQL("SELECT * FROM {0} EXCEPT SELECT * FROM {1}").format(
46
+ Identifier(result_table),
47
+ Identifier(previous_result_table[0]),
48
+ )
49
+ else:
50
+ result_query = SQL("SELECT * FROM {0}").format(Identifier(result_table))
51
+ self.env.cr.execute(table_query)
52
+ # inject new query in cache for super to use
53
+ self._cache["query"] = result_query
54
+ result = super()._execute_sql_request(
55
+ params=None,
56
+ mode=mode,
57
+ rollback=rollback,
58
+ view_name=view_name,
59
+ copy_options=copy_options,
60
+ header=header,
61
+ )
62
+ self.invalidate_recordset(["query"])
63
+ self._export_delta_cleanup(keep_last=True)
64
+ else:
65
+ result = super()._execute_sql_request(
66
+ params=params,
67
+ mode=mode,
68
+ rollback=rollback,
69
+ view_name=view_name,
70
+ copy_options=copy_options,
71
+ header=header,
72
+ )
73
+
74
+ return result
75
+
76
+ def _export_delta_table_name(self, identifier):
77
+ """
78
+ Return the name of a table to store data for delta export, must end with
79
+ {identifier}
80
+ """
81
+ return f"sql_export_delta_{self.id}_{identifier}"
82
+
83
+ def _export_delta_existing_tables(self):
84
+ """Return all table names used for storing data for delta export"""
85
+ self.env.cr.execute(
86
+ "SELECT table_name FROM information_schema.tables WHERE table_name LIKE %s",
87
+ (self._export_delta_table_name("%"),),
88
+ )
89
+ return sorted(
90
+ [name for name, in self.env.cr.fetchall()],
91
+ key=lambda name: int(name[len(self._export_delta_table_name("")) :]),
92
+ )
93
+
94
+ def _export_delta_cleanup(self, keep_last=True):
95
+ """Delete tables storing data for delta export"""
96
+ table_names = self._export_delta_existing_tables()[: -1 if keep_last else None]
97
+ for table_name in table_names:
98
+ self.env.cr.execute(SQL("DROP TABLE {0}").format(Identifier(table_name)))
@@ -0,0 +1,4 @@
1
+ To configure this module, you need to:
2
+
3
+ 1. Go to an export in draft mode
4
+ 2. Check the flag 'Delta'
@@ -0,0 +1 @@
1
+ - Holger Brunn \<mail@hunki-enterprises.com> (https://hunki-enterprises.com)
@@ -0,0 +1 @@
1
+ This module extends the functionality of ``sql_export`` to allow you to only export changes between export runs.
@@ -0,0 +1,440 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
7
+ <title>SQL Export (delta support)</title>
8
+ <style type="text/css">
9
+
10
+ /*
11
+ :Author: David Goodger (goodger@python.org)
12
+ :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
13
+ :Copyright: This stylesheet has been placed in the public domain.
14
+
15
+ Default cascading style sheet for the HTML output of Docutils.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: grey; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="sql-export-delta-support">
364
+ <h1 class="title">SQL Export (delta support)</h1>
365
+
366
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
+ !! This file is generated by oca-gen-addon-readme !!
368
+ !! changes will be overwritten. !!
369
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
+ !! source digest: sha256:9494034b2f072b0d68ca3c3736ce6176299e3fede3f85b06ae004461e90f8431
371
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-sql_export_delta"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
+ <p>This module extends the functionality of <tt class="docutils literal">sql_export</tt> to allow you to
374
+ only export changes between export runs.</p>
375
+ <div class="admonition important">
376
+ <p class="first admonition-title">Important</p>
377
+ <p class="last">This is an alpha version, the data model and design can change at any time without warning.
378
+ Only for development or testing purpose, do not use in production.
379
+ <a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p>
380
+ </div>
381
+ <p><strong>Table of contents</strong></p>
382
+ <div class="contents local topic" id="contents">
383
+ <ul class="simple">
384
+ <li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
385
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
386
+ <li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
387
+ <li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
388
+ <li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
389
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
390
+ </ul>
391
+ </li>
392
+ </ul>
393
+ </div>
394
+ <div class="section" id="configuration">
395
+ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
396
+ <p>To configure this module, you need to:</p>
397
+ <ol class="arabic simple">
398
+ <li>Go to an export in draft mode</li>
399
+ <li>Check the flag ‘Delta’</li>
400
+ </ol>
401
+ </div>
402
+ <div class="section" id="bug-tracker">
403
+ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
404
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
405
+ In case of trouble, please check there if your issue has already been reported.
406
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
407
+ <a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20sql_export_delta%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
408
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
409
+ </div>
410
+ <div class="section" id="credits">
411
+ <h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
412
+ <div class="section" id="authors">
413
+ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
414
+ <ul class="simple">
415
+ <li>Hunki Enterprises BV</li>
416
+ </ul>
417
+ </div>
418
+ <div class="section" id="contributors">
419
+ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
420
+ <ul class="simple">
421
+ <li>Holger Brunn &lt;<a class="reference external" href="mailto:mail&#64;hunki-enterprises.com">mail&#64;hunki-enterprises.com</a>&gt;
422
+ (<a class="reference external" href="https://hunki-enterprises.com">https://hunki-enterprises.com</a>)</li>
423
+ </ul>
424
+ </div>
425
+ <div class="section" id="maintainers">
426
+ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
427
+ <p>This module is maintained by the OCA.</p>
428
+ <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
429
+ <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
430
+ mission is to support the collaborative development of Odoo features and
431
+ promote its widespread use.</p>
432
+ <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
433
+ <p><a class="reference external image-reference" href="https://github.com/hbrunn"><img alt="hbrunn" src="https://github.com/hbrunn.png?size=40px" /></a></p>
434
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta">OCA/reporting-engine</a> project on GitHub.</p>
435
+ <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
436
+ </div>
437
+ </div>
438
+ </div>
439
+ </body>
440
+ </html>
@@ -0,0 +1 @@
1
+ from . import test_sql_export_delta
@@ -0,0 +1,26 @@
1
+ # Copyright 2024 Hunki Enterprises BV
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
3
+
4
+ from odoo.tests.common import tagged
5
+
6
+ from odoo.addons.sql_export.tests import test_sql_query
7
+
8
+ from ..hooks import uninstall_hook
9
+
10
+
11
+ @tagged("post_install", "-at_install")
12
+ class TestSqlExportDelta(test_sql_query.TestExportSqlQuery):
13
+ @classmethod
14
+ def setUpClass(cls):
15
+ super().setUpClass()
16
+ cls.sql_report_demo.export_delta = True
17
+
18
+ def test_sql_query(self):
19
+ """Test that exporting demo report twice exports empty delta"""
20
+ result = super().test_sql_query()
21
+ with self.assertRaises(AssertionError):
22
+ super().test_sql_query()
23
+ self.assertTrue(self.sql_report_demo._export_delta_existing_tables())
24
+ uninstall_hook(self.env.cr, self.env.registry)
25
+ self.assertFalse(self.sql_report_demo._export_delta_existing_tables())
26
+ return result
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!-- Copyright 2024 Hunki Enterprises BV
3
+ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) -->
4
+ <data>
5
+ <record id="sql_export_view_form" model="ir.ui.view">
6
+ <field name="model">sql.export</field>
7
+ <field name="inherit_id" ref="sql_export.sql_export_view_form" />
8
+ <field name="arch" type="xml">
9
+ <field name="file_format" position="after">
10
+ <field
11
+ name="export_delta"
12
+ attrs="{'readonly': [('state', '!=', 'draft')]}"
13
+ />
14
+ </field>
15
+ </field>
16
+ </record>
17
+ </data>
@@ -0,0 +1 @@
1
+ from . import sql_file_wizard
@@ -0,0 +1,14 @@
1
+ # Copyright 2024 Hunki Enterprises BV
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)
3
+
4
+ from odoo import models
5
+
6
+
7
+ class SqlFileWizard(models.TransientModel):
8
+ _inherit = "sql.file.wizard"
9
+
10
+ def export_sql(self):
11
+ self.ensure_one()
12
+ if self.sql_export_id.export_delta:
13
+ self = self.with_context(export_delta_id=self.id)
14
+ return super(SqlFileWizard, self).export_sql()
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.1
2
+ Name: odoo-addon-sql_export_delta
3
+ Version: 16.0.1.0.0.1
4
+ Summary: Support exporting only the changes from last export
5
+ Home-page: https://github.com/OCA/reporting-engine
6
+ Author: Hunki Enterprises BV, Odoo Community Association (OCA)
7
+ Author-email: support@odoo-community.org
8
+ License: AGPL-3
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Framework :: Odoo
11
+ Classifier: Framework :: Odoo :: 16.0
12
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: odoo-addon-sql-export<16.1dev,>=16.0dev
16
+ Requires-Dist: odoo<16.1dev,>=16.0a
17
+
18
+ ==========================
19
+ SQL Export (delta support)
20
+ ==========================
21
+
22
+ ..
23
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24
+ !! This file is generated by oca-gen-addon-readme !!
25
+ !! changes will be overwritten. !!
26
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
+ !! source digest: sha256:9494034b2f072b0d68ca3c3736ce6176299e3fede3f85b06ae004461e90f8431
28
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
+
30
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
31
+ :target: https://odoo-community.org/page/development-status
32
+ :alt: Alpha
33
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
34
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
35
+ :alt: License: AGPL-3
36
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
37
+ :target: https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta
38
+ :alt: OCA/reporting-engine
39
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
40
+ :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-sql_export_delta
41
+ :alt: Translate me on Weblate
42
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
43
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0
44
+ :alt: Try me on Runboat
45
+
46
+ |badge1| |badge2| |badge3| |badge4| |badge5|
47
+
48
+ This module extends the functionality of ``sql_export`` to allow you to
49
+ only export changes between export runs.
50
+
51
+ .. IMPORTANT::
52
+ This is an alpha version, the data model and design can change at any time without warning.
53
+ Only for development or testing purpose, do not use in production.
54
+ `More details on development status <https://odoo-community.org/page/development-status>`_
55
+
56
+ **Table of contents**
57
+
58
+ .. contents::
59
+ :local:
60
+
61
+ Configuration
62
+ =============
63
+
64
+ To configure this module, you need to:
65
+
66
+ 1. Go to an export in draft mode
67
+ 2. Check the flag 'Delta'
68
+
69
+ Bug Tracker
70
+ ===========
71
+
72
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
73
+ In case of trouble, please check there if your issue has already been reported.
74
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
75
+ `feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20sql_export_delta%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
76
+
77
+ Do not contact contributors directly about support or help with technical issues.
78
+
79
+ Credits
80
+ =======
81
+
82
+ Authors
83
+ -------
84
+
85
+ * Hunki Enterprises BV
86
+
87
+ Contributors
88
+ ------------
89
+
90
+ - Holger Brunn <mail@hunki-enterprises.com>
91
+ (https://hunki-enterprises.com)
92
+
93
+ Maintainers
94
+ -----------
95
+
96
+ This module is maintained by the OCA.
97
+
98
+ .. image:: https://odoo-community.org/logo.png
99
+ :alt: Odoo Community Association
100
+ :target: https://odoo-community.org
101
+
102
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
103
+ mission is to support the collaborative development of Odoo features and
104
+ promote its widespread use.
105
+
106
+ .. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px
107
+ :target: https://github.com/hbrunn
108
+ :alt: hbrunn
109
+
110
+ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
111
+
112
+ |maintainer-hbrunn|
113
+
114
+ This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/16.0/sql_export_delta>`_ project on GitHub.
115
+
116
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1,21 @@
1
+ odoo/addons/sql_export_delta/README.rst,sha256=5e013K-MwzJeAG8dMIUuq0nJUaBgR5gw_yDXvnYNLvI,3621
2
+ odoo/addons/sql_export_delta/__init__.py,sha256=4fL333TKsq1RTzLSvbVI6UQ2EyXrJuqJWdGxcl7Bd_k,77
3
+ odoo/addons/sql_export_delta/__manifest__.py,sha256=IoGW3pic3PYB7352-lgi4Us_lAQRYhNqvQcunPrJUWE,738
4
+ odoo/addons/sql_export_delta/hooks.py,sha256=ljdTPj1TyeunvEileSq_DIM3wB_cII3UDvaLLaSQgEM,327
5
+ odoo/addons/sql_export_delta/i18n/sql_export_delta.pot,sha256=UnHhPWKWV-iRXMQOCNzD123Sb-er6nfBK3ZM9LZGhy0,1089
6
+ odoo/addons/sql_export_delta/models/__init__.py,sha256=H2mQebhsT2KTqWfKlwTXELvwcsA9z45cDgtVLEAqvT8,25
7
+ odoo/addons/sql_export_delta/models/sql_export.py,sha256=AC4vFi1-IZA5OddWbqlHzwPXEwTBi9IFkQjpi6M5Ml4,3677
8
+ odoo/addons/sql_export_delta/readme/CONFIGURE.md,sha256=fxHNIvcLYrCsE9819dt5QFoYJS9GgPfUyIGEJEaF87g,99
9
+ odoo/addons/sql_export_delta/readme/CONTRIBUTORS.md,sha256=hxo8_OGY1i5lYcFlonzukIitCbpUxqQzs3UklqjSPDQ,79
10
+ odoo/addons/sql_export_delta/readme/DESCRIPTION.md,sha256=7yJkIUl-yJ-kgMiUPdT3vQWNYd4bMA1s5qaCHnefmUk,113
11
+ odoo/addons/sql_export_delta/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
12
+ odoo/addons/sql_export_delta/static/description/index.html,sha256=UwsEaoAwGRkJBNyUS4gp05v3NV3pDJbX1qKlEOTn1x0,13396
13
+ odoo/addons/sql_export_delta/tests/__init__.py,sha256=9J2dhBWFubpuToFFBjTjSMsly5IAP2GrMn45cePE_lA,36
14
+ odoo/addons/sql_export_delta/tests/test_sql_export_delta.py,sha256=6eUMQ7cxxmvAlmCXVFm3Aqs-rn1_xvBYEWzrztAPkp4,922
15
+ odoo/addons/sql_export_delta/views/sql_export.xml,sha256=F-3DviFWbKKyZwM0kXhgN7WykMGCg5kMNqXOz_lnDJc,648
16
+ odoo/addons/sql_export_delta/wizards/__init__.py,sha256=wM3mOKZerWLD5QFeHt-vP_E0p1nBwVWp8HM1X_pve0I,30
17
+ odoo/addons/sql_export_delta/wizards/sql_file_wizard.py,sha256=6YVH8j7Wb_cEj4QpTTMbYPbPjLUBLJE2cs7KmgPl6YU,424
18
+ odoo_addon_sql_export_delta-16.0.1.0.0.1.dist-info/METADATA,sha256=NFOxuVYrlobkYNMMKJEC2YSIkz8ZkWIq4GZRmPVL2fA,4278
19
+ odoo_addon_sql_export_delta-16.0.1.0.0.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
20
+ odoo_addon_sql_export_delta-16.0.1.0.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
21
+ odoo_addon_sql_export_delta-16.0.1.0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.44.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+