Skip to content

Commit

Permalink
[MIG] stock_picking_invoice_link: Migration to 18.0
Browse files Browse the repository at this point in the history
[MIG] stock_picking_invoice_link: Migration to 18.0

[MIG] stock_picking_invoice_link: Migration to 18.0

[MIG] stock_picking_invoice_link: Migration to 18.0

[MIG] stock_picking_invoice_link: Migration to 18.0

[MIG] stock_picking_invoice_link: Migration to 18.0
  • Loading branch information
carlosdynapps committed Nov 12, 2024
1 parent a997edf commit 44aa4e4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions stock_picking_invoice_link/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Stock Picking Invoice Link
: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--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_invoice_link
:target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_invoice_link
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_invoice_link
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_picking_invoice_link
: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/stock-logistics-workflow&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -62,7 +62,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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/stock-logistics-workflow/issues/new?body=module:%20stock_picking_invoice_link%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_invoice_link%0Aversion:%2018.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.

Expand Down Expand Up @@ -132,6 +132,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-workflow <https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_invoice_link>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_invoice_link>`_ 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 stock_picking_invoice_link/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{
"name": "Stock Picking Invoice Link",
"version": "17.0.1.2.3",
"version": "18.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between pickings and invoices",
"author": "Agile Business Group, "
Expand Down
23 changes: 11 additions & 12 deletions stock_picking_invoice_link/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright 2020 Manuel Calero - Tecnativa
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, fields, models
from odoo import Command, api, fields, models


class AccountMove(models.Model):
Expand Down Expand Up @@ -72,14 +72,13 @@ class AccountMoveLine(models.Model):
)

def copy_data(self, default=None):
"""Copy the move_line_ids in case of refund invoice creating a new invoice
(refund_method="modify").
"""
self.ensure_one()
res = super().copy_data(default=default)
if (
self.env.context.get("force_copy_stock_moves")
and "move_line_ids" not in res
):
res[0]["move_line_ids"] = [(6, 0, self.move_line_ids.ids)]
return res
"""Copy the move_line_ids in case of refund invoice creating new invoices
(refund_method="modify") for multiple records."""
vals_list = super().copy_data(default)

if self.env.context.get("force_copy_stock_moves"):
for record, vals in zip(self, vals_list, strict=False):
if "move_line_ids" not in vals:
vals["move_line_ids"] = Command.set(record.move_line_ids.ids)

return vals_list
6 changes: 3 additions & 3 deletions stock_picking_invoice_link/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Stock Picking Invoice Link</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b84770438e83e728fc3e438a5542c07883adb15b786fff744733439c6992bcd4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/stock-logistics-workflow/tree/17.0/stock_picking_invoice_link"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_invoice_link"><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/stock-logistics-workflow&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><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/stock-logistics-workflow/tree/18.0/stock_picking_invoice_link"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_picking_invoice_link"><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/stock-logistics-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>
<p>This module adds a link between pickings and invoices as well as on the
lines. Invoices are generated from sales orders. With this module, you
can find back which deliveries an invoice relates to.</p>
Expand Down Expand Up @@ -409,7 +409,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/stock-logistics-workflow/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/stock-logistics-workflow/issues/new?body=module:%20stock_picking_invoice_link%0Aversion:%2017.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-workflow/issues/new?body=module:%20stock_picking_invoice_link%0Aversion:%2018.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 @@ -475,7 +475,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<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-workflow/tree/17.0/stock_picking_invoice_link">OCA/stock-logistics-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_invoice_link">OCA/stock-logistics-workflow</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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def _create_sale_order_and_confirm(cls):

@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
super().setUpClass()
cls.setup_chart_template(chart_template_ref)
for _, i in cls.company_data.items():
if "type" in i and i.type == "product":
cls._update_product_qty(i)
Expand Down Expand Up @@ -183,7 +184,7 @@ def test_00_sale_stock_invoice_link(self):
inv_3 = inv_1.copy()
inv_3.picking_ids |= pick_1
result = pick_1.action_view_invoice()
self.assertEqual(result["views"][0][1], "tree")
self.assertEqual(result["views"][0][1], "list")

# Cancel invoice and invoice
inv_1.button_cancel()
Expand Down Expand Up @@ -236,7 +237,7 @@ def test_return_picking_to_refund(self):
).unlink()
return_wiz.product_return_moves.quantity = 1.0
return_wiz.product_return_moves.to_refund = True
res = return_wiz.create_returns()
res = return_wiz.action_create_returns()
return_pick = self.env["stock.picking"].browse(res["res_id"])
# Validate picking
return_pick.move_ids.quantity = 1.0
Expand Down Expand Up @@ -365,7 +366,7 @@ def test_return_and_invoice_refund(self):
).unlink()
return_wiz.product_return_moves.quantity = 1.0
return_wiz.product_return_moves.to_refund = True
res = return_wiz.create_returns()
res = return_wiz.action_create_returns()
return_pick = self.env["stock.picking"].browse(res["res_id"])
# Validate picking
return_pick.move_ids.quantity = 1.0
Expand Down
4 changes: 2 additions & 2 deletions stock_picking_invoice_link/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<field name="picking_count" widget="statinfo" string="Delivery" />
</button>
</div>
<xpath expr="//field[@name='invoice_line_ids']//tree" position="inside">
<xpath expr="//field[@name='invoice_line_ids']//list" position="inside">
<field name="move_line_ids" force_save="1" column_invisible="1" />
</xpath>
<xpath expr="//field[@name='line_ids']//tree" position="inside">
<xpath expr="//field[@name='line_ids']//list" position="inside">
<field name="move_line_ids" force_save="1" column_invisible="1" />
</xpath>
</field>
Expand Down

0 comments on commit 44aa4e4

Please sign in to comment.