Skip to content

Commit

Permalink
[ADD] stock_production_lot_responsible: new responsible field in lot,…
Browse files Browse the repository at this point in the history
… and this and lot's reference shown in quant. (#1078)
  • Loading branch information
Berezi committed Apr 28, 2021
1 parent d894c24 commit 5ed6afd
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 0 deletions.
29 changes: 29 additions & 0 deletions stock_production_lot_responsible/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

================================
Stock production lot responsible
================================

* Responsible in stock production lot.
* Internal refenece and responsible in stock quant.

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

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble,
please check there if your issue has already been reported. If you spotted
it first, help us smash it by providing detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Contributors
------------

* Berezi Amubieta <bereziamubieta@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
1 change: 1 addition & 0 deletions stock_production_lot_responsible/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions stock_production_lot_responsible/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2021 Berezi - Iker - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Stock Production Lot Responsible",
'version': '14.0.1.0.0',
"author": "Avanzosc",
"category": "Inventory",
"depends": [
"stock",
],
"data": [
"views/stock_production_lot_views.xml",
"views/stock_quant_views.xml",
],
"license": "AGPL-3",
'installable': True,
}
69 changes: 69 additions & 0 deletions stock_production_lot_responsible/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_production_lot_responsible
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-27 09:08+0000\n"
"PO-Revision-Date: 2021-04-28 10:04+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: es\n"
"X-Generator: Poedit 2.3\n"

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__display_name
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__id
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__id
msgid "ID"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__ref
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.quant_search_view
msgid "Internal Reference"
msgstr "Referencia interna"

#. module: stock_production_lot_responsible
#: model:ir.model.fields,help:stock_production_lot_responsible.field_stock_quant__ref
msgid ""
"Internal reference number in case it differs from the manufacturer's "
"lot/serial number"
msgstr ""
"Número de referencia interno en caso de que difiera del número de "
"Lote/Serie del fabricante"

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot____last_update
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: stock_production_lot_responsible
#: model:ir.model,name:stock_production_lot_responsible.model_stock_production_lot
msgid "Lot/Serial"
msgstr "Lote/Número de serie"

#. module: stock_production_lot_responsible
#: model:ir.model,name:stock_production_lot_responsible.model_stock_quant
msgid "Quants"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__responsible_id
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__responsible_id
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.quant_search_view
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.search_product_lot_filter
msgid "Responsible"
msgstr "Responsable"
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_production_lot_responsible
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-27 09:08+0000\n"
"PO-Revision-Date: 2021-04-27 09:08+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__display_name
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__display_name
msgid "Display Name"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__id
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__id
msgid "ID"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__ref
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.quant_search_view
msgid "Internal Reference"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,help:stock_production_lot_responsible.field_stock_quant__ref
msgid ""
"Internal reference number in case it differs from the manufacturer's "
"lot/serial number"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot____last_update
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant____last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model,name:stock_production_lot_responsible.model_stock_production_lot
msgid "Lot/Serial"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model,name:stock_production_lot_responsible.model_stock_quant
msgid "Quants"
msgstr ""

#. module: stock_production_lot_responsible
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_production_lot__responsible_id
#: model:ir.model.fields,field_description:stock_production_lot_responsible.field_stock_quant__responsible_id
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.quant_search_view
#: model_terms:ir.ui.view,arch_db:stock_production_lot_responsible.search_product_lot_filter
msgid "Responsible"
msgstr ""
2 changes: 2 additions & 0 deletions stock_production_lot_responsible/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_production_lot
from . import stock_quant
10 changes: 10 additions & 0 deletions stock_production_lot_responsible/models/stock_production_lot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2021 Berezi - Iker - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields


class StockProductionLot(models.Model):
_inherit = 'stock.production.lot'

responsible_id = fields.Many2one(
string='Responsible', comodel_name='res.partner')
13 changes: 13 additions & 0 deletions stock_production_lot_responsible/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 Berezi - Iker - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields


class StockQuant(models.Model):
_inherit = 'stock.quant'

ref = fields.Char(
string='Internal Reference', related='lot_id.ref',
store=True)
responsible_id = fields.Many2one(
string='Responsible', related='lot_id.responsible_id', store=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>

<odoo>
<record id="view_production_lot_form" model="ir.ui.view">
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
<field name="company_id" position="after" >
<field name="responsible_id"/>
</field>
</field>
</record>

<record id="view_production_lot_tree" model="ir.ui.view">
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
<field name="arch" type="xml">
<field name="product_id" position="after" >
<field name="responsible_id"/>
</field>
</field>
</record>

<record id="search_product_lot_filter" model="ir.ui.view">
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
<field name="arch" type="xml">
<field name="name" position="after" >
<field name="responsible_id"/>
</field>
<filter name="group_by_product" position="after">
<filter name="responsible" string="Responsible" domain="[]" context="{'group_by' : 'responsible_id'}"/>
</filter>
</field>
</record>

</odoo>
31 changes: 31 additions & 0 deletions stock_production_lot_responsible/views/stock_quant_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>

<odoo>

<record id="view_stock_quant_tree_editable" model="ir.ui.view">
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
<field name="arch" type="xml">
<field name="product_id" position="after" >
<field name="ref"/>
<field name="responsible_id"/>
</field>
</field>
</record>

<record id="quant_search_view" model="ir.ui.view">
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.quant_search_view"/>
<field name="arch" type="xml">
<field name="product_id" position="after" >
<field name="ref"/>
<field name="responsible_id"/>
</field>
<filter name="productgroup" position="after">
<filter name="internal_reference" string="Internal Reference" domain="[]" context="{'group_by' : 'ref'}"/>
<filter name="responsible" string="Responsible" domain="[]" context="{'group_by' : 'responsible_id'}"/>
</filter>
</field>
</record>

</odoo>

0 comments on commit 5ed6afd

Please sign in to comment.