Public release from ruodoo-project: 19.0 - 2026-05-10 21:19:01 UTC
This commit is contained in:
2
mklab_mrp_filters/__init__.py
Normal file
2
mklab_mrp_filters/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from . import models, views
|
||||
|
||||
11
mklab_mrp_filters/__manifest__.py
Normal file
11
mklab_mrp_filters/__manifest__.py
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
'name': 'Mklab mrp filters',
|
||||
'version': '19.0.23.10.2025',
|
||||
'depends': ['mrp_workorder', 'sale_mrp'],
|
||||
'author': 'Mk.Lab',
|
||||
'description' : """ Модуль фильтров для производства""",
|
||||
'data': [
|
||||
'views/mrp_routing_workcenter.xml',
|
||||
'views/mrp_workorder.xml'
|
||||
],
|
||||
}
|
||||
104
mklab_mrp_filters/i18n/ru.po
Normal file
104
mklab_mrp_filters/i18n/ru.po
Normal file
@ -0,0 +1,104 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mklab_mrp_filters
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 19.0+e-20251106\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-12-03 14:18+0000\n"
|
||||
"PO-Revision-Date: 2025-12-03 14:18+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: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_routing_workcenter__bending_radius
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__bending_radius
|
||||
msgid "Bending Radius"
|
||||
msgstr "Радиус гиба"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Bending radius"
|
||||
msgstr "Радиус гиба"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,help:mklab_mrp_filters.field_mrp_workorder__sale_date
|
||||
msgid ""
|
||||
"Creation date of draft/sent orders,\n"
|
||||
"Confirmation date of confirmed orders."
|
||||
msgstr ""
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__sale_date
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Date Sale Order"
|
||||
msgstr "Дата продажи"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_routing_workcenter__display_name
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Отображаемое имя"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Executor"
|
||||
msgstr "Исполнитель"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_routing_workcenter__id
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__product_sources_id
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Main manufactured product"
|
||||
msgstr "Главный производимый продукт"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__production_sources_id
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Main manufactured production"
|
||||
msgstr "Главная производственная заявка"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Material"
|
||||
msgstr "Материал"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Sale Order"
|
||||
msgstr "Продажа"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model,name:mklab_mrp_filters.model_mrp_routing_workcenter
|
||||
msgid "Work Center Usage"
|
||||
msgstr "Использование рабочего центра"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model,name:mklab_mrp_filters.model_mrp_workorder
|
||||
msgid "Work Order"
|
||||
msgstr "Заказ-наряд"
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__material_ids
|
||||
msgid "Комлектующие заявки"
|
||||
msgstr ""
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model_terms:ir.ui.view,arch_db:mklab_mrp_filters.search_mrp_production_workorder_filter
|
||||
msgid "Материалы"
|
||||
msgstr ""
|
||||
|
||||
#. module: mklab_mrp_filters
|
||||
#: model:ir.model.fields,field_description:mklab_mrp_filters.field_mrp_workorder__sale_order_id
|
||||
msgid "Связанная продажа"
|
||||
msgstr ""
|
||||
2
mklab_mrp_filters/models/__init__.py
Normal file
2
mklab_mrp_filters/models/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from . import mrp_routing_workcenter
|
||||
from . import mrp_workorder
|
||||
7
mklab_mrp_filters/models/mrp_routing_workcenter.py
Normal file
7
mklab_mrp_filters/models/mrp_routing_workcenter.py
Normal file
@ -0,0 +1,7 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class MrpRoutingWorkcenter(models.Model):
|
||||
_inherit = 'mrp.routing.workcenter'
|
||||
|
||||
bending_radius = fields.Float(string='Bending Radius')
|
||||
38
mklab_mrp_filters/models/mrp_workorder.py
Normal file
38
mklab_mrp_filters/models/mrp_workorder.py
Normal file
@ -0,0 +1,38 @@
|
||||
from odoo import models, fields, api
|
||||
import logging
|
||||
|
||||
|
||||
class MrpWorkorder(models.Model):
|
||||
_inherit = 'mrp.workorder'
|
||||
|
||||
product_sources_id = fields.Many2one(comodel_name='product.product', string='Main manufactured product', compute='_compute_sources_id', store=True)
|
||||
production_sources_id = fields.Many2one(comodel_name='mrp.production', string='Main manufactured production', compute='_compute_sources_id', store=True)
|
||||
bending_radius = fields.Float(string='Bending Radius', related='operation_id.bending_radius', store=True)
|
||||
sale_date = fields.Datetime(string='Date Sale Order', related='sale_order_id.date_order', store=True)
|
||||
material_ids = fields.Many2many(string='Комлектующие заявки', comodel_name='product.product', compute='_compute_material_ids', store=True)
|
||||
sale_order_id = fields.Many2one(comodel_name='sale.order', string='Связанная продажа', compute='_compute_sources_id', store=True)
|
||||
|
||||
|
||||
@api.depends('production_id.move_raw_ids.product_id', 'production_id.move_raw_ids', 'production_id')
|
||||
def _compute_material_ids(self):
|
||||
for rec in self:
|
||||
if rec.production_id and rec.production_id.move_raw_ids:
|
||||
records = rec.production_id.move_raw_ids.mapped('product_id')
|
||||
rec.material_ids = records
|
||||
else:
|
||||
rec.material_ids = False
|
||||
|
||||
@api.depends('production_id')
|
||||
def _compute_sources_id(self):
|
||||
for rec in self:
|
||||
production = rec._get_sources_while(rec.production_id)
|
||||
rec.production_sources_id = production.id
|
||||
rec.product_sources_id = production.product_id.id
|
||||
rec.sale_order_id = rec.production_sources_id.sale_line_id.order_id if rec.production_sources_id and rec.production_sources_id.sale_line_id else False
|
||||
|
||||
def _get_sources_while(self, production):
|
||||
production_new = production._get_sources()
|
||||
if production_new:
|
||||
return self._get_sources_while(production_new)
|
||||
else:
|
||||
return production
|
||||
12
mklab_mrp_filters/views/mrp_routing_workcenter.xml
Normal file
12
mklab_mrp_filters/views/mrp_routing_workcenter.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="mrp_routing_workcenter_form_view_inherit">
|
||||
<field name="name">mrp.routing.workcenter.form.view.inherit</field>
|
||||
<field name="model">mrp.routing.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_routing_workcenter_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet/group/group[1]/field[@name='workcenter_id']" position="after">
|
||||
<field name="bending_radius"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
58
mklab_mrp_filters/views/mrp_workorder.xml
Normal file
58
mklab_mrp_filters/views/mrp_workorder.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="mrp_production_workorder_form_view_inherit_production">
|
||||
<field name="name">mrp.production.workorder.form.view.inherit.production</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet/group[2]/group[2]/field[@name='production_id']" position="after">
|
||||
<field name="product_sources_id" invisible="1"/>
|
||||
<field name="production_sources_id" invisible="1"/>
|
||||
<field name="bending_radius" invisible="1"/>
|
||||
<field name="sale_date" invisible="1"/>
|
||||
<field name="material_ids" invisible="1"/>
|
||||
<field name="sale_order_id" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="mrp_production_workorder_tree_view_inherit">
|
||||
<field name="name">mrp.production.workorder.tree.view.inherit</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='production_id']" position="after">
|
||||
<field name="sale_order_id" optional="hide"/>
|
||||
<field name="sale_date" optional="hide"/>
|
||||
<field name="product_sources_id" optional="hide"/>
|
||||
<field name="production_sources_id" optional="hide"/>
|
||||
<field name="bending_radius" optional="hide"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="search_mrp_production_workorder_filter">
|
||||
<field name="name">search.mrp.production.workorder.filter</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.view_mrp_production_workorder_form_view_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='workcenter_id']" position="after">
|
||||
<field name="sale_order_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="product_sources_id"/>
|
||||
<field name="production_sources_id"/>
|
||||
<field name="bending_radius"/>
|
||||
<field name="sale_date"/>
|
||||
<field name="material_ids" string="Материалы"/>
|
||||
</xpath>
|
||||
<xpath expr="//group/filter[@name='work_center']" position="after">
|
||||
<filter string="Sale Order" name="sale_order" domain="[]" context="{'group_by': 'sale_order_id'}"/>
|
||||
<filter string="Executor" name="user_executor" domain="[]" context="{'group_by': 'user_id'}"/>
|
||||
<filter string="Main manufactured product" name="product_sources" domain="[]" context="{'group_by': 'product_sources_id'}"/>
|
||||
<filter string="Main manufactured production" name="production_sources" domain="[]" context="{'group_by': 'production_sources_id'}"/>
|
||||
<filter string="Bending radius" name="bending_radius" domain="[]" context="{'group_by': 'bending_radius'}"/>
|
||||
<filter string="Date Sale Order" name="scheduled_month" domain="[]" context="{'group_by': 'sale_date'}"/>
|
||||
<filter string="Material" name="material" domain="[]" context="{'group_by': 'material_ids'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user