odoo-addon-sale-blanket-order 16.0.1.0.0.6__py3-none-any.whl → 17.0.1.0.0.2__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-sale-blanket-order might be problematic. Click here for more details.

Files changed (26) hide show
  1. odoo/addons/sale_blanket_order/README.rst +83 -60
  2. odoo/addons/sale_blanket_order/__manifest__.py +2 -2
  3. odoo/addons/sale_blanket_order/i18n/sale_blanket_order.pot +16 -26
  4. odoo/addons/sale_blanket_order/models/blanket_orders.py +71 -50
  5. odoo/addons/sale_blanket_order/models/sale_config_settings.py +0 -1
  6. odoo/addons/sale_blanket_order/models/sale_orders.py +2 -2
  7. odoo/addons/sale_blanket_order/readme/CONTRIBUTORS.md +17 -0
  8. odoo/addons/sale_blanket_order/readme/{CREDITS.rst → CREDITS.md} +2 -1
  9. odoo/addons/sale_blanket_order/readme/DESCRIPTION.md +5 -0
  10. odoo/addons/sale_blanket_order/readme/USAGE.md +58 -0
  11. odoo/addons/sale_blanket_order/static/description/index.html +53 -52
  12. odoo/addons/sale_blanket_order/tests/test_blanket_orders.py +6 -6
  13. odoo/addons/sale_blanket_order/tests/test_sale_order.py +1 -3
  14. odoo/addons/sale_blanket_order/views/sale_blanket_order_views.xml +24 -34
  15. odoo/addons/sale_blanket_order/views/sale_config_settings.xml +11 -19
  16. odoo/addons/sale_blanket_order/views/sale_order_views.xml +1 -1
  17. odoo/addons/sale_blanket_order/wizard/create_sale_orders.py +3 -2
  18. odoo_addon_sale_blanket_order-17.0.1.0.0.2.dist-info/METADATA +186 -0
  19. {odoo_addon_sale_blanket_order-16.0.1.0.0.6.dist-info → odoo_addon_sale_blanket_order-17.0.1.0.0.2.dist-info}/RECORD +21 -21
  20. {odoo_addon_sale_blanket_order-16.0.1.0.0.6.dist-info → odoo_addon_sale_blanket_order-17.0.1.0.0.2.dist-info}/WHEEL +1 -1
  21. odoo_addon_sale_blanket_order-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
  22. odoo/addons/sale_blanket_order/readme/CONTRIBUTORS.rst +0 -8
  23. odoo/addons/sale_blanket_order/readme/DESCRIPTION.rst +0 -4
  24. odoo/addons/sale_blanket_order/readme/USAGE.rst +0 -53
  25. odoo_addon_sale_blanket_order-16.0.1.0.0.6.dist-info/METADATA +0 -167
  26. odoo_addon_sale_blanket_order-16.0.1.0.0.6.dist-info/top_level.txt +0 -1
@@ -0,0 +1,58 @@
1
+ A new menu in the Sales area is created, allowing users to create new
2
+ blanket orders.
3
+
4
+ To create a new Sale Blanket Order go to the sale menu in the Sales
5
+ section:
6
+
7
+ ![](../static/description/BO_menu.png)
8
+
9
+ Hitting the button create will open the form view in which we can
10
+ introduce the following information:
11
+
12
+ - Vendor
13
+
14
+ - Salesperson
15
+
16
+ - Payment Terms
17
+
18
+ - Validity date
19
+
20
+ - Order lines:
21
+ - Product
22
+ - Accorded price
23
+ - Original, Ordered, Invoiced, Received and Remaining quantities
24
+
25
+ - Terms and Conditions of the Blanket Order
26
+
27
+ ![](../static/description/BO_form.png)
28
+
29
+ From the form, once the Blanket Order has been confirmed and its state
30
+ is open, the user can create a Sale Order, check the Sale Orders
31
+ associated to the Blanket Order and/or see the Blanket Order lines
32
+ associated to the BO.
33
+
34
+ ![](../static/description/BO_actions.png)
35
+
36
+ Hitting the button Create Sale Order will open a wizard that will ask
37
+ for the amount of each product in the BO lines for which the Sale Order
38
+ will be created.
39
+
40
+ ![](../static/description/PO_from_BO.png)
41
+
42
+ Installing this module will add an additional menu which will show all
43
+ the blanket order lines currently defined in the system. From this list
44
+ the user can create customized Sale Orders selecting the lines for which
45
+ the PO (or POs if the customers are different) is (are) created.
46
+
47
+ ![](../static/description/BO_lines.png)
48
+
49
+ In the Sale Order form one field is added in the PO lines, the Blanket
50
+ Order line field. This field keeps track to which Blanket Order line the
51
+ PO line is associated. Upon adding a new product in a newly created Sale
52
+ Order a blanket order line will be suggested depending on the following
53
+ factors:
54
+
55
+ - Closer Validity date
56
+ - Remaining quantity \> Quantity introduced in the Sale Order line
57
+
58
+ ![](../static/description/PO_BOLine.png)
@@ -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,13 +367,14 @@ 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:ccbeac2c26d7658d8283b70cce70cd45752f1c2207f3bf45370716a8072e14fd
370
+ !! source digest: sha256:38dd0261a7111b3d7809f79e0b708c34344ef59827257ad8556071883c377c7c
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/sale-workflow/tree/16.0/sale_blanket_order"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_blanket_order"><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/sale-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
- <p>A blanket order is a pre-agreement to sell a certain number of quantities of
373
- products at a specific price. From a confirmed blanket order, the users can
374
- create new sale orders at such price, until the blanket order expires, either
375
- due to reaching the validity date or exhausting all the quantities of products.</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/sale-workflow/tree/17.0/sale_blanket_order"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_blanket_order"><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/sale-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>
373
+ <p>A blanket order is a pre-agreement to sell a certain number of
374
+ quantities of products at a specific price. From a confirmed blanket
375
+ order, the users can create new sale orders at such price, until the
376
+ blanket order expires, either due to reaching the validity date or
377
+ exhausting all the quantities of products.</p>
376
378
  <p><strong>Table of contents</strong></p>
377
379
  <div class="contents local topic" id="contents">
378
380
  <ul class="simple">
@@ -389,68 +391,58 @@ due to reaching the validity date or exhausting all the quantities of products.<
389
391
  </div>
390
392
  <div class="section" id="usage">
391
393
  <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
392
- <p>A new menu in the Sales area is created, allowing users to create new blanket orders.</p>
393
- <p>To create a new Sale Blanket Order go to the sale menu in the Sales section:</p>
394
- <div class="figure">
395
- <img alt="Blanket Orders menu" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/BO_menu.png" />
396
- </div>
397
- <p>Hitting the button create will open the form view in which we can introduce the following
398
- information:</p>
394
+ <p>A new menu in the Sales area is created, allowing users to create new
395
+ blanket orders.</p>
396
+ <p>To create a new Sale Blanket Order go to the sale menu in the Sales
397
+ section:</p>
398
+ <p><img alt="image1" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/BO_menu.png" /></p>
399
+ <p>Hitting the button create will open the form view in which we can
400
+ introduce the following information:</p>
399
401
  <ul class="simple">
400
402
  <li>Vendor</li>
401
403
  <li>Salesperson</li>
402
404
  <li>Payment Terms</li>
403
405
  <li>Validity date</li>
404
- <li><dl class="first docutils">
405
- <dt>Order lines:</dt>
406
- <dd><ul class="first last">
406
+ <li>Order lines:<ul>
407
407
  <li>Product</li>
408
408
  <li>Accorded price</li>
409
409
  <li>Original, Ordered, Invoiced, Received and Remaining quantities</li>
410
410
  </ul>
411
- </dd>
412
- </dl>
413
411
  </li>
414
412
  <li>Terms and Conditions of the Blanket Order</li>
415
413
  </ul>
416
- <div class="figure">
417
- <img alt="Blanket Orders form" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/BO_form.png" />
418
- </div>
419
- <p>From the form, once the Blanket Order has been confirmed and its state is open, the user can
420
- create a Sale Order, check the Sale Orders associated to the Blanket Order and/or
421
- see the Blanket Order lines associated to the BO.</p>
422
- <div class="figure">
423
- <img alt="Actions that can be done from Blanket Order" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/BO_actions.png" />
424
- </div>
425
- <p>Hitting the button Create Sale Order will open a wizard that will ask for the amount of each
426
- product in the BO lines for which the Sale Order will be created.</p>
427
- <div class="figure">
428
- <img alt="Create Sale Order from Blanket Order" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/PO_from_BO.png" />
429
- </div>
430
- <p>Installing this module will add an additional menu which will show all the blanket order lines
431
- currently defined in the system. From this list the user can create customized Sale Orders
432
- selecting the lines for which the PO (or POs if the customers are different) is (are) created.</p>
433
- <div class="figure">
434
- <img alt="Blanket Order lines and actions" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/BO_lines.png" />
435
- </div>
436
- <p>In the Sale Order form one field is added in the PO lines, the Blanket Order line field. This
437
- field keeps track to which Blanket Order line the PO line is associated. Upon adding a new product
438
- in a newly created Sale Order a blanket order line will be suggested depending on the following
414
+ <p><img alt="image2" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/BO_form.png" /></p>
415
+ <p>From the form, once the Blanket Order has been confirmed and its state
416
+ is open, the user can create a Sale Order, check the Sale Orders
417
+ associated to the Blanket Order and/or see the Blanket Order lines
418
+ associated to the BO.</p>
419
+ <p><img alt="image3" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/BO_actions.png" /></p>
420
+ <p>Hitting the button Create Sale Order will open a wizard that will ask
421
+ for the amount of each product in the BO lines for which the Sale Order
422
+ will be created.</p>
423
+ <p><img alt="image4" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/PO_from_BO.png" /></p>
424
+ <p>Installing this module will add an additional menu which will show all
425
+ the blanket order lines currently defined in the system. From this list
426
+ the user can create customized Sale Orders selecting the lines for which
427
+ the PO (or POs if the customers are different) is (are) created.</p>
428
+ <p><img alt="image5" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/BO_lines.png" /></p>
429
+ <p>In the Sale Order form one field is added in the PO lines, the Blanket
430
+ Order line field. This field keeps track to which Blanket Order line the
431
+ PO line is associated. Upon adding a new product in a newly created Sale
432
+ Order a blanket order line will be suggested depending on the following
439
433
  factors:</p>
440
434
  <ul class="simple">
441
435
  <li>Closer Validity date</li>
442
436
  <li>Remaining quantity &gt; Quantity introduced in the Sale Order line</li>
443
437
  </ul>
444
- <div class="figure">
445
- <img alt="New field added in Sale Order Line" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_blanket_order/static/description/PO_BOLine.png" />
446
- </div>
438
+ <p><img alt="image6" src="https://raw.githubusercontent.com/OCA/sale-workflow/17.0/sale_blanket_order/static/description/PO_BOLine.png" /></p>
447
439
  </div>
448
440
  <div class="section" id="bug-tracker">
449
441
  <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
450
442
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
451
443
  In case of trouble, please check there if your issue has already been reported.
452
444
  If you spotted it first, help us to smash it by providing a detailed and welcomed
453
- <a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_blanket_order%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
445
+ <a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_blanket_order%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
454
446
  <p>Do not contact contributors directly about support or help with technical issues.</p>
455
447
  </div>
456
448
  <div class="section" id="credits">
@@ -472,7 +464,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
472
464
  </li>
473
465
  <li><p class="first">Alex Comba &lt;<a class="reference external" href="mailto:alex.comba&#64;agilebg.com">alex.comba&#64;agilebg.com</a>&gt; (<a class="reference external" href="https://www.agilebg.com/">https://www.agilebg.com/</a>)</p>
474
466
  </li>
475
- <li><p class="first">Jasper Jumelet &lt;<a class="reference external" href="mailto:jasper.jumelet&#64;codeforward.nl">jasper.jumelet&#64;codeforward.nl</a>&gt; (<a class="reference external" href="https://www.codeforward.nl/">https://www.codeforward.nl/</a>)</p>
467
+ <li><p class="first">Codeforward (<a class="reference external" href="https://www.codeforward.nl/">https://www.codeforward.nl/</a>):</p>
468
+ <blockquote>
469
+ <ul class="simple">
470
+ <li>Jasper Jumelet &lt;<a class="reference external" href="mailto:jasper.jumelet&#64;codeforward.nl">jasper.jumelet&#64;codeforward.nl</a>&gt;</li>
471
+ <li>Chris Bergman &lt;<a class="reference external" href="mailto:chris.bergman&#64;codeforward.nl">chris.bergman&#64;codeforward.nl</a>&gt;</li>
472
+ </ul>
473
+ </blockquote>
476
474
  </li>
477
475
  <li><p class="first"><a class="reference external" href="https://trobz.com">Trobz</a>:</p>
478
476
  <blockquote>
@@ -485,16 +483,19 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
485
483
  </div>
486
484
  <div class="section" id="other-credits">
487
485
  <h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
488
- <p>The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp</p>
486
+ <p>The migration of this module from 15.0 to 16.0 was financially supported
487
+ by Camptocamp</p>
489
488
  </div>
490
489
  <div class="section" id="maintainers">
491
490
  <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
492
491
  <p>This module is maintained by the OCA.</p>
493
- <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
492
+ <a class="reference external image-reference" href="https://odoo-community.org">
493
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
494
+ </a>
494
495
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
495
496
  mission is to support the collaborative development of Odoo features and
496
497
  promote its widespread use.</p>
497
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/16.0/sale_blanket_order">OCA/sale-workflow</a> project on GitHub.</p>
498
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_blanket_order">OCA/sale-workflow</a> project on GitHub.</p>
498
499
  <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>
499
500
  </div>
500
501
  </div>
@@ -99,7 +99,7 @@ class TestSaleBlanketOrders(common.TransactionCase):
99
99
  blanket_order.line_ids[0].sudo().onchange_product()
100
100
  blanket_order.pricelist_id.discount_policy = "with_discount"
101
101
  blanket_order.line_ids[0].sudo().onchange_product()
102
- blanket_order.line_ids[0].sudo()._get_display_price(self.product)
102
+ blanket_order.line_ids[0].sudo()._get_display_price()
103
103
 
104
104
  self.assertEqual(blanket_order.state, "draft")
105
105
 
@@ -390,10 +390,10 @@ class TestSaleBlanketOrders(common.TransactionCase):
390
390
  wizard1 = self.blanket_order_wiz_obj.with_context(
391
391
  active_id=blanket_order.id, active_model="sale.blanket.order"
392
392
  ).create({})
393
- wizard1.line_ids.filtered(lambda l: l.product_id == self.product).write(
393
+ wizard1.line_ids.filtered(lambda line: line.product_id == self.product).write(
394
394
  {"qty": 10.0}
395
395
  )
396
- wizard1.line_ids.filtered(lambda l: l.product_id == self.product2).write(
396
+ wizard1.line_ids.filtered(lambda line: line.product_id == self.product2).write(
397
397
  {"qty": 10.0}
398
398
  )
399
399
  wizard1.sudo().create_sale_order()
@@ -401,10 +401,10 @@ class TestSaleBlanketOrders(common.TransactionCase):
401
401
  wizard2 = self.blanket_order_wiz_obj.with_context(
402
402
  active_id=blanket_order.id, active_model="sale.blanket.order"
403
403
  ).create({})
404
- wizard2.line_ids.filtered(lambda l: l.product_id == self.product).write(
404
+ wizard2.line_ids.filtered(lambda line: line.product_id == self.product).write(
405
405
  {"qty": 20.0}
406
406
  )
407
- wizard2.line_ids.filtered(lambda l: l.product_id == self.product2).write(
407
+ wizard2.line_ids.filtered(lambda line: line.product_id == self.product2).write(
408
408
  {"qty": 0}
409
409
  )
410
410
  wizard2.sudo().create_sale_order()
@@ -412,7 +412,7 @@ class TestSaleBlanketOrders(common.TransactionCase):
412
412
  wizard3 = self.blanket_order_wiz_obj.with_context(
413
413
  active_id=blanket_order.id, active_model="sale.blanket.order"
414
414
  ).create({})
415
- wizard3.line_ids.filtered(lambda l: l.product_id == self.product2).write(
415
+ wizard3.line_ids.filtered(lambda line: line.product_id == self.product2).write(
416
416
  {"qty": 10.0}
417
417
  )
418
418
  wizard3.sudo().create_sale_order()
@@ -145,7 +145,6 @@ class TestSaleOrder(common.TransactionCase):
145
145
  }
146
146
  )
147
147
  so_line = so.order_line[0]
148
- so_line.with_context(from_sale_order=True).name_get()
149
148
  so_line.onchange_product_id()
150
149
  self.assertEqual(so_line._get_eligible_bo_lines(), bo_lines)
151
150
  bo_line_assigned = self.blanket_order_line_obj.search(
@@ -180,11 +179,10 @@ class TestSaleOrder(common.TransactionCase):
180
179
  }
181
180
  )
182
181
  so_line = so.order_line[0]
183
- so_line.with_context(from_sale_order=True).name_get()
184
182
  so_line.onchange_product_id()
185
183
  self.assertEqual(
186
184
  so_line._get_eligible_bo_lines(),
187
- bo_lines.filtered(lambda l: l.product_id == self.product),
185
+ bo_lines.filtered(lambda bo_line: bo_line.product_id == self.product),
188
186
  )
189
187
  bo_line_assigned = self.blanket_order_line_obj.search(
190
188
  [
@@ -37,25 +37,25 @@
37
37
  string="Create Sale Order"
38
38
  type="action"
39
39
  class="btn-primary"
40
- attrs="{'invisible': [('state', '!=', 'open')]}"
40
+ invisible="state != 'open'"
41
41
  />
42
42
  <button
43
43
  name="set_to_draft"
44
- states="expired,done"
44
+ invisible="state not in ['expired', 'done']"
45
45
  string="To Draft"
46
46
  class="btn-secondary"
47
47
  type="object"
48
48
  />
49
49
  <button
50
50
  name="action_cancel"
51
- states="open"
51
+ invisible="state != 'open'"
52
52
  string="Cancel"
53
53
  class="btn-secondary"
54
54
  type="object"
55
55
  />
56
56
  <button
57
57
  name="action_confirm"
58
- states="draft"
58
+ invisible="state != 'draft'"
59
59
  string="Confirm"
60
60
  class="btn-primary o_sale_confirm"
61
61
  type="object"
@@ -84,7 +84,7 @@
84
84
  type="object"
85
85
  name="action_view_sale_blanket_order_line"
86
86
  class="oe_stat_button"
87
- attrs="{'invisible':[('line_count', '=', 0)]}"
87
+ invisible="not line_count"
88
88
  icon="fa-list"
89
89
  >
90
90
  <field name="line_count" widget="statinfo" string="Lines" />
@@ -100,7 +100,7 @@
100
100
  <field
101
101
  name="partner_id"
102
102
  context="{'res_partner_search_mode': 'customer', 'show_address': 1}"
103
- attrs="{'required': [('state', '=', 'draft')]}"
103
+ required="state == 'draft'"
104
104
  options="{&quot;always_reload&quot;: True}"
105
105
  />
106
106
  <field name="payment_term_id" />
@@ -112,17 +112,14 @@
112
112
  options="{'no_create': True}"
113
113
  />
114
114
  <field name="company_id" invisible="1" />
115
- <field
116
- name="validity_date"
117
- attrs="{'required': [('state', '=', 'draft')]}"
118
- />
115
+ <field name="validity_date" required="state == 'draft'" />
119
116
  </group>
120
117
  </group>
121
118
  <notebook>
122
119
  <page string="Order Lines" name="order_lines">
123
120
  <field
124
121
  name="line_ids"
125
- attrs="{'readonly': [('state', 'in', ('open','done','expired'))]}"
122
+ readonly="state in ['open', 'done', 'expired']"
126
123
  widget="section_and_note_one2many"
127
124
  >
128
125
  <tree editable="bottom">
@@ -142,14 +139,15 @@
142
139
  context="{'default_display_type': 'line_note'}"
143
140
  />
144
141
  </control>
145
- <field name="display_type" invisible="1" />
142
+ <field
143
+ name="display_type"
144
+ column_invisible="True"
145
+ />
146
146
  <field name="sequence" widget="handle" />
147
147
  <field
148
148
  name="product_id"
149
- attrs="{
150
- 'required': [('display_type', '=', False)],
151
- 'invisible': [('display_type', '=', True)],
152
- }"
149
+ required="not display_type"
150
+ invisible="display_type"
153
151
  context="{
154
152
  'fld': 'product_id',
155
153
  'partner_id': parent.partner_id,
@@ -181,14 +179,12 @@
181
179
  'quantity': original_uom_qty,
182
180
  'company_id': parent.company_id
183
181
  }"
184
- attrs="{
185
- 'required': [('display_type', '=', False)],
186
- 'invisible': [('display_type', '=', True)],
187
- }"
182
+ required="not display_type"
183
+ invisible="display_type"
188
184
  />
189
185
  <field
190
186
  name="product_uom"
191
- invisible="1"
187
+ column_invisible="True"
192
188
  groups="!uom.group_uom"
193
189
  />
194
190
  <field
@@ -198,10 +194,8 @@
198
194
  />
199
195
  <field
200
196
  name="price_unit"
201
- attrs="{
202
- 'required': [('display_type', '=', False)],
203
- 'invisible': [('display_type', '=', True)],
204
- }"
197
+ required="not display_type"
198
+ invisible="display_type"
205
199
  />
206
200
  <field name="date_schedule" />
207
201
  <field name="ordered_uom_qty" optional="hide" />
@@ -214,17 +208,13 @@
214
208
  domain="[('type_tax_use','=','sale')]"
215
209
  context="{'default_type_tax_use': 'sale'}"
216
210
  options="{'no_create': True}"
217
- attrs="{
218
- 'required': [('display_type', '=', False)],
219
- 'invisible': [('display_type', '=', True)],
220
- }"
211
+ required="not display_type"
212
+ invisible="display_type"
221
213
  />
222
214
  <field
223
215
  name="price_subtotal"
224
216
  widget="monetary"
225
- attrs="{
226
- 'invisible': [('display_type', '=', True)],
227
- }"
217
+ invisible="display_type"
228
218
  />
229
219
  <field name="company_id" invisible="1" />
230
220
  </tree>
@@ -266,7 +256,7 @@
266
256
  <group string="Sales Information" name="sales_person">
267
257
  <field
268
258
  name="pricelist_id"
269
- attrs="{'required': [('state', '=', 'draft')]}"
259
+ required="state == 'draft'"
270
260
  />
271
261
  <field name="user_id" />
272
262
  <field
@@ -284,7 +274,7 @@
284
274
  <t groups="base.group_multi_company">
285
275
  <field
286
276
  name="analytic_account_id"
287
- attrs="{'readonly': [('sale_count','!=',0),('state','!=','draft')]}"
277
+ readonly="sale_count != 0 and state != 'draft'"
288
278
  groups="analytic.group_analytic_accounting"
289
279
  force_save="1"
290
280
  />
@@ -7,25 +7,17 @@
7
7
  <field name="model">res.config.settings</field>
8
8
  <field name="inherit_id" ref="sale.res_config_settings_view_form" />
9
9
  <field name="arch" type="xml">
10
- <xpath
11
- expr="//div[hasclass('row','mt16','o_settings_container')][position() = 3]"
12
- position="after"
13
- >
14
- <h2>Blanket Orders</h2>
15
- <div class="row mt16 o_settings_container">
16
- <div class="col-xs-12 col-md-6 o_setting_box">
17
- <div class="o_setting_left_pane">
18
- <field name="group_blanket_disable_adding_lines" />
19
- </div>
20
- <div class="o_setting_right_pane">
21
- <label for="group_blanket_disable_adding_lines" />
22
- <div class="text-muted" id="sale_config_website_quote">
23
- Disable adding more lines to SOs from Blanket Orders
24
- </div>
25
- </div>
26
- </div>
27
- </div>
28
- </xpath>
10
+ <block name="quotation_order_setting_container" position="after">
11
+ <block title="Blanket Orders" name="blanket_orders_setting_container">
12
+ <setting
13
+ id="group_blanket_disable_adding_lines"
14
+ title="Disable adding more lines to SOs from Blanket Orders"
15
+ help="Disable adding more lines to SOs from Blanket Orders"
16
+ >
17
+ <field name="group_blanket_disable_adding_lines" />
18
+ </setting>
19
+ </block>
20
+ </block>
29
21
  </field>
30
22
  </record>
31
23
  </odoo>
@@ -15,7 +15,7 @@
15
15
  <field
16
16
  name="blanket_order_line"
17
17
  context="{'from_sale_order': True}"
18
- attrs="{'column_invisible': [('parent.blanket_order_id', '=', False)]}"
18
+ column_invisible="not parent.blanket_order_id"
19
19
  />
20
20
  </xpath>
21
21
  <xpath expr="//field[@name='order_line']" position="attributes">
@@ -79,7 +79,8 @@ class BlanketOrderWizard(models.TransientModel):
79
79
  },
80
80
  )
81
81
  for bol in bo_lines.filtered(
82
- lambda l: not l.display_type and l.remaining_uom_qty != 0.0
82
+ lambda bo_line: not bo_line.display_type
83
+ and bo_line.remaining_uom_qty != 0.0
83
84
  )
84
85
  ]
85
86
  return lines
@@ -137,7 +138,7 @@ class BlanketOrderWizard(models.TransientModel):
137
138
  pricelist_id = 0
138
139
  user_id = 0
139
140
  payment_term_id = 0
140
- for line in self.line_ids.filtered(lambda l: l.qty != 0.0):
141
+ for line in self.line_ids.filtered(lambda line: line.qty != 0.0):
141
142
  if line.qty > line.remaining_uom_qty:
142
143
  raise UserError(_("You can't order more than the remaining quantities"))
143
144
  vals = self._prepare_so_line_vals(line)