Skip to content

Commit

Permalink
Merge PR OCA#207 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 10, 2022
2 parents 52c3bf5 + da5a8ad commit 5ffcd2d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 22 deletions.
8 changes: 8 additions & 0 deletions account_invoice_report_grouped_by_picking/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ Usage
#. Invoice report will group invoice lines and show information about sales
and pickings in every group.

Known issues / Roadmap
======================

* As a result of the grouping by pickings, we don't support notes and descriptions.
* Anyways, an invoice with no pickings should be printed as usual. The problem is
that in the current state of the report, a heavy refactoring is needed to be able to
fallback to the regular behavior in such case.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def lines_grouped_by_picking(self):
# Let's get first a correspondence between pickings and sales order
so_dict = {x.sale_id: x for x in self.picking_ids if x.sale_id}
# Now group by picking by direct link or via same SO as picking's one
for line in self.invoice_line_ids:
for line in self.invoice_line_ids.filtered(lambda x: not x.display_type):
remaining_qty = line.quantity
for move in line.move_line_ids:
key = (move.picking_id, line)
Expand Down
4 changes: 4 additions & 0 deletions account_invoice_report_grouped_by_picking/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* As a result of the grouping by pickings, we don't support notes and descriptions.
* Anyways, an invoice with no pickings should be printed as usual. The problem is
that in the current state of the report, a heavy refactoring is needed to be able to
fallback to the regular behavior in such case.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Account Invoice Grouped by Picking</title>
<style type="text/css">

Expand Down Expand Up @@ -378,11 +378,12 @@ <h1 class="title">Account Invoice Grouped by Picking</h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -399,24 +400,33 @@ <h1><a class="toc-backref" href="#id1">Usage</a></h1>
and pickings in every group.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>As a result of the grouping by pickings, we don’t support notes and descriptions.</li>
<li>Anyways, an invoice with no pickings should be printed as usual. The problem is
that in the current state of the report, a heavy refactoring is needed to be able to
fallback to the regular behavior in such case.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoice-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/account-invoice-reporting/issues/new?body=module:%20account_invoice_report_grouped_by_picking%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Carlos Dauden</li>
Expand All @@ -433,7 +443,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id7">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>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lxml import html

from odoo.tests.common import SavepointCase
from odoo.tests.common import Form, SavepointCase


class TestAccountInvoiceGroupPicking(SavepointCase):
Expand Down Expand Up @@ -57,6 +57,16 @@ def setUpClass(cls):
}
)

def get_return_picking_wizard(self, picking):
stock_return_picking_form = Form(
self.env["stock.return.picking"].with_context(
active_ids=picking.ids,
active_id=picking.ids[0],
active_model="stock.picking",
)
)
return stock_return_picking_form.save()

def test_account_invoice_group_picking(self):
# confirm quotation
self.sale.action_confirm()
Expand Down Expand Up @@ -105,15 +115,7 @@ def test_account_invoice_group_picking_return(self):
picking._action_done()
self.sale._create_invoices()
# Return one picking from sale1
wiz_return = (
self.env["stock.return.picking"]
.with_context(
active_model="stock.picking",
active_id=picking.id,
)
.create({})
)
wiz_return._onchange_picking_id()
wiz_return = self.get_return_picking_wizard(picking)
res = wiz_return.create_returns()
picking_return = self.env["stock.picking"].browse(res["res_id"])
picking_return.move_line_ids.write({"qty_done": 1})
Expand Down

0 comments on commit 5ffcd2d

Please sign in to comment.