Skip to content

Commit

Permalink
Merge PR #275 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed Jun 19, 2024
2 parents 8ebba2e + 9034b2f commit dbaa197
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
4 changes: 4 additions & 0 deletions sale_report_delivered/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Sale Report Delivered
Adds subtotal price based on the delivered quantities field to the
*Sales Report*.

This module takes in consideration Outgoing, Returns and Dropship.

**Table of contents**

.. contents::
Expand Down Expand Up @@ -68,6 +70,8 @@ Contributors
* Sergio Teruel
* Carlos Dauden

* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)

Maintainers
~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions sale_report_delivered/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

* Sergio Teruel
* Carlos Dauden

* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)
2 changes: 2 additions & 0 deletions sale_report_delivered/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Adds subtotal price based on the delivered quantities field to the
*Sales Report*.

This module takes in consideration Outgoing, Returns and Dropship.
25 changes: 19 additions & 6 deletions sale_report_delivered/reports/sale_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ def _sub_select(self):
t.uom_id as product_uom,
cur.decimal_places,
CASE
WHEN (source_location.usage = 'internal' AND dest_location.usage = 'customer')
or dest_location.usage IS NULL
WHEN dest_location.usage IS NULL
THEN 1
WHEN dest_location.usage = 'internal' AND source_location.usage = 'customer'
WHEN source_location.usage = 'internal' AND dest_location.usage = 'customer'
THEN 1
WHEN source_location.usage = 'customer' AND dest_location.usage = 'internal'
THEN -1
WHEN source_location.usage = 'supplier' AND dest_location.usage = 'customer'
THEN 1
WHEN source_location.usage = 'customer' AND dest_location.usage = 'supplier'
THEN -1
ELSE 0
END AS signed_qty,
Expand Down Expand Up @@ -171,14 +176,22 @@ def _from(self):
return from_str

def _where(self):
"""Take into account only stock moves from internal locations to other
locations and moves from customer with the field 'to_refund' True
"""Take into account only stock moves from:
Outgoing: Internal to Customer
Returns: Customer to Internal + to_refund
Dropship: Supplier to Customer
Dropship return: Customer to Supplier
"""
return """
WHERE (sm.state = 'done' OR sm.state IS NULL) AND (
(source_location.usage = 'internal' AND dest_location.usage = 'customer') OR
(source_location.usage = 'customer' AND dest_location.usage = 'internal'
AND sm.to_refund)
AND sm.to_refund) OR
(source_location.usage = 'supplier' AND dest_location.usage = 'customer'
AND svl.quantity < 0) OR
(source_location.usage = 'customer' AND dest_location.usage = 'supplier'
AND svl.quantity > 0)
)
"""

Expand Down
14 changes: 10 additions & 4 deletions sale_report_delivered/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -371,6 +372,7 @@ <h1 class="title">Sale Report Delivered</h1>
<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-reporting/tree/16.0/sale_report_delivered"><img alt="OCA/sale-reporting" src="https://img.shields.io/badge/github-OCA%2Fsale--reporting-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-reporting-16-0/sale-reporting-16-0-sale_report_delivered"><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-reporting&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Adds subtotal price based on the delivered quantities field to the
<em>Sales Report</em>.</p>
<p>This module takes in consideration Outgoing, Returns and Dropship.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand Down Expand Up @@ -416,12 +418,16 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
</ul>
</blockquote>
</li>
<li><p class="first">Eduardo de Miguel (<a class="reference external" href="https://www.moduon.team/">Moduon</a>)</p>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down

0 comments on commit dbaa197

Please sign in to comment.