odoo-addon-sale-blanket-order 17.0.1.1.1.2__py3-none-any.whl → 18.0.1.0.0.12__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.
- odoo/addons/sale_blanket_order/README.rst +37 -16
- odoo/addons/sale_blanket_order/__manifest__.py +7 -2
- odoo/addons/sale_blanket_order/data/ir_cron.xml +0 -2
- odoo/addons/sale_blanket_order/i18n/de.po +0 -15
- odoo/addons/sale_blanket_order/i18n/es.po +3 -15
- odoo/addons/sale_blanket_order/i18n/fr.po +3 -15
- odoo/addons/sale_blanket_order/i18n/fr_FR.po +3 -15
- odoo/addons/sale_blanket_order/i18n/it.po +32 -44
- odoo/addons/sale_blanket_order/i18n/pt.po +0 -15
- odoo/addons/sale_blanket_order/i18n/sale_blanket_order.pot +11 -58
- odoo/addons/sale_blanket_order/models/blanket_orders.py +35 -44
- odoo/addons/sale_blanket_order/models/sale_orders.py +18 -5
- odoo/addons/sale_blanket_order/readme/CONTEXT.md +5 -0
- odoo/addons/sale_blanket_order/report/report.xml +0 -2
- odoo/addons/sale_blanket_order/report/templates.xml +32 -35
- odoo/addons/sale_blanket_order/static/description/index.html +51 -28
- odoo/addons/sale_blanket_order/static/src/js/disable_add_order_line.esm.js +26 -0
- odoo/addons/sale_blanket_order/tests/test_blanket_orders.py +69 -2
- odoo/addons/sale_blanket_order/views/sale_blanket_order_line_views.xml +17 -28
- odoo/addons/sale_blanket_order/views/sale_blanket_order_views.xml +14 -25
- odoo/addons/sale_blanket_order/views/sale_order_views.xml +2 -14
- odoo/addons/sale_blanket_order/wizard/create_sale_orders.py +47 -30
- odoo/addons/sale_blanket_order/wizard/create_sale_orders.xml +2 -2
- {odoo_addon_sale_blanket_order-17.0.1.1.1.2.dist-info → odoo_addon_sale_blanket_order-18.0.1.0.0.12.dist-info}/METADATA +42 -20
- {odoo_addon_sale_blanket_order-17.0.1.1.1.2.dist-info → odoo_addon_sale_blanket_order-18.0.1.0.0.12.dist-info}/RECORD +27 -25
- {odoo_addon_sale_blanket_order-17.0.1.1.1.2.dist-info → odoo_addon_sale_blanket_order-18.0.1.0.0.12.dist-info}/WHEEL +1 -1
- {odoo_addon_sale_blanket_order-17.0.1.1.1.2.dist-info → odoo_addon_sale_blanket_order-18.0.1.0.0.12.dist-info}/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<t t-call="web.external_layout">
|
|
5
5
|
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
|
|
6
6
|
<div class="page">
|
|
7
|
-
<div class="oe_structure" />
|
|
7
|
+
<div id="oe_structure_div_01" class="oe_structure" />
|
|
8
8
|
<div class="row">
|
|
9
9
|
<div class="col-xs-6">
|
|
10
10
|
<div
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'
|
|
13
13
|
/>
|
|
14
14
|
<p t-if="doc.partner_id.vat">VAT: <span
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
t-field="doc.partner_id.vat"
|
|
16
|
+
/></p>
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
<h2>
|
|
@@ -118,52 +118,49 @@
|
|
|
118
118
|
</tbody>
|
|
119
119
|
</table>
|
|
120
120
|
<div class="clearfix">
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
<div class="row">
|
|
122
|
+
<div
|
|
123
123
|
t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"
|
|
124
124
|
>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
<td class="text-end">
|
|
133
|
-
<span
|
|
125
|
+
<table class="table table-sm">
|
|
126
|
+
<tr class="border-black">
|
|
127
|
+
<td>
|
|
128
|
+
<strong>Subtotal</strong>
|
|
129
|
+
</td>
|
|
130
|
+
<td class="text-end">
|
|
131
|
+
<span
|
|
134
132
|
t-field="doc.amount_untaxed"
|
|
135
133
|
t-options='{"widget": "monetary", "display_currency": doc.currency_id}'
|
|
136
134
|
/>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
</td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td>Taxes</td>
|
|
139
|
+
<td class="text-end">
|
|
140
|
+
<span
|
|
143
141
|
t-field="doc.amount_tax"
|
|
144
142
|
t-options='{"widget": "monetary", "display_currency": doc.currency_id}'
|
|
145
143
|
/>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
</td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr class="border-black">
|
|
147
|
+
<td>
|
|
148
|
+
<strong>Total</strong>
|
|
149
|
+
</td>
|
|
150
|
+
<td class="text-end">
|
|
151
|
+
<span
|
|
154
152
|
t-field="doc.amount_total"
|
|
155
153
|
t-options='{"widget": "monetary", "display_currency": doc.currency_id}'
|
|
156
154
|
/>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
</div>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
</table>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
163
160
|
</div>
|
|
164
161
|
|
|
165
162
|
<p t-field="doc.note" />
|
|
166
|
-
<div class="oe_structure" />
|
|
163
|
+
<div id="oe_structure_div_02" class="oe_structure" />
|
|
167
164
|
</div>
|
|
168
165
|
</t>
|
|
169
166
|
</template>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
|
6
|
-
<title>
|
|
6
|
+
<title>README.rst</title>
|
|
7
7
|
<style type="text/css">
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -360,16 +360,21 @@ ul.auto-toc {
|
|
|
360
360
|
</style>
|
|
361
361
|
</head>
|
|
362
362
|
<body>
|
|
363
|
-
<div class="document"
|
|
364
|
-
<h1 class="title">Sale Blanket Orders</h1>
|
|
363
|
+
<div class="document">
|
|
365
364
|
|
|
365
|
+
|
|
366
|
+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
|
367
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
|
368
|
+
</a>
|
|
369
|
+
<div class="section" id="sale-blanket-orders">
|
|
370
|
+
<h1>Sale Blanket Orders</h1>
|
|
366
371
|
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
367
372
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
373
|
!! changes will be overwritten. !!
|
|
369
374
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
375
|
+
!! source digest: sha256:f0f9cee803ac6b3a9aaed08fda171398c5febb7e96021d27938e1377ce6a0847
|
|
371
376
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
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/
|
|
377
|
+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-blanket/tree/18.0/sale_blanket_order"><img alt="OCA/sale-blanket" src="https://img.shields.io/badge/github-OCA%2Fsale--blanket-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-blanket-18-0/sale-blanket-18-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-blanket&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
378
|
<p>A blanket order is a pre-agreement to sell a certain number of
|
|
374
379
|
quantities of products at a specific price. From a confirmed blanket
|
|
375
380
|
order, the users can create new sale orders at such price, until the
|
|
@@ -378,24 +383,41 @@ exhausting all the quantities of products.</p>
|
|
|
378
383
|
<p><strong>Table of contents</strong></p>
|
|
379
384
|
<div class="contents local topic" id="contents">
|
|
380
385
|
<ul class="simple">
|
|
381
|
-
<li><a class="reference internal" href="#
|
|
382
|
-
<li><a class="reference internal" href="#
|
|
383
|
-
<li><a class="reference internal" href="#
|
|
384
|
-
<li><a class="reference internal" href="#
|
|
385
|
-
<li><a class="reference internal" href="#
|
|
386
|
-
<li><a class="reference internal" href="#
|
|
387
|
-
<li><a class="reference internal" href="#
|
|
386
|
+
<li><a class="reference internal" href="#use-cases-context" id="toc-entry-1">Use Cases / Context</a></li>
|
|
387
|
+
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
|
|
388
|
+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
|
|
389
|
+
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
|
|
390
|
+
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
|
|
391
|
+
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
|
|
392
|
+
<li><a class="reference internal" href="#other-credits" id="toc-entry-7">Other credits</a></li>
|
|
393
|
+
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
|
|
388
394
|
</ul>
|
|
389
395
|
</li>
|
|
390
396
|
</ul>
|
|
391
397
|
</div>
|
|
398
|
+
<div class="section" id="use-cases-context">
|
|
399
|
+
<h2><a class="toc-backref" href="#toc-entry-1">Use Cases / Context</a></h2>
|
|
400
|
+
<p>Others modules provide similar features. The module
|
|
401
|
+
(sale_order_blanket_order)[<a class="reference external" href="https://pypi.org/project/odoo-addon-sale-order-blanket-order">https://pypi.org/project/odoo-addon-sale-order-blanket-order</a>]
|
|
402
|
+
also defines the concept of sale blanket order. The main differences
|
|
403
|
+
are:</p>
|
|
404
|
+
<ul class="simple">
|
|
405
|
+
<li>This module integrates Blanket Orders and Call-Off Orders into the
|
|
406
|
+
sale.blanket.order object, whereas the other module extends the
|
|
407
|
+
sale.order object. This means that any extensions made to the sale
|
|
408
|
+
order model can also apply to blanket orders.</li>
|
|
409
|
+
<li>In the other module, you can deliver and invoice directly from the
|
|
410
|
+
blanket order. You can also create a separate call-off order to
|
|
411
|
+
partially deliver the blanket order.</li>
|
|
412
|
+
</ul>
|
|
413
|
+
</div>
|
|
392
414
|
<div class="section" id="usage">
|
|
393
|
-
<
|
|
415
|
+
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
|
|
394
416
|
<p>A new menu in the Sales area is created, allowing users to create new
|
|
395
417
|
blanket orders.</p>
|
|
396
418
|
<p>To create a new Sale Blanket Order go to the sale menu in the Sales
|
|
397
419
|
section:</p>
|
|
398
|
-
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/sale-
|
|
420
|
+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/BO_menu.png" /></p>
|
|
399
421
|
<p>Hitting the button create will open the form view in which we can
|
|
400
422
|
introduce the following information:</p>
|
|
401
423
|
<ul class="simple">
|
|
@@ -411,21 +433,21 @@ introduce the following information:</p>
|
|
|
411
433
|
</li>
|
|
412
434
|
<li>Terms and Conditions of the Blanket Order</li>
|
|
413
435
|
</ul>
|
|
414
|
-
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/sale-
|
|
436
|
+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/BO_form.png" /></p>
|
|
415
437
|
<p>From the form, once the Blanket Order has been confirmed and its state
|
|
416
438
|
is open, the user can create a Sale Order, check the Sale Orders
|
|
417
439
|
associated to the Blanket Order and/or see the Blanket Order lines
|
|
418
440
|
associated to the BO.</p>
|
|
419
|
-
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/sale-
|
|
441
|
+
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/BO_actions.png" /></p>
|
|
420
442
|
<p>Hitting the button Create Sale Order will open a wizard that will ask
|
|
421
443
|
for the amount of each product in the BO lines for which the Sale Order
|
|
422
444
|
will be created.</p>
|
|
423
|
-
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/sale-
|
|
445
|
+
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/PO_from_BO.png" /></p>
|
|
424
446
|
<p>Installing this module will add an additional menu which will show all
|
|
425
447
|
the blanket order lines currently defined in the system. From this list
|
|
426
448
|
the user can create customized Sale Orders selecting the lines for which
|
|
427
449
|
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-
|
|
450
|
+
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/BO_lines.png" /></p>
|
|
429
451
|
<p>In the Sale Order form one field is added in the PO lines, the Blanket
|
|
430
452
|
Order line field. This field keeps track to which Blanket Order line the
|
|
431
453
|
PO line is associated. Upon adding a new product in a newly created Sale
|
|
@@ -435,26 +457,26 @@ factors:</p>
|
|
|
435
457
|
<li>Closer Validity date</li>
|
|
436
458
|
<li>Remaining quantity > Quantity introduced in the Sale Order line</li>
|
|
437
459
|
</ul>
|
|
438
|
-
<p><img alt="image6" src="https://raw.githubusercontent.com/OCA/sale-
|
|
460
|
+
<p><img alt="image6" src="https://raw.githubusercontent.com/OCA/sale-blanket/18.0/sale_blanket_order/static/description/PO_BOLine.png" /></p>
|
|
439
461
|
</div>
|
|
440
462
|
<div class="section" id="bug-tracker">
|
|
441
|
-
<
|
|
442
|
-
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-
|
|
463
|
+
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
|
|
464
|
+
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-blanket/issues">GitHub Issues</a>.
|
|
443
465
|
In case of trouble, please check there if your issue has already been reported.
|
|
444
466
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
445
|
-
<a class="reference external" href="https://github.com/OCA/sale-
|
|
467
|
+
<a class="reference external" href="https://github.com/OCA/sale-blanket/issues/new?body=module:%20sale_blanket_order%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
446
468
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
447
469
|
</div>
|
|
448
470
|
<div class="section" id="credits">
|
|
449
|
-
<
|
|
471
|
+
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
|
|
450
472
|
<div class="section" id="authors">
|
|
451
|
-
<
|
|
473
|
+
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
|
|
452
474
|
<ul class="simple">
|
|
453
475
|
<li>Acsone SA/NV</li>
|
|
454
476
|
</ul>
|
|
455
477
|
</div>
|
|
456
478
|
<div class="section" id="contributors">
|
|
457
|
-
<
|
|
479
|
+
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
|
|
458
480
|
<ul>
|
|
459
481
|
<li><p class="first">André Pereira <<a class="reference external" href="mailto:github@andreparames.com">github@andreparames.com</a>> (<a class="reference external" href="https://www.acsone.eu/">https://www.acsone.eu/</a>)</p>
|
|
460
482
|
</li>
|
|
@@ -482,12 +504,12 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
|
482
504
|
</ul>
|
|
483
505
|
</div>
|
|
484
506
|
<div class="section" id="other-credits">
|
|
485
|
-
<
|
|
507
|
+
<h3><a class="toc-backref" href="#toc-entry-7">Other credits</a></h3>
|
|
486
508
|
<p>The migration of this module from 15.0 to 16.0 was financially supported
|
|
487
509
|
by Camptocamp</p>
|
|
488
510
|
</div>
|
|
489
511
|
<div class="section" id="maintainers">
|
|
490
|
-
<
|
|
512
|
+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
|
|
491
513
|
<p>This module is maintained by the OCA.</p>
|
|
492
514
|
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
493
515
|
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
@@ -495,10 +517,11 @@ by Camptocamp</p>
|
|
|
495
517
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
496
518
|
mission is to support the collaborative development of Odoo features and
|
|
497
519
|
promote its widespread use.</p>
|
|
498
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-
|
|
520
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-blanket/tree/18.0/sale_blanket_order">OCA/sale-blanket</a> project on GitHub.</p>
|
|
499
521
|
<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>
|
|
500
522
|
</div>
|
|
501
523
|
</div>
|
|
502
524
|
</div>
|
|
525
|
+
</div>
|
|
503
526
|
</body>
|
|
504
527
|
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
|
|
2
|
+
import {ListRenderer} from "@web/views/list/list_renderer";
|
|
3
|
+
import {patch} from "@web/core/utils/patch";
|
|
4
|
+
|
|
5
|
+
patch(ListRenderer.prototype, {
|
|
6
|
+
get canCreate() {
|
|
7
|
+
const parentRecord = this.props.list.model.root;
|
|
8
|
+
const disableAddingLines = parentRecord?.data?.disable_adding_lines;
|
|
9
|
+
return !disableAddingLines && super.canCreate;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
patch(KanbanRenderer.prototype, {
|
|
14
|
+
get canCreate() {
|
|
15
|
+
const parent = this.props.list.model.root;
|
|
16
|
+
const parentModel = parent?.resModel || parent?.model;
|
|
17
|
+
const fieldName = this.props.arch.attrs.name;
|
|
18
|
+
|
|
19
|
+
if (parentModel === "sale.order" && fieldName === "order_line") {
|
|
20
|
+
const disabled = parent.data?.disable_adding_lines;
|
|
21
|
+
return !disabled && super.canCreate;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return super.canCreate;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -15,12 +15,65 @@ class TestSaleBlanketOrders(common.TransactionCase):
|
|
|
15
15
|
cls.blanket_order_line_obj = cls.env["sale.blanket.order.line"]
|
|
16
16
|
cls.blanket_order_wiz_obj = cls.env["sale.blanket.order.wizard"]
|
|
17
17
|
cls.so_obj = cls.env["sale.order"]
|
|
18
|
+
cls.product_pricelist_item_obj = cls.env["product.pricelist.item"]
|
|
19
|
+
|
|
20
|
+
settings = cls.env["res.config.settings"].with_user(cls.env.user).create({})
|
|
21
|
+
settings.group_discount_per_so_line = True
|
|
22
|
+
settings.set_values()
|
|
18
23
|
|
|
19
24
|
cls.payment_term = cls.env.ref("account.account_payment_term_immediate")
|
|
20
25
|
cls.sale_pricelist = cls.env["product.pricelist"].create(
|
|
21
26
|
{"name": "Test Pricelist", "currency_id": cls.env.ref("base.USD").id}
|
|
22
27
|
)
|
|
23
28
|
|
|
29
|
+
# Taxes
|
|
30
|
+
company_partner = cls.env["res.partner"].create(
|
|
31
|
+
{
|
|
32
|
+
"name": __name__,
|
|
33
|
+
"country_id": cls.env.company.country_id.id,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
company2 = cls.env["res.company"].create(
|
|
37
|
+
{
|
|
38
|
+
"name": __name__,
|
|
39
|
+
"partner_id": company_partner.id,
|
|
40
|
+
},
|
|
41
|
+
)
|
|
42
|
+
cls.env.user.company_ids += company2
|
|
43
|
+
cls.env = cls.env(
|
|
44
|
+
context=dict(
|
|
45
|
+
cls.env.context, allowed_company_ids=[cls.env.company.id, company2.id]
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
tax_group1 = cls.env["account.tax.group"].create(
|
|
49
|
+
{
|
|
50
|
+
"name": cls.env.company.name,
|
|
51
|
+
"company_id": cls.env.company.id,
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
tax_group2 = cls.env["account.tax.group"].create(
|
|
55
|
+
{
|
|
56
|
+
"name": company2.name,
|
|
57
|
+
"company_id": company2.id,
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
cls.tax1 = cls.env["account.tax"].create(
|
|
61
|
+
{
|
|
62
|
+
"name": cls.env.company.name,
|
|
63
|
+
"company_id": cls.env.company.id,
|
|
64
|
+
"amount": 10,
|
|
65
|
+
"tax_group_id": tax_group1.id,
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
cls.tax2 = cls.env["account.tax"].create(
|
|
69
|
+
{
|
|
70
|
+
"name": company2.name,
|
|
71
|
+
"company_id": company2.id,
|
|
72
|
+
"amount": 20,
|
|
73
|
+
"tax_group_id": tax_group2.id,
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
24
77
|
# UoM
|
|
25
78
|
cls.categ_unit = cls.env.ref("uom.product_uom_categ_unit")
|
|
26
79
|
cls.uom_dozen = cls.env["uom.uom"].create(
|
|
@@ -48,6 +101,7 @@ class TestSaleBlanketOrders(common.TransactionCase):
|
|
|
48
101
|
"type": "consu",
|
|
49
102
|
"uom_id": cls.env.ref("uom.product_uom_unit").id,
|
|
50
103
|
"default_code": "PROD_DEL01",
|
|
104
|
+
"taxes_id": [fields.Command.set([cls.tax1.id, cls.tax2.id])],
|
|
51
105
|
}
|
|
52
106
|
)
|
|
53
107
|
cls.product2 = cls.env["product.product"].create(
|
|
@@ -94,9 +148,22 @@ class TestSaleBlanketOrders(common.TransactionCase):
|
|
|
94
148
|
}
|
|
95
149
|
)
|
|
96
150
|
blanket_order.sudo().onchange_partner_id()
|
|
97
|
-
|
|
151
|
+
|
|
152
|
+
pricelist_item = self.product_pricelist_item_obj.search(
|
|
153
|
+
[("pricelist_id", "=", blanket_order.pricelist_id.id)], limit=1
|
|
154
|
+
)
|
|
155
|
+
if not pricelist_item:
|
|
156
|
+
pricelist_item = self.product_pricelist_item_obj.create(
|
|
157
|
+
{
|
|
158
|
+
"pricelist_id": blanket_order.pricelist_id.id,
|
|
159
|
+
"fixed_price": 10.0,
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
|
|
98
163
|
blanket_order.line_ids[0].sudo().onchange_product()
|
|
99
|
-
blanket_order.
|
|
164
|
+
self.assertEqual(blanket_order.line_ids[0].taxes_id, self.tax1)
|
|
165
|
+
|
|
166
|
+
pricelist_item.write({"compute_price": "percentage"})
|
|
100
167
|
blanket_order.line_ids[0].sudo().onchange_product()
|
|
101
168
|
blanket_order.line_ids[0].sudo()._get_display_price()
|
|
102
169
|
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<!-- VIEWS -->
|
|
5
4
|
|
|
6
5
|
<record id="sale_blanket_order_line_tree" model="ir.ui.view">
|
|
7
|
-
<field name="name">sale.blanket.order.line.
|
|
6
|
+
<field name="name">sale.blanket.order.line.list</field>
|
|
8
7
|
<field name="model">sale.blanket.order.line</field>
|
|
9
8
|
<field name="arch" type="xml">
|
|
10
|
-
<
|
|
9
|
+
<list create="false">
|
|
11
10
|
<field name="sequence" widget="handle" />
|
|
12
|
-
<field name="name" invisible="1" />
|
|
13
11
|
<field name="order_id" />
|
|
14
12
|
<field
|
|
15
13
|
name="product_id"
|
|
16
14
|
context="{'partner_id':parent.partner_id, 'quantity':original_uom_qty, 'company_id': company_id}"
|
|
17
15
|
/>
|
|
18
|
-
<field name="product_uom" invisible="1" />
|
|
19
16
|
<field name="price_unit" />
|
|
20
17
|
<field name="date_schedule" />
|
|
21
18
|
<field
|
|
@@ -27,8 +24,7 @@
|
|
|
27
24
|
<field name="invoiced_uom_qty" />
|
|
28
25
|
<field name="delivered_uom_qty" />
|
|
29
26
|
<field name="remaining_uom_qty" />
|
|
30
|
-
|
|
31
|
-
</tree>
|
|
27
|
+
</list>
|
|
32
28
|
</field>
|
|
33
29
|
</record>
|
|
34
30
|
|
|
@@ -37,25 +33,23 @@
|
|
|
37
33
|
<field name="model">sale.blanket.order.line</field>
|
|
38
34
|
<field name="priority" eval="20" />
|
|
39
35
|
<field name="arch" type="xml">
|
|
40
|
-
<form string="Sale Blanket Order Line" duplicate="false">
|
|
36
|
+
<form string="Sale Blanket Order Line" duplicate="false" create="false">
|
|
41
37
|
<sheet>
|
|
42
38
|
<h1>
|
|
43
39
|
<field name="order_id" />
|
|
44
40
|
</h1>
|
|
45
41
|
<group>
|
|
46
42
|
<group>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/>
|
|
58
|
-
</group>
|
|
43
|
+
<field name="product_id" readonly="1" />
|
|
44
|
+
<field name="price_unit" readonly="1" />
|
|
45
|
+
<field name="partner_id" readonly="1" />
|
|
46
|
+
<field name="date_schedule" readonly="1" />
|
|
47
|
+
<field
|
|
48
|
+
name="company_id"
|
|
49
|
+
groups="base.group_multi_company"
|
|
50
|
+
optional="show"
|
|
51
|
+
options="{'no_create': True}"
|
|
52
|
+
/>
|
|
59
53
|
</group>
|
|
60
54
|
<group>
|
|
61
55
|
<label for="original_uom_qty" />
|
|
@@ -128,18 +122,14 @@
|
|
|
128
122
|
<page name="sale_lines" string="Sale Order Lines">
|
|
129
123
|
<field
|
|
130
124
|
name="sale_lines"
|
|
131
|
-
mode="
|
|
125
|
+
mode="list"
|
|
132
126
|
readonly="1"
|
|
133
127
|
domain="[('product_id', '=', product_id)]"
|
|
134
128
|
/>
|
|
135
129
|
</page>
|
|
136
130
|
</notebook>
|
|
137
131
|
</sheet>
|
|
138
|
-
<
|
|
139
|
-
<field name="message_follower_ids" widget="mail_followers" />
|
|
140
|
-
<field name="activity_ids" widget="mail_activity" />
|
|
141
|
-
<field name="message_ids" widget="mail_thread" />
|
|
142
|
-
</div>
|
|
132
|
+
<chatter />
|
|
143
133
|
</form>
|
|
144
134
|
</field>
|
|
145
135
|
</record>
|
|
@@ -165,7 +155,7 @@
|
|
|
165
155
|
<field name="name">Blanket Order Lines</field>
|
|
166
156
|
<field name="type">ir.actions.act_window</field>
|
|
167
157
|
<field name="res_model">sale.blanket.order.line</field>
|
|
168
|
-
<field name="view_mode">
|
|
158
|
+
<field name="view_mode">list,form</field>
|
|
169
159
|
<field name="search_view_id" ref="sale_blanket_order_line_search" />
|
|
170
160
|
</record>
|
|
171
161
|
|
|
@@ -178,5 +168,4 @@
|
|
|
178
168
|
sequence="21"
|
|
179
169
|
parent="sale.sale_order_menu"
|
|
180
170
|
/>
|
|
181
|
-
|
|
182
171
|
</odoo>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<!-- VIEWS -->
|
|
5
4
|
|
|
6
5
|
<record id="view_blanket_order_tree" model="ir.ui.view">
|
|
7
|
-
<field name="name">sale.blanket.order.
|
|
6
|
+
<field name="name">sale.blanket.order.list</field>
|
|
8
7
|
<field name="model">sale.blanket.order</field>
|
|
9
8
|
<field name="arch" type="xml">
|
|
10
|
-
<
|
|
9
|
+
<list
|
|
11
10
|
decoration-info="state == 'draft'"
|
|
12
11
|
decoration-muted="state == 'expired'"
|
|
13
12
|
>
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
optional="show"
|
|
23
22
|
readonly="1"
|
|
24
23
|
/>
|
|
25
|
-
</
|
|
24
|
+
</list>
|
|
26
25
|
</field>
|
|
27
26
|
</record>
|
|
28
27
|
|
|
@@ -122,7 +121,7 @@
|
|
|
122
121
|
readonly="state in ['open', 'done', 'expired']"
|
|
123
122
|
widget="section_and_note_one2many"
|
|
124
123
|
>
|
|
125
|
-
<
|
|
124
|
+
<list editable="bottom">
|
|
126
125
|
<control>
|
|
127
126
|
<create
|
|
128
127
|
name="add_product_control"
|
|
@@ -205,8 +204,8 @@
|
|
|
205
204
|
<field
|
|
206
205
|
name="taxes_id"
|
|
207
206
|
widget="many2many_tags"
|
|
208
|
-
domain="[('type_tax_use','=','sale')]"
|
|
209
|
-
context="{'
|
|
207
|
+
domain="[('type_tax_use', '=', 'sale'), ('company_id', 'parent_of', parent.company_id)]"
|
|
208
|
+
context="{'search_view_ref': 'account.account_tax_view_search'}"
|
|
210
209
|
options="{'no_create': True}"
|
|
211
210
|
invisible="display_type"
|
|
212
211
|
/>
|
|
@@ -216,7 +215,7 @@
|
|
|
216
215
|
invisible="display_type"
|
|
217
216
|
/>
|
|
218
217
|
<field name="company_id" invisible="1" />
|
|
219
|
-
</
|
|
218
|
+
</list>
|
|
220
219
|
</field>
|
|
221
220
|
<group class="oe_subtotal_footer oe_right">
|
|
222
221
|
<field
|
|
@@ -263,31 +262,22 @@
|
|
|
263
262
|
options="{'no_create': True}"
|
|
264
263
|
/>
|
|
265
264
|
<field name="client_order_ref" />
|
|
265
|
+
<field
|
|
266
|
+
name="tag_ids"
|
|
267
|
+
widget="many2many_tags"
|
|
268
|
+
options="{'color_field': 'color', 'no_create_edit': True}"
|
|
269
|
+
/>
|
|
266
270
|
<field
|
|
267
271
|
name="company_id"
|
|
268
272
|
options="{'no_create': True}"
|
|
269
273
|
groups="base.group_multi_company"
|
|
270
274
|
/>
|
|
271
275
|
</group>
|
|
272
|
-
<group name="invoicing" string="Invoicing">
|
|
273
|
-
<t groups="base.group_multi_company">
|
|
274
|
-
<field
|
|
275
|
-
name="analytic_account_id"
|
|
276
|
-
readonly="sale_count != 0 and state != 'draft'"
|
|
277
|
-
groups="analytic.group_analytic_accounting"
|
|
278
|
-
force_save="1"
|
|
279
|
-
/>
|
|
280
|
-
</t>
|
|
281
|
-
</group>
|
|
282
276
|
</group>
|
|
283
277
|
</page>
|
|
284
278
|
</notebook>
|
|
285
279
|
</sheet>
|
|
286
|
-
<
|
|
287
|
-
<field name="message_follower_ids" />
|
|
288
|
-
<field name="activity_ids" />
|
|
289
|
-
<field name="message_ids" />
|
|
290
|
-
</div>
|
|
280
|
+
<chatter />
|
|
291
281
|
</form>
|
|
292
282
|
</field>
|
|
293
283
|
</record>
|
|
@@ -343,7 +333,7 @@
|
|
|
343
333
|
<field name="name">Blanket Orders</field>
|
|
344
334
|
<field name="type">ir.actions.act_window</field>
|
|
345
335
|
<field name="res_model">sale.blanket.order</field>
|
|
346
|
-
<field name="view_mode">
|
|
336
|
+
<field name="view_mode">list,form</field>
|
|
347
337
|
<field name="search_view_id" ref="view_blanket_order_search" />
|
|
348
338
|
<field name="domain">[]</field>
|
|
349
339
|
<field name="context">{}</field>
|
|
@@ -368,5 +358,4 @@
|
|
|
368
358
|
sequence="20"
|
|
369
359
|
action="act_open_blanket_order_view"
|
|
370
360
|
/>
|
|
371
|
-
|
|
372
361
|
</odoo>
|