odoo-addon-purchase-force-invoiced 17.0.1.0.0.4__py3-none-any.whl → 18.0.1.0.0.4__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.

Potentially problematic release.


This version of odoo-addon-purchase-force-invoiced might be problematic. Click here for more details.

Files changed (19) hide show
  1. odoo/addons/purchase_force_invoiced/README.rst +21 -15
  2. odoo/addons/purchase_force_invoiced/__manifest__.py +5 -2
  3. odoo/addons/purchase_force_invoiced/i18n/purchase_force_invoiced.pot +11 -1
  4. odoo/addons/purchase_force_invoiced/migrations/16.0.1.0.0/post-migrate.py +9 -0
  5. odoo/addons/purchase_force_invoiced/model/__init__.py +1 -0
  6. odoo/addons/purchase_force_invoiced/model/purchase_order_line.py +16 -0
  7. odoo/addons/purchase_force_invoiced/readme/CONTRIBUTORS.md +2 -0
  8. odoo/addons/purchase_force_invoiced/readme/DESCRIPTION.md +1 -1
  9. odoo/addons/purchase_force_invoiced/readme/USAGE.md +4 -0
  10. odoo/addons/purchase_force_invoiced/reports/purchase_report.py +15 -8
  11. odoo/addons/purchase_force_invoiced/security/res_groups_data.xml +16 -0
  12. odoo/addons/purchase_force_invoiced/static/description/index.html +17 -9
  13. odoo/addons/purchase_force_invoiced/tests/test_purchase_force_invoiced.py +13 -5
  14. odoo/addons/purchase_force_invoiced/view/purchase_order.xml +1 -1
  15. {odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info → odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info}/METADATA +24 -18
  16. odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info/RECORD +27 -0
  17. {odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info → odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info}/WHEEL +1 -1
  18. odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info/RECORD +0 -24
  19. {odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info → odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ Purchase Force Invoiced
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:6efc88a50363d26fb21cbe44d58275b68d434d3d4373c0e57ed77d9f4cf4de85
10
+ !! source digest: sha256:8d62d9827f93c1b10829091c7759a63508381485645cdfeb2d052cf7bf8fa2e7
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,29 +17,29 @@ Purchase Force Invoiced
17
17
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
18
  :alt: License: AGPL-3
19
19
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20
- :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_force_invoiced
20
+ :target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced
21
21
  :alt: OCA/purchase-workflow
22
22
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_force_invoiced
23
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_force_invoiced
24
24
  :alt: Translate me on Weblate
25
25
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
30
 
31
31
  This module adds the possibility for users to force the invoice status
32
- of the purchase orders to 'No Bill to Receive', even when not all the
32
+ of the purchase orders to 'Fully Billed', even when not all the
33
33
  quantities, ordered or delivered, have been invoiced.
34
34
 
35
35
  This feature is useful in the following scenario:
36
36
 
37
- - The supplier disputes the quantities to be billed for, after the
38
- products have been delivered to her/him, and you agree to reduce the
39
- quantity to invoice (without expecting a refund).
40
- - When migrating from a previous Odoo version, in some cases there is
41
- less quantity billed to what was delivered, and you don't want these
42
- old purchase orders to appear in your 'Waiting Bills' list.
37
+ - The supplier disputes the quantities to be billed for, after the
38
+ products have been delivered to her/him, and you agree to reduce the
39
+ quantity to invoice (without expecting a refund).
40
+ - When migrating from a previous Odoo version, in some cases there is
41
+ less quantity billed to what was delivered, and you don't want these
42
+ old purchase orders to appear in your 'Waiting Bills' list.
43
43
 
44
44
  **Table of contents**
45
45
 
@@ -56,13 +56,17 @@ Usage
56
56
  4. Lock the Purchase Order and change its status to 'Done'.
57
57
  5. Check the field 'Force Invoiced'.
58
58
 
59
+ The field is only visible for users that have the technical setting 'Set
60
+ purchase orders to Force Invoiced'. By default, all purchase managers
61
+ have this setting.
62
+
59
63
  Bug Tracker
60
64
  ===========
61
65
 
62
66
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
63
67
  In case of trouble, please check there if your issue has already been reported.
64
68
  If you spotted it first, help us to smash it by providing a detailed and welcomed
65
- `feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
69
+ `feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
66
70
 
67
71
  Do not contact contributors directly about support or help with technical issues.
68
72
 
@@ -77,8 +81,10 @@ Authors
77
81
  Contributors
78
82
  ------------
79
83
 
80
- - Jordi Ballester <jordi.ballester@forgeflow.com>
81
- - Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
84
+ - Jordi Ballester <jordi.ballester@forgeflow.com>
85
+ - Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
86
+ - Bert Van Groenendael <bert.vangroenendael@dynapps.eu>
87
+ - Stefan Rijnhart <stefan@opener.amsterdam>
82
88
 
83
89
  Maintainers
84
90
  -----------
@@ -93,6 +99,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
93
99
  mission is to support the collaborative development of Odoo features and
94
100
  promote its widespread use.
95
101
 
96
- This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_force_invoiced>`_ project on GitHub.
102
+ This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced>`_ project on GitHub.
97
103
 
98
104
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -6,12 +6,15 @@
6
6
  "name": "Purchase Force Invoiced",
7
7
  "summary": "Allows to force the billing status of the purchase order to "
8
8
  '"Invoiced"',
9
- "version": "17.0.1.0.0",
9
+ "version": "18.0.1.0.0",
10
10
  "author": "Forgeflow, Odoo Community Association (OCA)",
11
11
  "category": "Purchase Management",
12
12
  "license": "AGPL-3",
13
13
  "website": "https://github.com/OCA/purchase-workflow",
14
14
  "depends": ["purchase"],
15
- "data": ["view/purchase_order.xml"],
15
+ "data": [
16
+ "security/res_groups_data.xml",
17
+ "view/purchase_order.xml",
18
+ ],
16
19
  "installable": True,
17
20
  }
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 17.0\n"
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -23,11 +23,21 @@ msgstr ""
23
23
  msgid "Purchase Order"
24
24
  msgstr ""
25
25
 
26
+ #. module: purchase_force_invoiced
27
+ #: model:ir.model,name:purchase_force_invoiced.model_purchase_order_line
28
+ msgid "Purchase Order Line"
29
+ msgstr ""
30
+
26
31
  #. module: purchase_force_invoiced
27
32
  #: model:ir.model,name:purchase_force_invoiced.model_purchase_report
28
33
  msgid "Purchase Report"
29
34
  msgstr ""
30
35
 
36
+ #. module: purchase_force_invoiced
37
+ #: model:res.groups,name:purchase_force_invoiced.group_force_invoiced
38
+ msgid "Set purchase orders to 'Force Invoiced'"
39
+ msgstr ""
40
+
31
41
  #. module: purchase_force_invoiced
32
42
  #: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced
33
43
  msgid ""
@@ -0,0 +1,9 @@
1
+ from odoo import SUPERUSER_ID, api
2
+
3
+
4
+ def migrate(cr, version):
5
+ """Allow all purchase managers to set orders to force invoiced"""
6
+ env = api.Environment(cr, SUPERUSER_ID, {})
7
+ env.ref("purchase.group_purchase_manager").implied_ids += env.ref(
8
+ "purchase_force_invoiced.group_force_invoiced"
9
+ )
@@ -1,3 +1,4 @@
1
1
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
2
2
 
3
3
  from . import purchase_order
4
+ from . import purchase_order_line
@@ -0,0 +1,16 @@
1
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
2
+
3
+ from odoo import api, models
4
+
5
+
6
+ class PurchaseOrderLine(models.Model):
7
+ _inherit = "purchase.order.line"
8
+
9
+ @api.depends("order_id.force_invoiced")
10
+ def _compute_qty_invoiced(self):
11
+ """Reset qty_to_invoice as per order force invoiced"""
12
+ res = super()._compute_qty_invoiced()
13
+ self.filtered(
14
+ lambda pol: pol.order_id.force_invoiced and pol.qty_to_invoice
15
+ ).qty_to_invoice = 0
16
+ return res
@@ -1,2 +1,4 @@
1
1
  - Jordi Ballester \<<jordi.ballester@forgeflow.com>\>
2
2
  - Rattapong Chokmasermkul \<<rattapongc@ecosoft.co.th>\>
3
+ - Bert Van Groenendael \<<bert.vangroenendael@dynapps.eu>\>
4
+ - Stefan Rijnhart \<<stefan@opener.amsterdam>\>
@@ -1,5 +1,5 @@
1
1
  This module adds the possibility for users to force the invoice status
2
- of the purchase orders to 'No Bill to Receive', even when not all the
2
+ of the purchase orders to 'Fully Billed', even when not all the
3
3
  quantities, ordered or delivered, have been invoiced.
4
4
 
5
5
  This feature is useful in the following scenario:
@@ -4,3 +4,7 @@
4
4
  order invoicing status is 'Waiting Bills'.
5
5
  4. Lock the Purchase Order and change its status to 'Done'.
6
6
  5. Check the field 'Force Invoiced'.
7
+
8
+ The field is only visible for users that have the technical setting 'Set
9
+ purchase orders to Force Invoiced'. By default, all purchase managers have this
10
+ setting.
@@ -1,7 +1,11 @@
1
1
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
2
2
  # Copyright 2022 Tecnativa - Pedro M. Baeza
3
+ import logging
3
4
 
4
5
  from odoo import models
6
+ from odoo.tools import SQL
7
+
8
+ _logger = logging.getLogger(__name__)
5
9
 
6
10
 
7
11
  class PurchaseReport(models.Model):
@@ -9,13 +13,16 @@ class PurchaseReport(models.Model):
9
13
 
10
14
  def _select(self):
11
15
  """Put quantity to be billed as 0 if it has been forced."""
12
- select_str = super()._select()
13
- select_str = select_str.replace(
14
- "case when t.purchase_method = 'purchase'",
16
+ select_sql = super()._select()
17
+ old = "case when t.purchase_method = 'purchase'"
18
+ new = (
15
19
  "case when po.force_invoiced then 0.0 "
16
- "else (case when t.purchase_method = 'purchase' ",
17
- )
18
- select_str = select_str.replace(
19
- "end as qty_to_be_billed", "end) end as qty_to_be_billed"
20
+ "when t.purchase_method = 'purchase'"
20
21
  )
21
- return select_str
22
+ code = select_sql.code.replace(old, new)
23
+ if "force_invoiced" not in code:
24
+ _logger.error(
25
+ "Query substitution failed. Check 'purchase/report/purchase_report.py "
26
+ "for changes"
27
+ )
28
+ return SQL(code, *select_sql.params)
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <data>
4
+ <record model="res.groups" id="group_force_invoiced">
5
+ <field name="name">Set purchase orders to 'Force Invoiced'</field>
6
+ <field name="category_id" ref="base.module_category_hidden" />
7
+ <field name="users" eval="[(4, ref('base.user_admin'))]" />
8
+ </record>
9
+ </data>
10
+ <data noupdate="1">
11
+ <!-- By default, purchase managers are allowed to set orders to Force Invoiced -->
12
+ <record model="res.groups" id="purchase.group_purchase_manager">
13
+ <field name="implied_ids" eval="[(4, ref('group_force_invoiced'))]" />
14
+ </record>
15
+ </data>
16
+ </odoo>
@@ -8,10 +8,11 @@
8
8
 
9
9
  /*
10
10
  :Author: David Goodger (goodger@python.org)
11
- :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
12
  :Copyright: This stylesheet has been placed in the public domain.
13
13
 
14
14
  Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
15
16
 
16
17
  See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
17
18
  customize this style sheet.
@@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
274
275
  margin-left: 2em ;
275
276
  margin-right: 2em }
276
277
 
277
- pre.code .ln { color: grey; } /* line numbers */
278
+ pre.code .ln { color: gray; } /* line numbers */
278
279
  pre.code, code { background-color: #eeeeee }
279
280
  pre.code .comment, code .comment { color: #5C6576 }
280
281
  pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@ span.option {
300
301
  span.pre {
301
302
  white-space: pre }
302
303
 
303
- span.problematic {
304
+ span.problematic, pre.problematic {
304
305
  color: red }
305
306
 
306
307
  span.section-subtitle {
@@ -366,11 +367,11 @@ ul.auto-toc {
366
367
  !! This file is generated by oca-gen-addon-readme !!
367
368
  !! changes will be overwritten. !!
368
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369
- !! source digest: sha256:6efc88a50363d26fb21cbe44d58275b68d434d3d4373c0e57ed77d9f4cf4de85
370
+ !! source digest: sha256:8d62d9827f93c1b10829091c7759a63508381485645cdfeb2d052cf7bf8fa2e7
370
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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/purchase-workflow/tree/17.0/purchase_force_invoiced"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_force_invoiced"><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/purchase-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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/purchase-workflow/tree/18.0/purchase_force_invoiced"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_force_invoiced"><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/purchase-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
373
  <p>This module adds the possibility for users to force the invoice status
373
- of the purchase orders to ‘No Bill to Receive’, even when not all the
374
+ of the purchase orders to ‘Fully Billed’, even when not all the
374
375
  quantities, ordered or delivered, have been invoiced.</p>
375
376
  <p>This feature is useful in the following scenario:</p>
376
377
  <ul class="simple">
@@ -404,13 +405,16 @@ order invoicing status is ‘Waiting Bills’.</li>
404
405
  <li>Lock the Purchase Order and change its status to ‘Done’.</li>
405
406
  <li>Check the field ‘Force Invoiced’.</li>
406
407
  </ol>
408
+ <p>The field is only visible for users that have the technical setting ‘Set
409
+ purchase orders to Force Invoiced’. By default, all purchase managers
410
+ have this setting.</p>
407
411
  </div>
408
412
  <div class="section" id="bug-tracker">
409
413
  <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
410
414
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
411
415
  In case of trouble, please check there if your issue has already been reported.
412
416
  If you spotted it first, help us to smash it by providing a detailed and welcomed
413
- <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
417
+ <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
414
418
  <p>Do not contact contributors directly about support or help with technical issues.</p>
415
419
  </div>
416
420
  <div class="section" id="credits">
@@ -426,16 +430,20 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
426
430
  <ul class="simple">
427
431
  <li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
428
432
  <li>Rattapong Chokmasermkul &lt;<a class="reference external" href="mailto:rattapongc&#64;ecosoft.co.th">rattapongc&#64;ecosoft.co.th</a>&gt;</li>
433
+ <li>Bert Van Groenendael &lt;<a class="reference external" href="mailto:bert.vangroenendael&#64;dynapps.eu">bert.vangroenendael&#64;dynapps.eu</a>&gt;</li>
434
+ <li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;opener.amsterdam">stefan&#64;opener.amsterdam</a>&gt;</li>
429
435
  </ul>
430
436
  </div>
431
437
  <div class="section" id="maintainers">
432
438
  <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
433
439
  <p>This module is maintained by the OCA.</p>
434
- <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
440
+ <a class="reference external image-reference" href="https://odoo-community.org">
441
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
442
+ </a>
435
443
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
436
444
  mission is to support the collaborative development of Odoo features and
437
445
  promote its widespread use.</p>
438
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_force_invoiced">OCA/purchase-workflow</a> project on GitHub.</p>
446
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced">OCA/purchase-workflow</a> project on GitHub.</p>
439
447
  <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>
440
448
  </div>
441
449
  </div>
@@ -4,17 +4,15 @@
4
4
 
5
5
  from odoo import fields
6
6
  from odoo.tests import tagged
7
- from odoo.tests.common import TransactionCase
8
7
 
9
- from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
8
+ from odoo.addons.base.tests.common import BaseCommon
10
9
 
11
10
 
12
11
  @tagged("post_install", "-at_install")
13
- class TestPurchaseForceInvoiced(TransactionCase):
12
+ class TestPurchaseForceInvoiced(BaseCommon):
14
13
  @classmethod
15
14
  def setUpClass(cls):
16
15
  super().setUpClass()
17
- cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
18
16
  cls.purchase_order_model = cls.env["purchase.order"]
19
17
  cls.purchase_order_line_model = cls.env["purchase.order.line"]
20
18
  cls.account_invoice_model = cls.env["account.move"]
@@ -22,7 +20,7 @@ class TestPurchaseForceInvoiced(TransactionCase):
22
20
  cls.invoice_account = cls.env["account.account"].search(
23
21
  [
24
22
  ("account_type", "=", "expense"),
25
- ("company_id", "=", cls.env.company.id),
23
+ ("company_ids", "=", cls.env.company.id),
26
24
  ],
27
25
  limit=1,
28
26
  )
@@ -103,12 +101,22 @@ class TestPurchaseForceInvoiced(TransactionCase):
103
101
  self.assertEqual(
104
102
  po.invoice_status, "to invoice", "The invoice status should be To Invoice"
105
103
  )
104
+ self.assertEqual(pol2.qty_to_invoice, 2)
105
+ pol2.flush_recordset() # Flush to let the SQL report pick up the current value
106
+ self.assertEqual(
107
+ self.env["purchase.report"].browse(pol2.id).qty_to_be_billed, 2
108
+ )
109
+
106
110
  # We set the force invoiced.
107
111
  po.button_done()
108
112
  po.force_invoiced = True
109
113
  self.assertEqual(
110
114
  po.invoice_status, "invoiced", "The invoice status should be Invoiced"
111
115
  )
116
+ self.assertFalse(pol2.qty_to_invoice)
117
+ self.env.invalidate_all() # Drop cache to force a refresh of the SQL report
118
+ self.assertFalse(self.env["purchase.report"].browse(pol2.id).qty_to_be_billed)
119
+
112
120
  # We remove the force invoiced.
113
121
  po.force_invoiced = False
114
122
  self.assertEqual(
@@ -11,7 +11,7 @@
11
11
  <field name="invoice_status" position="after">
12
12
  <field
13
13
  name="force_invoiced"
14
- groups="purchase.group_purchase_manager"
14
+ groups="purchase_force_invoiced.group_force_invoiced"
15
15
  invisible="state not in ('purchase', 'done')"
16
16
  readonly="state == 'done'"
17
17
  widget="boolean_toggle"
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-purchase_force_invoiced
3
- Version: 17.0.1.0.0.4
3
+ Version: 18.0.1.0.0.4
4
4
  Requires-Python: >=3.10
5
- Requires-Dist: odoo>=17.0a,<17.1dev
5
+ Requires-Dist: odoo==18.0.*
6
6
  Summary: Allows to force the billing status of the purchase order to "Invoiced"
7
7
  Home-page: https://github.com/OCA/purchase-workflow
8
8
  License: AGPL-3
@@ -10,7 +10,7 @@ Author: Forgeflow, Odoo Community Association (OCA)
10
10
  Author-email: support@odoo-community.org
11
11
  Classifier: Programming Language :: Python
12
12
  Classifier: Framework :: Odoo
13
- Classifier: Framework :: Odoo :: 17.0
13
+ Classifier: Framework :: Odoo :: 18.0
14
14
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3
15
15
 
16
16
  =======================
@@ -22,7 +22,7 @@ Purchase Force Invoiced
22
22
  !! This file is generated by oca-gen-addon-readme !!
23
23
  !! changes will be overwritten. !!
24
24
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25
- !! source digest: sha256:6efc88a50363d26fb21cbe44d58275b68d434d3d4373c0e57ed77d9f4cf4de85
25
+ !! source digest: sha256:8d62d9827f93c1b10829091c7759a63508381485645cdfeb2d052cf7bf8fa2e7
26
26
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
27
 
28
28
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -32,29 +32,29 @@ Purchase Force Invoiced
32
32
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
33
33
  :alt: License: AGPL-3
34
34
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
35
- :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_force_invoiced
35
+ :target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced
36
36
  :alt: OCA/purchase-workflow
37
37
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
38
- :target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_force_invoiced
38
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_force_invoiced
39
39
  :alt: Translate me on Weblate
40
40
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
41
- :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
41
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
42
42
  :alt: Try me on Runboat
43
43
 
44
44
  |badge1| |badge2| |badge3| |badge4| |badge5|
45
45
 
46
46
  This module adds the possibility for users to force the invoice status
47
- of the purchase orders to 'No Bill to Receive', even when not all the
47
+ of the purchase orders to 'Fully Billed', even when not all the
48
48
  quantities, ordered or delivered, have been invoiced.
49
49
 
50
50
  This feature is useful in the following scenario:
51
51
 
52
- - The supplier disputes the quantities to be billed for, after the
53
- products have been delivered to her/him, and you agree to reduce the
54
- quantity to invoice (without expecting a refund).
55
- - When migrating from a previous Odoo version, in some cases there is
56
- less quantity billed to what was delivered, and you don't want these
57
- old purchase orders to appear in your 'Waiting Bills' list.
52
+ - The supplier disputes the quantities to be billed for, after the
53
+ products have been delivered to her/him, and you agree to reduce the
54
+ quantity to invoice (without expecting a refund).
55
+ - When migrating from a previous Odoo version, in some cases there is
56
+ less quantity billed to what was delivered, and you don't want these
57
+ old purchase orders to appear in your 'Waiting Bills' list.
58
58
 
59
59
  **Table of contents**
60
60
 
@@ -71,13 +71,17 @@ Usage
71
71
  4. Lock the Purchase Order and change its status to 'Done'.
72
72
  5. Check the field 'Force Invoiced'.
73
73
 
74
+ The field is only visible for users that have the technical setting 'Set
75
+ purchase orders to Force Invoiced'. By default, all purchase managers
76
+ have this setting.
77
+
74
78
  Bug Tracker
75
79
  ===========
76
80
 
77
81
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
78
82
  In case of trouble, please check there if your issue has already been reported.
79
83
  If you spotted it first, help us to smash it by providing a detailed and welcomed
80
- `feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
84
+ `feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
81
85
 
82
86
  Do not contact contributors directly about support or help with technical issues.
83
87
 
@@ -92,8 +96,10 @@ Authors
92
96
  Contributors
93
97
  ------------
94
98
 
95
- - Jordi Ballester <jordi.ballester@forgeflow.com>
96
- - Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
99
+ - Jordi Ballester <jordi.ballester@forgeflow.com>
100
+ - Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
101
+ - Bert Van Groenendael <bert.vangroenendael@dynapps.eu>
102
+ - Stefan Rijnhart <stefan@opener.amsterdam>
97
103
 
98
104
  Maintainers
99
105
  -----------
@@ -108,6 +114,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
108
114
  mission is to support the collaborative development of Odoo features and
109
115
  promote its widespread use.
110
116
 
111
- This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_force_invoiced>`_ project on GitHub.
117
+ This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced>`_ project on GitHub.
112
118
 
113
119
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1,27 @@
1
+ odoo/addons/purchase_force_invoiced/README.rst,sha256=9rFx1rNyxDwgYLi3l4AY7Eio3z2sPHJELQhge2nS6R4,4123
2
+ odoo/addons/purchase_force_invoiced/__init__.py,sha256=aRNInmibTaqgcjQzJ0lXmv1U8y0u1Bvx94slUCcGyBU,112
3
+ odoo/addons/purchase_force_invoiced/__manifest__.py,sha256=1MZ8su1rZJecEjghhYZ6ap8iU0Y6OpVywVgUGs2pDGQ,641
4
+ odoo/addons/purchase_force_invoiced/i18n/es.po,sha256=r6wb8xV85dC1WW8IDrTKOvLE_j3HL3TUxQBVUnCPIQE,1641
5
+ odoo/addons/purchase_force_invoiced/i18n/fr.po,sha256=o3hZxs8dlgxx6-Pe8KQ6Zpg5kWSQzSTF1EbeBRbAFG0,1682
6
+ odoo/addons/purchase_force_invoiced/i18n/it.po,sha256=J4GD3XgQmlvOurS9skqFxBtI6t1HelCVMk-h_isCKUc,1641
7
+ odoo/addons/purchase_force_invoiced/i18n/purchase_force_invoiced.pot,sha256=qVA0mNZv1nDn6mVrQ1DWrA7IKQ_l6gElB70brlrswmk,1491
8
+ odoo/addons/purchase_force_invoiced/i18n/zh_CN.po,sha256=FAuxJWJd593L7iuvZGHfyFRNn3qVZd_RV5NNR9NIMWk,1747
9
+ odoo/addons/purchase_force_invoiced/migrations/16.0.1.0.0/post-migrate.py,sha256=mrSU2-uAwAmFW8g2M0IMKs0tBJRwksOpaMTpR3j8oRc,313
10
+ odoo/addons/purchase_force_invoiced/model/__init__.py,sha256=MK_X_rkh2MfgER0HrSI5ATq8OSdM2ISPgMN8b_04dJ4,133
11
+ odoo/addons/purchase_force_invoiced/model/purchase_order.py,sha256=zMufcsMhwdhOqK0QpZfHJgak_kZL4tqoisnjIYiyQME,813
12
+ odoo/addons/purchase_force_invoiced/model/purchase_order_line.py,sha256=-adKDq0Xn5cL8PnOf7Jv-3zCCSIBCsvhvwouQJFyppA,514
13
+ odoo/addons/purchase_force_invoiced/readme/CONTRIBUTORS.md,sha256=qPrqEO_93IboxW0y4icciAfMsvD1GnaGwlaVZ5LkNRE,219
14
+ odoo/addons/purchase_force_invoiced/readme/DESCRIPTION.md,sha256=qdAsVm3OeUuDN2JCls67TmRtwKgcmu19u9cvdiCHhEs,634
15
+ odoo/addons/purchase_force_invoiced/readme/USAGE.md,sha256=VtpNJ4PjJe9TjhDwboTAIOr8kYnG_8_KJVHaTeFbAA0,460
16
+ odoo/addons/purchase_force_invoiced/reports/__init__.py,sha256=YdNRMAZuHGqGF5XIc9V8npqCVgE3p3J3xoacuQR9C74,100
17
+ odoo/addons/purchase_force_invoiced/reports/purchase_report.py,sha256=xfBSi8ff0eX5VuFeWl8T26wR7Rva1DEC05qjz7CWu0o,900
18
+ odoo/addons/purchase_force_invoiced/security/res_groups_data.xml,sha256=RLI39nj-RNrok8VAw3F9ia_-ntBJT9ajDMqsjPRjls0,685
19
+ odoo/addons/purchase_force_invoiced/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
20
+ odoo/addons/purchase_force_invoiced/static/description/index.html,sha256=r-f8gaR6-SPFMPybgdOk0t5I_4IZhYSFpth9bmcg05U,14026
21
+ odoo/addons/purchase_force_invoiced/tests/__init__.py,sha256=r-qABJGYne9MBeVXsdOhoj4SKKsF0KArfXZIkwW5X2g,113
22
+ odoo/addons/purchase_force_invoiced/tests/test_purchase_force_invoiced.py,sha256=nsACUpehENW7WzoxfkcxH3-9hJ0SlC9adzwK_zAkNZg,4850
23
+ odoo/addons/purchase_force_invoiced/view/purchase_order.xml,sha256=G4ZrwhrL04fkI62bh2ZT2sSzRCCNArWCE7VoBRZe_kw,900
24
+ odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info/METADATA,sha256=k-RgFQ0PuqNt3MWTUmIDMfQ4o7CBKZ81vcl0-1bdx_4,4689
25
+ odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
26
+ odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
27
+ odoo_addon_purchase_force_invoiced-18.0.1.0.0.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: Whool 0.5
2
+ Generator: Whool 1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,24 +0,0 @@
1
- odoo/addons/purchase_force_invoiced/README.rst,sha256=dIVD1Yu7A9TgCYMY8qWJ07TjnBNERnGjS2jj8w3A2W0,3874
2
- odoo/addons/purchase_force_invoiced/__init__.py,sha256=aRNInmibTaqgcjQzJ0lXmv1U8y0u1Bvx94slUCcGyBU,112
3
- odoo/addons/purchase_force_invoiced/__manifest__.py,sha256=y3tPAI17WkIovz3HeNg5PZD3412eGvHDw0G9OYz8Zjg,586
4
- odoo/addons/purchase_force_invoiced/i18n/es.po,sha256=r6wb8xV85dC1WW8IDrTKOvLE_j3HL3TUxQBVUnCPIQE,1641
5
- odoo/addons/purchase_force_invoiced/i18n/fr.po,sha256=o3hZxs8dlgxx6-Pe8KQ6Zpg5kWSQzSTF1EbeBRbAFG0,1682
6
- odoo/addons/purchase_force_invoiced/i18n/it.po,sha256=J4GD3XgQmlvOurS9skqFxBtI6t1HelCVMk-h_isCKUc,1641
7
- odoo/addons/purchase_force_invoiced/i18n/purchase_force_invoiced.pot,sha256=lakpmdH9omzBQbh1MABNo2iTjG2Nr8reHXbfYc0ew4g,1180
8
- odoo/addons/purchase_force_invoiced/i18n/zh_CN.po,sha256=FAuxJWJd593L7iuvZGHfyFRNn3qVZd_RV5NNR9NIMWk,1747
9
- odoo/addons/purchase_force_invoiced/model/__init__.py,sha256=KYoWTlnSSLIP3qtOBsdOIsLAcJ3CTrAaDQ6ElEL-pLk,99
10
- odoo/addons/purchase_force_invoiced/model/purchase_order.py,sha256=zMufcsMhwdhOqK0QpZfHJgak_kZL4tqoisnjIYiyQME,813
11
- odoo/addons/purchase_force_invoiced/readme/CONTRIBUTORS.md,sha256=qqYfkIcig7PkfYINvJQ60PDgEHNHjnFgvWUIR_4D2Q4,111
12
- odoo/addons/purchase_force_invoiced/readme/DESCRIPTION.md,sha256=hzwQSXJkvUMTeXI-juMjRmopfRToDajdBc7IKrZn4aA,640
13
- odoo/addons/purchase_force_invoiced/readme/USAGE.md,sha256=Z8VH9wZqerLnhb-A6PTeek233gCjKFiAranqrb-Jgdo,297
14
- odoo/addons/purchase_force_invoiced/reports/__init__.py,sha256=YdNRMAZuHGqGF5XIc9V8npqCVgE3p3J3xoacuQR9C74,100
15
- odoo/addons/purchase_force_invoiced/reports/purchase_report.py,sha256=WCZ-rQcuZttuZIP1Q98mmpjQSyPWHatUvsvVv3mn-4Y,709
16
- odoo/addons/purchase_force_invoiced/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
17
- odoo/addons/purchase_force_invoiced/static/description/index.html,sha256=JuEeyDO7esqakBuBtvAuWuQQeSE4nVyRJ_OlIKPi4JM,13483
18
- odoo/addons/purchase_force_invoiced/tests/__init__.py,sha256=r-qABJGYne9MBeVXsdOhoj4SKKsF0KArfXZIkwW5X2g,113
19
- odoo/addons/purchase_force_invoiced/tests/test_purchase_force_invoiced.py,sha256=P-kI4rOqdBT1enu4PIYkGmlg_1OVXpf0Hwe9EiM4qlQ,4524
20
- odoo/addons/purchase_force_invoiced/view/purchase_order.xml,sha256=EYA2T2L8BeCe-JLI6iR-pn82bTnxUnHR-mpWnxWP4ck,887
21
- odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info/METADATA,sha256=0PRqT84HzQK8w1wFvHTLiyI3no2iSE-FDSoRKvD_-ZI,4448
22
- odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info/WHEEL,sha256=0WPb27lpWF0K4Majm_kVmkl1QxJZxoKxO5GGil8gPB4,81
23
- odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
24
- odoo_addon_purchase_force_invoiced-17.0.1.0.0.4.dist-info/RECORD,,