Skip to content

Commit 4a8715a

Browse files
committed
[IMP] purchase_date_planned_manual: pre-commit auto fixes
1 parent 0b69b72 commit 4a8715a

File tree

7 files changed

+211
-144
lines changed

7 files changed

+211
-144
lines changed

purchase_date_planned_manual/README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Purchase Date Planned Manual
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/purchase-workflow/tree/12.0/purchase_date_planned_manual
20+
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_date_planned_manual
2121
:alt: OCA/purchase-workflow
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_date_planned_manual
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_date_planned_manual
2424
:alt: Translate me on Weblate
2525
.. |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=12.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -64,7 +64,7 @@ Bug Tracker
6464
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
6565
In case of trouble, please check there if your issue has already been reported.
6666
If you spotted it first, help us to smash it by providing a detailed and welcomed
67-
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_date_planned_manual%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
67+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_date_planned_manual%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6868

6969
Do not contact contributors directly about support or help with technical issues.
7070

@@ -102,6 +102,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
102102

103103
|maintainer-lreficent|
104104

105-
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/12.0/purchase_date_planned_manual>`_ project on GitHub.
105+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_date_planned_manual>`_ project on GitHub.
106106

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

purchase_date_planned_manual/__manifest__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
{
66
"name": "Purchase Date Planned Manual",
77
"summary": "This module makes the system to always respect the planned "
8-
"(or scheduled) date in PO lines.",
8+
"(or scheduled) date in PO lines.",
99
"version": "12.0.1.0.0",
1010
"development_status": "Mature",
11-
"author": "Eficent, "
12-
"Odoo Community Association (OCA)",
11+
"author": "Eficent, " "Odoo Community Association (OCA)",
1312
"maintainers": ["lreficent"],
1413
"website": "https://github.com/OCA/purchase-workflow",
1514
"category": "Purchase Management",
1615
"depends": ["purchase_stock"],
1716
"data": [
18-
'views/purchase_order_view.xml',
17+
"views/purchase_order_view.xml",
1918
],
2019
"license": "AGPL-3",
2120
"installable": True,

purchase_date_planned_manual/models/purchase_order.py

+34-25
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
44

55
from dateutil.relativedelta import relativedelta
6-
from odoo import api, fields, models, _
6+
7+
from odoo import _, api, fields, models
78
from odoo.exceptions import UserError
89
from odoo.fields import Datetime as Dt
910

1011

1112
class PurchaseOrderLine(models.Model):
12-
_inherit = 'purchase.order.line'
13+
_inherit = "purchase.order.line"
1314

1415
predicted_arrival_late = fields.Boolean(
15-
string='Planned to be late',
16-
compute='_compute_predicted_arrival_late',
17-
help='True if the arrival at scheduled date is planned to be late. '
18-
'Takes into account the vendor lead time and the company margin '
19-
'for lead times.')
16+
string="Planned to be late",
17+
compute="_compute_predicted_arrival_late",
18+
help="True if the arrival at scheduled date is planned to be late. "
19+
"Takes into account the vendor lead time and the company margin "
20+
"for lead times.",
21+
)
2022

2123
@api.multi
22-
@api.depends('order_id.state')
24+
@api.depends("order_id.state")
2325
def _compute_predicted_arrival_late(self):
2426
"""Colour the lines in red if the products are predicted to arrive
2527
late."""
@@ -28,14 +30,15 @@ def _compute_predicted_arrival_late(self):
2830
partner_id=line.partner_id,
2931
quantity=line.product_qty,
3032
date=line.order_id.date_order.date(),
31-
uom_id=line.product_uom)
33+
uom_id=line.product_uom,
34+
)
3235
order_date = line.order_id.date_order
3336
po_lead = line.order_id.company_id.po_lead
3437
delta = po_lead + seller.delay if seller else po_lead
3538
date_expected = order_date + relativedelta(days=delta)
3639
line.predicted_arrival_late = (
37-
date_expected > line.date_planned and line.order_id.state ==
38-
'draft')
40+
date_expected > line.date_planned and line.order_id.state == "draft"
41+
)
3942

4043
@api.model
4144
def _get_date_planned(self, seller, po=False):
@@ -47,27 +50,33 @@ def _get_date_planned(self, seller, po=False):
4750

4851
@api.multi
4952
def action_delayed_line(self):
50-
raise UserError(_(
51-
'This line is scheduled for: %s. \n However it is now planned to '
52-
'arrive late.') % Dt.to_string(Dt.context_timestamp(
53-
self, self.date_planned)))
53+
raise UserError(
54+
_(
55+
"This line is scheduled for: %s. \n However it is now planned to "
56+
"arrive late."
57+
)
58+
% Dt.to_string(Dt.context_timestamp(self, self.date_planned))
59+
)
5460

55-
def _merge_in_existing_line(self, product_id, product_qty, product_uom,
56-
location_id, name, origin, values):
57-
if self.date_planned == values.get('date_planned'):
61+
def _merge_in_existing_line(
62+
self, product_id, product_qty, product_uom, location_id, name, origin, values
63+
):
64+
if self.date_planned == values.get("date_planned"):
5865
return super(PurchaseOrderLine, self)._merge_in_existing_line(
59-
product_id, product_qty, product_uom,
60-
location_id, name, origin, values)
66+
product_id, product_qty, product_uom, location_id, name, origin, values
67+
)
6168
return False
6269

6370

6471
class StockRule(models.Model):
65-
_inherit = 'stock.rule'
72+
_inherit = "stock.rule"
6673

6774
def _prepare_purchase_order_line(
68-
self, product_id, product_qty, product_uom, values, po, supplier):
75+
self, product_id, product_qty, product_uom, values, po, supplier
76+
):
6977
res = super(StockRule, self)._prepare_purchase_order_line(
70-
product_id, product_qty, product_uom, values, po, supplier)
71-
if values.get('date_planned'):
72-
res['date_planned'] = values.get('date_planned')
78+
product_id, product_qty, product_uom, values, po, supplier
79+
)
80+
if values.get("date_planned"):
81+
res["date_planned"] = values.get("date_planned")
7382
return res

purchase_date_planned_manual/static/description/index.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>
@@ -9,10 +8,11 @@
98

109
/*
1110
:Author: David Goodger (goodger@python.org)
12-
: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 $
1312
:Copyright: This stylesheet has been placed in the public domain.
1413
1514
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1616
1717
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
@@ -275,7 +275,7 @@
275275
margin-left: 2em ;
276276
margin-right: 2em }
277277

278-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
279279
pre.code, code { background-color: #eeeeee }
280280
pre.code .comment, code .comment { color: #5C6576 }
281281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
301301
span.pre {
302302
white-space: pre }
303303

304-
span.problematic {
304+
span.problematic, pre.problematic {
305305
color: red }
306306

307307
span.section-subtitle {
@@ -369,7 +369,7 @@ <h1 class="title">Purchase Date Planned Manual</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:e0e2784d027dacc508451464c226ac5a3bd4b8743f044c12e6ef31562c203479
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/12.0/purchase_date_planned_manual"><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-12-0/purchase-workflow-12-0-purchase_date_planned_manual"><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=12.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="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/16.0/purchase_date_planned_manual"><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-16-0/purchase-workflow-16-0-purchase_date_planned_manual"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module makes the system to always respect the planned (or scheduled)
374374
date set by the user when creating a Purchase Order.</p>
375375
<p>Additionally, this module modifies the PO views and sets in red the lines
@@ -411,7 +411,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
411411
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
412412
In case of trouble, please check there if your issue has already been reported.
413413
If you spotted it first, help us to smash it by providing a detailed and welcomed
414-
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_date_planned_manual%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
414+
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_date_planned_manual%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
415415
<p>Do not contact contributors directly about support or help with technical issues.</p>
416416
</div>
417417
<div class="section" id="credits">
@@ -431,13 +431,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
431431
<div class="section" id="maintainers">
432432
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
433433
<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>
434+
<a class="reference external image-reference" href="https://odoo-community.org">
435+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
436+
</a>
435437
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
436438
mission is to support the collaborative development of Odoo features and
437439
promote its widespread use.</p>
438440
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
439441
<p><a class="reference external image-reference" href="https://github.com/lreficent"><img alt="lreficent" src="https://github.com/lreficent.png?size=40px" /></a></p>
440-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/12.0/purchase_date_planned_manual">OCA/purchase-workflow</a> project on GitHub.</p>
442+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_date_planned_manual">OCA/purchase-workflow</a> project on GitHub.</p>
441443
<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>
442444
</div>
443445
</div>

0 commit comments

Comments
 (0)