Skip to content

Commit

Permalink
[MIG][17.0]sale_backorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Vandan-OSI committed May 17, 2024
1 parent 71802ce commit 8d1ad53
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 70 deletions.
44 changes: 23 additions & 21 deletions sale_backorder/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@ Sale Backorder Report
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/sale-reporting/tree/14.0/sale_backorder
:target: https://github.com/OCA/sale-reporting/tree/17.0/sale_backorder
:alt: OCA/sale-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-reporting-14-0/sale-reporting-14-0-sale_backorder
:target: https://translation.odoo-community.org/projects/sale-reporting-17-0/sale-reporting-17-0-sale_backorder
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-reporting&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-reporting&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds the ability to view UIGD and Backordered products on Sales Oders.
The quantity and the value of both UIGD and Backordered products is computed for
sales order lines and then aggregated for display on the parent sales order.
This module adds the ability to view UIGD and Backordered products on
Sales Oders. The quantity and the value of both UIGD and Backordered
products is computed for sales order lines and then aggregated for
display on the parent sales order.

**Table of contents**

Expand All @@ -40,44 +41,45 @@ sales order lines and then aggregated for display on the parent sales order.
Usage
=====

* Go to Sales > Orders > SO Backorders. This will display a tree view
of all sale order lines with their Un-Invoiced Goods Delivered (UIGD) and
Backorder information as well as the last date delivered and the last date billed.
* Use the Backorders report menu to print a report.
- Go to Sales > Orders > SO Backorders. This will display a tree view
of all sale order lines with their Un-Invoiced Goods Delivered (UIGD)
and Backorder information as well as the last date delivered and the
last date billed.
- Use the Backorders report menu to print a report.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-reporting/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-reporting/issues/new?body=module:%20sale_backorder%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-reporting/issues/new?body=module:%20sale_backorder%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~
-------

* Open Source Integrators

Contributors
~~~~~~~~~~~~
------------

* Balaji Kannan <[email protected]>
* Sandip Mangukiya <[email protected]>
* Serpent Consulting Services Pvt. Ltd. <[email protected]>
* Freni Patel <[email protected]>
- Balaji Kannan <[email protected]>
- Sandip Mangukiya <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Freni Patel <[email protected]>

Other credits
~~~~~~~~~~~~~
-------------

* Open Source Integrators <https://www.opensourceintegrators.com>
- Open Source Integrators <https://www.opensourceintegrators.com>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -97,6 +99,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-smangukiya|

This module is part of the `OCA/sale-reporting <https://github.com/OCA/sale-reporting/tree/14.0/sale_backorder>`_ project on GitHub.
This module is part of the `OCA/sale-reporting <https://github.com/OCA/sale-reporting/tree/17.0/sale_backorder>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion sale_backorder/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Sale Backorder Report",
"version": "14.0.1.0.0",
"version": "17.0.1.0.0",
"license": "LGPL-3",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"summary": "Report of Un-Invoice Goods Delivered and Backorders",
Expand Down
14 changes: 4 additions & 10 deletions sale_backorder/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ class SaleOrder(models.Model):
_inherit = "sale.order"

last_date_delivered = fields.Datetime(
string="Last Date Delivered", compute="_compute_last_date_delivered", store=True
)
last_bill_date = fields.Datetime(
string="Last Bill Date", compute="_compute_last_bill_date", store=True
)
uigd_value = fields.Monetary(
string="UIGD Value", compute="_compute_uigd_value", store=True
)
bo_value = fields.Monetary(
string="Backorder Value", compute="_compute_bo_value", store=True
compute="_compute_last_date_delivered", store=True
)
last_bill_date = fields.Datetime(compute="_compute_last_bill_date", store=True)
uigd_value = fields.Monetary(compute="_compute_uigd_value", store=True)
bo_value = fields.Monetary(compute="_compute_bo_value", store=True)

@api.depends("order_line.uigd_value")
def _compute_uigd_value(self):
Expand Down
6 changes: 2 additions & 4 deletions sale_backorder/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

last_date_delivered = fields.Datetime(
string="Last Date Delivered", compute="_compute_last_date_delivered", store=True
)
last_bill_date = fields.Datetime(
string="Last Bill Date", compute="_compute_last_bill_date", store=True
compute="_compute_last_date_delivered", store=True
)
last_bill_date = fields.Datetime(compute="_compute_last_bill_date", store=True)
uigd_qty = fields.Float(
string="Uninvoiced Goods Delivered Qty",
compute="_compute_uigd_qty",
Expand Down
3 changes: 3 additions & 0 deletions sale_backorder/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions sale_backorder/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Balaji Kannan \<<[email protected]>\>
- Sandip Mangukiya \<<[email protected]>\>
- Serpent Consulting Services Pvt. Ltd. \<<[email protected]>\>
- Freni Patel \<<[email protected]>\>
4 changes: 0 additions & 4 deletions sale_backorder/readme/CONTRIBUTORS.rst

This file was deleted.

1 change: 1 addition & 0 deletions sale_backorder/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Open Source Integrators \<<https://www.opensourceintegrators.com>\>
1 change: 0 additions & 1 deletion sale_backorder/readme/CREDITS.rst

This file was deleted.

4 changes: 4 additions & 0 deletions sale_backorder/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module adds the ability to view UIGD and Backordered products on
Sales Oders. The quantity and the value of both UIGD and Backordered
products is computed for sales order lines and then aggregated for
display on the parent sales order.
3 changes: 0 additions & 3 deletions sale_backorder/readme/DESCRIPTION.rst

This file was deleted.

5 changes: 5 additions & 0 deletions sale_backorder/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Go to Sales \> Orders \> SO Backorders. This will display a tree view
of all sale order lines with their Un-Invoiced Goods Delivered (UIGD)
and Backorder information as well as the last date delivered and the
last date billed.
- Use the Backorders report menu to print a report.
4 changes: 0 additions & 4 deletions sale_backorder/readme/USAGE.rst

This file was deleted.

30 changes: 17 additions & 13 deletions sale_backorder/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,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 @@ -275,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 @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

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

span.section-subtitle {
Expand Down Expand Up @@ -369,10 +369,11 @@ <h1 class="title">Sale Backorder Report</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4aa620402ed30bcb27b76dc844f0671da0b374241e29c798a3e41223247eb371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-reporting/tree/14.0/sale_backorder"><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-14-0/sale-reporting-14-0-sale_backorder"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the ability to view UIGD and Backordered products on Sales Oders.
The quantity and the value of both UIGD and Backordered products is computed for
sales order lines and then aggregated for display on the parent sales order.</p>
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-reporting/tree/17.0/sale_backorder"><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-17-0/sale-reporting-17-0-sale_backorder"><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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the ability to view UIGD and Backordered products on
Sales Oders. The quantity and the value of both UIGD and Backordered
products is computed for sales order lines and then aggregated for
display on the parent sales order.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -391,8 +392,9 @@ <h1 class="title">Sale Backorder Report</h1>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ul class="simple">
<li>Go to Sales &gt; Orders &gt; SO Backorders. This will display a tree view
of all sale order lines with their Un-Invoiced Goods Delivered (UIGD) and
Backorder information as well as the last date delivered and the last date billed.</li>
of all sale order lines with their Un-Invoiced Goods Delivered (UIGD)
and Backorder information as well as the last date delivered and the
last date billed.</li>
<li>Use the Backorders report menu to print a report.</li>
</ul>
</div>
Expand All @@ -401,7 +403,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-reporting/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/sale-reporting/issues/new?body=module:%20sale_backorder%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-reporting/issues/new?body=module:%20sale_backorder%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -430,13 +432,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">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>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/smangukiya"><img alt="smangukiya" src="https://github.com/smangukiya.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-reporting/tree/14.0/sale_backorder">OCA/sale-reporting</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-reporting/tree/17.0/sale_backorder">OCA/sale-reporting</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down
16 changes: 7 additions & 9 deletions sale_backorder/tests/test_sale_backorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class TestSaleBackorderCommon(TransactionCase):
def setUp(self):
super(TestSaleBackorderCommon, self).setUp()
super().setUp()
self.SaleOrder = self.env["sale.order"]
self.sobackorder_wiz = self.env["sobackorder.report.wizard"]
self.fsm_per_order_1 = self.env["product.product"].create(
Expand Down Expand Up @@ -117,16 +117,14 @@ def test_sale_order(self):

def test_sale_order_order_line(self):
self.sale_order_1.action_confirm()
self.context = {
"active_model": "sale.order",
"active_ids": [self.sale_order_1.id],
"active_id": self.sale_order_1.id,
"default_journal_id": self.default_journal_sale.id,
}

downpayment = (
self.env["sale.advance.payment.inv"]
.with_context(self.context)
.with_context(
active_model="sale.order",
active_ids=[self.sale_order_1.id],
active_id=self.sale_order_1.id,
default_journal_id=self.default_journal_sale.id,
)
.create(
{
"advance_payment_method": "fixed",
Expand Down

0 comments on commit 8d1ad53

Please sign in to comment.