mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
[MIG] stock_picking_report_undelivered_product: Migration to v15.0
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../stock_picking_report_undelivered_product
|
||||
6
setup/stock_picking_report_undelivered_product/setup.py
Normal file
6
setup/stock_picking_report_undelivered_product/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -14,13 +14,13 @@ Stock picking report undelivered products
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/stock-logistics-reporting/tree/13.0/stock_picking_report_undelivered_product
|
||||
:target: https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_undelivered_product
|
||||
:alt: OCA/stock-logistics-reporting
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-13-0/stock-logistics-reporting-13-0-stock_picking_report_undelivered_product
|
||||
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-15-0/stock-logistics-reporting-15-0-stock_picking_report_undelivered_product
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/151/13.0
|
||||
:target: https://runbot.odoo-community.org/runbot/151/15.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
@@ -65,7 +65,7 @@ Bug Tracker
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-reporting/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/stock-logistics-reporting/issues/new?body=module:%20stock_picking_report_undelivered_product%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/stock-logistics-reporting/issues/new?body=module:%20stock_picking_report_undelivered_product%0Aversion:%2015.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.
|
||||
|
||||
@@ -98,6 +98,6 @@ 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.
|
||||
|
||||
This module is part of the `OCA/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/13.0/stock_picking_report_undelivered_product>`_ project on GitHub.
|
||||
This module is part of the `OCA/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_undelivered_product>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "Stock picking report undelivered products",
|
||||
"summary": "Display on picking report delivery slip undelivered products",
|
||||
"version": "13.0.1.0.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Tecnativa,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-reporting",
|
||||
"category": "Warehouse",
|
||||
|
||||
@@ -2,3 +2,4 @@ from . import product_template
|
||||
from . import res_config_settings
|
||||
from . import res_partner
|
||||
from . import stock_move
|
||||
from . import stock_move_line
|
||||
|
||||
@@ -7,6 +7,4 @@ from odoo import fields, models
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
display_undelivered_in_picking = fields.Boolean(
|
||||
string="Display undelivered in picking", default=True
|
||||
)
|
||||
display_undelivered_in_picking = fields.Boolean(default=True)
|
||||
|
||||
@@ -8,17 +8,6 @@ class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
undelivered_product_slip_report_method = fields.Selection(
|
||||
[
|
||||
("all", "Display all undelivered product lines"),
|
||||
(
|
||||
"partially_undelivered",
|
||||
"Display only partially undelivered product lines",
|
||||
),
|
||||
(
|
||||
"completely_undelivered",
|
||||
"Display only completely undelivered product lines",
|
||||
),
|
||||
],
|
||||
string="Method to display undelivered product lines in report picking",
|
||||
related="company_id.undelivered_product_slip_report_method",
|
||||
readonly=False,
|
||||
|
||||
@@ -7,6 +7,4 @@ from odoo import fields, models
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
display_undelivered_in_picking = fields.Boolean(
|
||||
string="Display undelivered in picking", default=True
|
||||
)
|
||||
display_undelivered_in_picking = fields.Boolean(default=True)
|
||||
|
||||
@@ -15,6 +15,6 @@ class StockMove(models.Model):
|
||||
"""
|
||||
Store origin stock move which create splitted move.
|
||||
"""
|
||||
vals = super(StockMove, self)._prepare_move_split_vals(qty)
|
||||
vals = super()._prepare_move_split_vals(qty)
|
||||
vals["splitted_stock_move_orig_id"] = self.id
|
||||
return vals
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright 2022 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = "stock.move.line"
|
||||
|
||||
def _get_aggregated_product_quantities(self, **kwargs):
|
||||
"""Odoo displays products non delivered in main table.
|
||||
So I remove key from it to be displayed in the bottom table
|
||||
"""
|
||||
aggregated_move_lines = super()._get_aggregated_product_quantities(**kwargs)
|
||||
keys_to_remove = set()
|
||||
for aggregated_move_line in aggregated_move_lines:
|
||||
if not aggregated_move_lines[aggregated_move_line]["qty_done"]:
|
||||
keys_to_remove.add(aggregated_move_line)
|
||||
# To avoid change dict size on iteration
|
||||
for key_to_remmove in keys_to_remove:
|
||||
aggregated_move_lines.pop(key_to_remmove, None)
|
||||
return aggregated_move_lines
|
||||
@@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-reporting/tree/13.0/stock_picking_report_undelivered_product"><img alt="OCA/stock-logistics-reporting" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-reporting-13-0/stock-logistics-reporting-13-0-stock_picking_report_undelivered_product"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/151/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_undelivered_product"><img alt="OCA/stock-logistics-reporting" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-reporting-15-0/stock-logistics-reporting-15-0-stock_picking_report_undelivered_product"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/151/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module extends the functionality of stock module to allow to
|
||||
display undelivered products in the delivery slip report.</p>
|
||||
<p>You have three options to display lines:</p>
|
||||
@@ -414,7 +414,7 @@ completely lines).</li>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-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 smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-reporting/issues/new?body=module:%20stock_picking_report_undelivered_product%0Aversion:%2013.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/stock-logistics-reporting/issues/new?body=module:%20stock_picking_report_undelivered_product%0Aversion:%2015.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">
|
||||
@@ -445,7 +445,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-reporting/tree/13.0/stock_picking_report_undelivered_product">OCA/stock-logistics-reporting</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_undelivered_product">OCA/stock-logistics-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>
|
||||
|
||||
@@ -75,7 +75,9 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
def _transfer_picking_no_backorder(self, picking):
|
||||
# Transfer picking with no create backorder option
|
||||
backorder_wizard = self.BackOrderWiz.create({"pick_ids": [(4, picking.id)]})
|
||||
backorder_wizard.process_cancel_backorder()
|
||||
backorder_wizard.with_context(
|
||||
button_validate_picking_ids=picking.id
|
||||
).process_cancel_backorder()
|
||||
|
||||
def test_displayed_customer(self):
|
||||
picking = self._create_picking(self.partner_display)
|
||||
@@ -86,7 +88,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertIn("undelivered_product", str(res[0]))
|
||||
|
||||
@@ -99,7 +101,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertNotIn("undelivered_product", str(res[0]))
|
||||
|
||||
@@ -115,7 +117,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertNotIn("undelivered_product", str(res[0]))
|
||||
|
||||
@@ -162,7 +164,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertIn("test02", str(res[0]))
|
||||
|
||||
@@ -171,7 +173,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertIn("test02", str(res[0]))
|
||||
|
||||
@@ -182,7 +184,7 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertNotIn("test02", str(res[0]))
|
||||
|
||||
@@ -193,6 +195,6 @@ class TestStockPickingReportUndeliveredProduct(common.TransactionCase):
|
||||
res = (
|
||||
self.env["ir.actions.report"]
|
||||
._get_report_from_name("stock.report_deliveryslip")
|
||||
.render_qweb_html(picking.ids)
|
||||
._render_qweb_html(picking.ids)
|
||||
)
|
||||
self.assertNotIn("partially_undelivered_line", str(res[0]))
|
||||
|
||||
Reference in New Issue
Block a user