-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_barcodes_gs1_secondary_unit: more secondary uom info in b…
…arcodes interface
- Loading branch information
1 parent
516fc84
commit 9fecdaa
Showing
7 changed files
with
158 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,16 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2020-09-07 20:03+0000\n" | ||
"PO-Revision-Date: 2020-09-07 22:19+0200\n" | ||
"POT-Creation-Date: 2023-04-27 17:43+0000\n" | ||
"PO-Revision-Date: 2023-04-27 19:44+0200\n" | ||
"Last-Translator: Sergio Teruel <[email protected]>\n" | ||
"Language-Team: \n" | ||
"Language: es_ES\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Generator: Poedit 2.3\n" | ||
"Last-Translator: Sergio Teruel <[email protected]>\n" | ||
"Language: es_ES\n" | ||
"X-Generator: Poedit 3.0.1\n" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_product_secondary_unit__barcode | ||
|
@@ -51,28 +51,52 @@ msgstr "Unidad Secundaria" | |
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read__product_tmpl_id | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_inventory__product_tmpl_id | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_picking__product_tmpl_id | ||
msgid "Product Template" | ||
msgstr "Plantilla de producto" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_todo__secondary_uom_id | ||
msgid "Second unit" | ||
msgstr "Unidad secundaria" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_todo__secondary_uom_qty | ||
msgid "Secondary Qty" | ||
msgstr "Cdad. secundaria" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_stock_barcodes_read_log__secondary_uom_qty | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read__secondary_uom_qty | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_inventory__secondary_uom_qty | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_picking__secondary_uom_qty | ||
msgid "Secondary UOM Qty" | ||
msgstr "Cta. Ud. secundaria" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read__secondary_single_qty | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_picking__secondary_single_qty | ||
msgid "Secondary single Qty" | ||
msgstr "Cta. Ud. secundaria" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_stock_barcodes_read_log__secondary_uom_id | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read__secondary_uom_id | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_inventory__secondary_uom_id | ||
#: model:ir.model.fields,field_description:stock_barcodes_gs1_secondary_unit.field_wiz_stock_barcodes_read_picking__secondary_uom_id | ||
#: model_terms:ir.ui.view,arch_db:stock_barcodes_gs1_secondary_unit.view_stock_barcodes_read_form | ||
msgid "Secondary uom" | ||
msgstr "Unidad Secundaria" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model,name:stock_barcodes_gs1_secondary_unit.model_wiz_stock_barcodes_read | ||
msgid "Wizard to read barcode" | ||
msgstr "Asistente para leer códigos de barras" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model,name:stock_barcodes_gs1_secondary_unit.model_wiz_stock_barcodes_read_picking | ||
msgid "Wizard to read barcode on picking" | ||
msgstr "Asistente para leer códigos de barras desde los albaranes" | ||
|
||
#. module: stock_barcodes_gs1_secondary_unit | ||
#: model:ir.model,name:stock_barcodes_gs1_secondary_unit.model_wiz_stock_barcodes_read_todo | ||
msgid "Wizard to read barcode todo" | ||
msgstr "Asistente para leer códigos de barras" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
stock_barcodes_gs1_secondary_unit/wizard/stock_barcodes_read_todo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2023 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class WizStockBarcodesReadTodo(models.TransientModel): | ||
_inherit = "wiz.stock.barcodes.read.todo" | ||
|
||
secondary_uom_qty = fields.Float( | ||
string="Secondary Qty", | ||
digits="Product Unit of Measure", | ||
compute="_compute_secondary_uom", | ||
) | ||
secondary_uom_id = fields.Many2one( | ||
comodel_name="product.secondary.unit", | ||
string="Second unit", | ||
compute="_compute_secondary_uom", | ||
) | ||
|
||
def _compute_secondary_uom(self): | ||
for line in self: | ||
moves = line.stock_move_ids or line.line_ids.mapped("move_id") | ||
line.secondary_uom_qty = sum(m.secondary_uom_qty for m in moves) | ||
line.secondary_uom_id = moves.secondary_uom_id[:1] | ||
|
||
@api.model | ||
def fields_to_fill_from_pending_line(self): | ||
res = super().fields_to_fill_from_pending_line() | ||
res.extend(["secondary_uom_qty", "secondary_uom_id"]) | ||
return res |
22 changes: 22 additions & 0 deletions
22
stock_barcodes_gs1_secondary_unit/wizard/stock_barcodes_read_todo_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_stock_barcodes_todo_kanban" model="ir.ui.view"> | ||
<field name="model">wiz.stock.barcodes.read.todo</field> | ||
<field name="inherit_id" ref="stock_barcodes.view_stock_barcodes_todo_kanban" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='state']" position="before"> | ||
<field name="secondary_uom_qty" /> | ||
<field name="secondary_uom_id" /> | ||
</xpath> | ||
<xpath expr="//t[@t-esc='record.qty_done.value']/../.." position="inside"> | ||
<t t-if="record.secondary_uom_id.raw_value"> | ||
<span class="text-success"> | ||
(<field name="secondary_uom_qty" /> <field | ||
name="secondary_uom_id" | ||
/>) | ||
</span> | ||
</t> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |