Skip to content

Commit b251c21

Browse files
author
Tatiana Deribina
committed
[MIG] sale_delivery_split_date: Migrate to 19.0
1 parent f448433 commit b251c21

8 files changed

Lines changed: 140 additions & 54 deletions

File tree

sale_delivery_split_date/README.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
========================
26
Sale Delivery Split Date
37
========================
@@ -13,17 +17,17 @@ Sale Delivery Split Date
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_delivery_split_date
24+
:target: https://github.com/OCA/sale-workflow/tree/19.0/sale_delivery_split_date
2125
:alt: OCA/sale-workflow
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_delivery_split_date
27+
:target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_delivery_split_date
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +55,7 @@ Bug Tracker
5155
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
5256
In case of trouble, please check there if your issue has already been reported.
5357
If you spotted it first, help us to smash it by providing a detailed and welcomed
54-
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_delivery_split_date%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
58+
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_delivery_split_date%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5559

5660
Do not contact contributors directly about support or help with technical issues.
5761

@@ -69,6 +73,13 @@ Contributors
6973
- Alex Comba <alex.comba@agilebg.com> (https://www.agilebg.com/)
7074
- Carmen Rondon Regalado <crondon@archeti.com>
7175
(https://odoo.archeti.com/)
76+
- Tatiana Deribina <tatiana.deribina@sprintit.fi>
77+
78+
Other credits
79+
-------------
80+
81+
The migration of this module from 18.0 to 19.0 was financially supported
82+
by SprintIT Ltd.
7283

7384
Maintainers
7485
-----------
@@ -83,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8394
mission is to support the collaborative development of Odoo features and
8495
promote its widespread use.
8596

86-
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_delivery_split_date>`_ project on GitHub.
97+
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_delivery_split_date>`_ project on GitHub.
8798

8899
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sale_delivery_split_date/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
{
55
"name": "Sale Delivery Split Date",
6-
"version": "18.0.1.0.0",
6+
"version": "19.0.1.0.0",
77
"summary": "Sale Deliveries split by date",
88
"category": "Sales Management",
99
"license": "AGPL-3",
1010
"author": "Agile Business Group, Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/sale-workflow",
1212
"depends": [
1313
"sale_order_line_date",
14-
"sale_procurement_group_by_line",
14+
"sale_stock_reference_by_line", # ex. sale_procurement_group_by_line
1515
],
1616
"data": [
1717
"views/stock_picking.xml",

sale_delivery_split_date/models/sale_order_line.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,39 @@
1010
class SaleOrderLine(models.Model):
1111
_inherit = "sale.order.line"
1212

13-
def _prepare_procurement_group_vals(self):
14-
vals = super()._prepare_procurement_group_vals()
15-
if self._get_procurement_group_key()[0] == 24:
13+
def _prepare_reference_vals(self):
14+
vals = super()._prepare_reference_vals()
15+
if self._get_stock_reference_key()[0] == 24:
1616
if self.commitment_date:
1717
comm_date = self._get_security_lead_time_commitment_date()
18-
vals["name"] += "/" + format_date(self.env, comm_date.date())
18+
vals["name"] = (
19+
f"{vals['name']}/{format_date(self.env, comm_date.date())}"
20+
)
1921
return vals
2022

21-
def _get_procurement_group_key(self):
23+
def _get_stock_reference_key(self):
2224
"""Return a key with priority to be used to regroup lines in multiple
2325
procurement groups
2426
"""
2527
priority = 24
26-
key = super()._get_procurement_group_key()
28+
key = super()._get_stock_reference_key()
2729
# Check priority
2830
if key[0] < priority:
2931
if self.commitment_date:
3032
# group by date instead of datetime
3133
comm_date = self._get_security_lead_time_commitment_date()
32-
return (priority, comm_date.date())
34+
key = (priority, comm_date.date())
3335
return key
3436

35-
def _prepare_procurement_values(self, group_id=False):
36-
vals = super()._prepare_procurement_values(group_id=group_id)
37-
if self.commitment_date:
37+
def _prepare_procurement_values(self):
38+
vals = super()._prepare_procurement_values()
39+
line_com_date = self.commitment_date
40+
if line_com_date:
3841
comm_date = self._get_security_lead_time_commitment_date()
39-
vals.update({"date_planned": comm_date})
42+
vals.update(
43+
date_planned=comm_date,
44+
date_deadline=line_com_date,
45+
)
4046
return vals
4147

4248
def _get_security_lead_time_commitment_date(self):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
- Alex Comba \<<alex.comba@agilebg.com>\> (<https://www.agilebg.com/>)
22
- Carmen Rondon Regalado \<<crondon@archeti.com>\>
33
(<https://odoo.archeti.com/>)
4+
- Tatiana Deribina \<<tatiana.deribina@sprintit.fi>\>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The migration of this module from 18.0 to 19.0 was financially supported
2+
by SprintIT Ltd.

sale_delivery_split_date/static/description/index.html

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Sale Delivery Split Date</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="sale-delivery-split-date">
364-
<h1 class="title">Sale Delivery Split Date</h1>
363+
<div class="document">
365364

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-delivery-split-date">
370+
<h1>Sale Delivery Split Date</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:69652f1972b11818ac88de151e78405313708c3ac7722d9f26939bfa20c21a44
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/18.0/sale_delivery_split_date"><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-18-0/sale-workflow-18-0-sale_delivery_split_date"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
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-workflow/tree/19.0/sale_delivery_split_date"><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-19-0/sale-workflow-19-0-sale_delivery_split_date"><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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>When this module is installed, each sale order you confirm will generate
374379
one delivery order per requested date indicated in the sale order lines.</p>
375380
<p>Furthermore, the delivery orders can be searched by selecting the
@@ -382,55 +387,63 @@ <h1 class="title">Sale Delivery Split Date</h1>
382387
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
383388
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
384389
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
385-
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
390+
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
391+
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
386392
</ul>
387393
</li>
388394
</ul>
389395
</div>
390396
<div class="section" id="known-issues-roadmap">
391-
<h1><a class="toc-backref" href="#toc-entry-1">Known issues / Roadmap</a></h1>
397+
<h2><a class="toc-backref" href="#toc-entry-1">Known issues / Roadmap</a></h2>
392398
<ul class="simple">
393399
<li>Incompatible with
394400
<a class="reference external" href="https://github.com/OCA/sale-workflow/tree/12.0/sale_procurement_group_by_commitment_date">sale_procurement_group_by_commitment_date</a></li>
395401
</ul>
396402
</div>
397403
<div class="section" id="bug-tracker">
398-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
404+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
399405
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
400406
In case of trouble, please check there if your issue has already been reported.
401407
If you spotted it first, help us to smash it by providing a detailed and welcomed
402-
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_delivery_split_date%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
408+
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_delivery_split_date%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403409
<p>Do not contact contributors directly about support or help with technical issues.</p>
404410
</div>
405411
<div class="section" id="credits">
406-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
412+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
407413
<div class="section" id="authors">
408-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
414+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
409415
<ul class="simple">
410416
<li>Agile Business Group</li>
411417
</ul>
412418
</div>
413419
<div class="section" id="contributors">
414-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
420+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
415421
<ul class="simple">
416422
<li>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>)</li>
417423
<li>Carmen Rondon Regalado &lt;<a class="reference external" href="mailto:crondon&#64;archeti.com">crondon&#64;archeti.com</a>&gt;
418424
(<a class="reference external" href="https://odoo.archeti.com/">https://odoo.archeti.com/</a>)</li>
425+
<li>Tatiana Deribina &lt;<a class="reference external" href="mailto:tatiana.deribina&#64;sprintit.fi">tatiana.deribina&#64;sprintit.fi</a>&gt;</li>
419426
</ul>
420427
</div>
428+
<div class="section" id="other-credits">
429+
<h3><a class="toc-backref" href="#toc-entry-6">Other credits</a></h3>
430+
<p>The migration of this module from 18.0 to 19.0 was financially supported
431+
by SprintIT Ltd.</p>
432+
</div>
421433
<div class="section" id="maintainers">
422-
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
434+
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
423435
<p>This module is maintained by the OCA.</p>
424436
<a class="reference external image-reference" href="https://odoo-community.org">
425437
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
426438
</a>
427439
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
428440
mission is to support the collaborative development of Odoo features and
429441
promote its widespread use.</p>
430-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_delivery_split_date">OCA/sale-workflow</a> project on GitHub.</p>
442+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/19.0/sale_delivery_split_date">OCA/sale-workflow</a> project on GitHub.</p>
431443
<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>
432444
</div>
433445
</div>
434446
</div>
447+
</div>
435448
</body>
436449
</html>

0 commit comments

Comments
 (0)