Skip to content

Commit

Permalink
[MIG] account_invoice_production_lot: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
heliaktiv committed Aug 25, 2023
1 parent 6d81362 commit f0cd8c6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion account_invoice_production_lot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions account_invoice_production_lot/demo/sale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.</field>
<field name="default_code">001</field>
</record>
<record id="lot_icecream_0" model="stock.production.lot">
<record id="lot_icecream_0" model="stock.lot">
<field name="name">Lot0 for Ice cream</field>
<field name="product_id" ref="product_icecream_b" />
<field name="company_id" ref="base.main_company" />
</record>
<record id="lot_icecream_1" model="stock.production.lot">
<record id="lot_icecream_1" model="stock.lot">
<field name="name">Lot1 for Ice cream</field>
<field name="product_id" ref="product_icecream_b" />
<field name="company_id" ref="base.main_company" />
Expand Down
24 changes: 9 additions & 15 deletions account_invoice_production_lot/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n"
"PO-Revision-Date: 2018-05-10 14:32+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 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 "<b class=\"font-italic\">Serial numbers</b>"
msgstr "<b class=\"font-italic\">Números de sèrie</b>"
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
Expand All @@ -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"
10 changes: 5 additions & 5 deletions account_invoice_production_lot/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <informatica@totmaterial.es>\n"
"PO-Revision-Date: 2021-03-09 10:45+0000\n"
"Last-Translator: Ana Suárez <ana.suarez@qubiq.es>\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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions account_invoice_production_lot/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f0cd8c6

Please sign in to comment.