From f0cd8c666b433c6550ba52741b53a8df649d84f2 Mon Sep 17 00:00:00 2001 From: heliaktiv Date: Fri, 25 Aug 2023 14:57:16 +0530 Subject: [PATCH] [MIG] account_invoice_production_lot: Migration to 16.0 --- .../__manifest__.py | 2 +- account_invoice_production_lot/demo/sale.xml | 4 ++-- account_invoice_production_lot/i18n/ca.po | 24 +++++++------------ account_invoice_production_lot/i18n/es.po | 10 ++++---- .../models/account_invoice.py | 4 +--- .../tests/test_invoice_production_lot.py | 16 ++++++------- 6 files changed, 26 insertions(+), 34 deletions(-) diff --git a/account_invoice_production_lot/__manifest__.py b/account_invoice_production_lot/__manifest__.py index 643620370..d78fae932 100644 --- a/account_invoice_production_lot/__manifest__.py +++ b/account_invoice_production_lot/__manifest__.py @@ -7,7 +7,7 @@ { "name": "Invoice Production Lots", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "author": "Agile Business Group," "Tecnativa," "Odoo Community Association (OCA)", "summary": "Display delivered serial numbers in invoice", "website": "https://github.com/OCA/account-invoice-reporting", diff --git a/account_invoice_production_lot/demo/sale.xml b/account_invoice_production_lot/demo/sale.xml index 902f97f04..25ad86a1b 100644 --- a/account_invoice_production_lot/demo/sale.xml +++ b/account_invoice_production_lot/demo/sale.xml @@ -18,12 +18,12 @@ >Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events. 001 - + Lot0 for Ice cream - + Lot1 for Ice cream diff --git a/account_invoice_production_lot/i18n/ca.po b/account_invoice_production_lot/i18n/ca.po index 9492ee684..b6bdd7b79 100644 --- a/account_invoice_production_lot/i18n/ca.po +++ b/account_invoice_production_lot/i18n/ca.po @@ -9,26 +9,25 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-05-10 14:32+0000\n" -"PO-Revision-Date: 2023-06-23 09:08+0000\n" -"Last-Translator: eccit-quim \n" +"PO-Revision-Date: 2018-05-10 14:32+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_invoice_production_lot #: model_terms:ir.ui.view,arch_db:account_invoice_production_lot.account_invoice_production_lot_report msgid "Serial numbers" -msgstr "Números de sèrie" +msgstr "" #. module: account_invoice_production_lot #: model:product.product,name:account_invoice_production_lot.product_icecream_b #: model:product.template,name:account_invoice_production_lot.product_icecream_b_product_template msgid "Ice Cream B" -msgstr "Gelat B" +msgstr "" #. module: account_invoice_production_lot #: model_terms:product.product,description:account_invoice_production_lot.product_icecream_b @@ -40,33 +39,28 @@ msgid "" "ice cream shops, convenience stores, and milk bars, and in individual " "servings from small carts or vans at public events." msgstr "" -"El gelat es pot produir en massa i, per tant, està àmpliament disponible a " -"les parts desenvolupades del món. El gelat es pot comprar en caixes grans (" -"cubes i caixes quadrades) a supermercats i botigues, en quantitats més " -"petites a gelateries, botigues de conveniència i botigues locals, i en " -"porcions individuals en carrets petits o camionetes en esdeveniments públics." #. module: account_invoice_production_lot #: model:ir.model,name:account_invoice_production_lot.model_account_move_line msgid "Journal Item" -msgstr "Assentament Comptable" +msgstr "" #. module: account_invoice_production_lot #: model:ir.model.fields,field_description:account_invoice_production_lot.field_account_move_line__prod_lot_ids #: model_terms:ir.ui.view,arch_db:account_invoice_production_lot.view_move_form msgid "Production Lots" -msgstr "Lots/Nº de Sèrie" +msgstr "" #. module: account_invoice_production_lot #: model_terms:ir.ui.view,arch_db:account_invoice_production_lot.account_invoice_production_lot_report msgid "S/N:" -msgstr "S/N:" +msgstr "" #. module: account_invoice_production_lot #: model:product.product,uom_name:account_invoice_production_lot.product_icecream_b #: model:product.template,uom_name:account_invoice_production_lot.product_icecream_b_product_template msgid "Units" -msgstr "Unitat" +msgstr "" #~ msgid "Invoice Line" #~ msgstr "Línia factura" diff --git a/account_invoice_production_lot/i18n/es.po b/account_invoice_production_lot/i18n/es.po index fa26a7283..92fa0399d 100644 --- a/account_invoice_production_lot/i18n/es.po +++ b/account_invoice_production_lot/i18n/es.po @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-09-08 11:33+0000\n" -"PO-Revision-Date: 2023-07-29 10:09+0000\n" -"Last-Translator: Ivorra78 \n" +"PO-Revision-Date: 2021-03-09 10:45+0000\n" +"Last-Translator: Ana Suárez \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"X-Generator: Weblate 4.3.2\n" #. module: account_invoice_production_lot #: model_terms:ir.ui.view,arch_db:account_invoice_production_lot.account_invoice_production_lot_report @@ -48,7 +48,7 @@ msgstr "" #. module: account_invoice_production_lot #: model:ir.model,name:account_invoice_production_lot.model_account_move_line msgid "Journal Item" -msgstr "Artículo diario" +msgstr "" #. module: account_invoice_production_lot #: model:ir.model.fields,field_description:account_invoice_production_lot.field_account_move_line__prod_lot_ids @@ -65,7 +65,7 @@ msgstr "S/N:" #: model:product.product,uom_name:account_invoice_production_lot.product_icecream_b #: model:product.template,uom_name:account_invoice_production_lot.product_icecream_b_product_template msgid "Units" -msgstr "Unidades" +msgstr "" #~ msgid "Invoice Line" #~ msgstr "Linea de factura" diff --git a/account_invoice_production_lot/models/account_invoice.py b/account_invoice_production_lot/models/account_invoice.py index 6eb952e2f..f9a712fe7 100644 --- a/account_invoice_production_lot/models/account_invoice.py +++ b/account_invoice_production_lot/models/account_invoice.py @@ -13,9 +13,7 @@ class AccountMoveLine(models.Model): _inherit = "account.move.line" prod_lot_ids = fields.Many2many( - comodel_name="stock.production.lot", - compute="_compute_prod_lots", - string="Production Lots", + comodel_name="stock.lot", compute="_compute_prod_lots", string="Production Lots" ) @api.depends("move_line_ids") diff --git a/account_invoice_production_lot/tests/test_invoice_production_lot.py b/account_invoice_production_lot/tests/test_invoice_production_lot.py index dd219f57d..d004ea051 100644 --- a/account_invoice_production_lot/tests/test_invoice_production_lot.py +++ b/account_invoice_production_lot/tests/test_invoice_production_lot.py @@ -45,21 +45,21 @@ def setUpClass(cls): line_form.product_id = cls.product2 line_form.product_uom_qty = 1 cls.sale = order_form.save() - cls.lot1 = cls.env["stock.production.lot"].create( + cls.lot1 = cls.env["stock.lot"].create( { "name": "Lot 1", "product_id": cls.product.id, "company_id": cls.user_company.id, } ) - cls.lot2 = cls.env["stock.production.lot"].create( + cls.lot2 = cls.env["stock.lot"].create( { "name": "Lot 2", "product_id": cls.product.id, "company_id": cls.user_company.id, } ) - cls.serial = cls.env["stock.production.lot"].create( + cls.serial = cls.env["stock.lot"].create( { "name": "Serial 1", "product_id": cls.product2.id, @@ -89,8 +89,8 @@ def test_00_sale_stock_invoice_product_lot(self): picking = self.sale.picking_ids[:1] picking.action_confirm() picking.action_assign() - for sml in picking.move_lines.mapped("move_line_ids"): - sml.qty_done = sml.product_qty + for sml in picking.move_ids.mapped("move_line_ids"): + sml.qty_done = sml.reserved_qty picking._action_done() # create invoice invoice = self.sale._create_invoices() @@ -115,7 +115,7 @@ def test_01_sale_stock_delivery_partial_invoice_product_lot(self): picking.action_confirm() picking.action_assign() # deliver partially only one lot - picking.move_lines[0].move_line_ids[0].write({"qty_done": 2.0}) + picking.move_ids[0].move_line_ids[0].write({"qty_done": 2.0}) backorder_wizard_dict = picking.button_validate() backorder_wiz = Form( self.env[backorder_wizard_dict["res_model"]].with_context( @@ -145,8 +145,8 @@ def test_02_sale_stock_delivery_partial_invoice_product_lot(self): picking.action_confirm() picking.action_assign() # deliver partially both lots - picking.move_lines[0].move_line_ids[0].write({"qty_done": 1.0}) - picking.move_lines[0].move_line_ids[1].write({"qty_done": 1.0}) + picking.move_ids[0].move_line_ids[0].write({"qty_done": 1.0}) + picking.move_ids[0].move_line_ids[1].write({"qty_done": 1.0}) backorder_wizard_dict = picking.button_validate() backorder_wiz = Form( self.env[backorder_wizard_dict["res_model"]].with_context(