Skip to content

Commit

Permalink
[MIG] account_invoice_report_grouped_by_picking_sale_mrp: Migration t…
Browse files Browse the repository at this point in the history
…o 15.0
  • Loading branch information
Ernesto Tejeda authored and pedrobaeza committed Aug 10, 2023
1 parent c113853 commit b0d5a1a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Account Invoice Grouped by Picking - Sale MRP",
"summary": "Take into account BoM kits in invoice report " "grouped by picking",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-invoice-reporting",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AccountInvoice(models.Model):
def _get_signed_quantity_done(self, invoice_line, move, sign):
res = super()._get_signed_quantity_done(invoice_line, move, sign)
bom = self.env["mrp.bom"]._bom_find(
product=invoice_line.product_id, company_id=self.company_id.id
)
products=invoice_line.product_id, company_id=self.company_id.id
)[invoice_line.product_id]
if bom and bom.type == "phantom":
bom_line_data = bom.explode(invoice_line.product_id, 1)[1]
res /= sum(map(lambda r: r[1]["qty"], bom_line_data))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

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


class TestReportGroupedSaleMrp(SavepointCase):
class TestReportGroupedSaleMrp(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestReportGroupedSaleMrp, cls).setUpClass()
super().setUpClass()
cls.mrp_bom = cls.env["mrp.bom"]
cls.partner = cls.env["res.partner"].create({"name": "Customer test"})
# create a kit (kit_1) with 2 components
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit b0d5a1a

Please sign in to comment.