Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 authored Nov 28, 2023
1 parent e0a5b37 commit ee91065
Show file tree
Hide file tree
Showing 54 changed files with 2,342 additions and 0 deletions.
68 changes: 68 additions & 0 deletions deltatech_mrp_bom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
=======
MRP Bom
=======

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7756eaa4367516c358c1d0b6e504cff3969d357478ad37265a973d03c50fccac
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/licence-OPL--1-blue.png
:target: https://www.odoo.com/documentation/master/legal/licenses.html
:alt: License: OPL-1
.. |badge3| image:: https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github
:target: https://github.com/dhongu/deltatech/tree/17.0/deltatech_mrp_bom
:alt: dhongu/deltatech

|badge1| |badge2| |badge3|


Features:
- adugare buton pentru accesare rapida sub-LDM

- adds button for quick access of sub-LDM

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/dhongu/deltatech/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/dhongu/deltatech/issues/new?body=module:%20deltatech_mrp_bom%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Terrabit
* Dorin Hongu

Maintainers
~~~~~~~~~~~

.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px
:target: https://github.com/dhongu
:alt: dhongu

Current maintainer:

|maintainer-dhongu|

This module is part of the `dhongu/deltatech <https://github.com/dhongu/deltatech/tree/17.0/deltatech_mrp_bom>`_ project on GitHub.

You are welcome to contribute.
4 changes: 4 additions & 0 deletions deltatech_mrp_bom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2008-2021 Deltatech
# See README.rst file on addons root folder for license details

from . import models
18 changes: 18 additions & 0 deletions deltatech_mrp_bom/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# © 2008-2021 Deltatech
# See README.rst file on addons root folder for license details

{
"name": "MRP Bom",
"summary": "MRP Bom",
"version": "17.0.1.0.2",
"author": "Terrabit, Dorin Hongu",
"license": "OPL-1",
"website": "https://www.terrabit.ro",
"category": "Manufacturing",
"depends": ["mrp"],
"data": ["views/mrp_bom_view.xml"],
"qweb": [],
"images": ["static/description/main_screenshot.png"],
"development_status": "Mature",
"maintainers": ["dhongu"],
}
Binary file not shown.
4 changes: 4 additions & 0 deletions deltatech_mrp_bom/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2008-2021 Deltatech
# See README.rst file on addons root folder for license details

from . import mrp_bom
Binary file not shown.
Binary file not shown.
72 changes: 72 additions & 0 deletions deltatech_mrp_bom/models/mrp_bom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from odoo import _, api, fields, models


class MrpBom(models.Model):
_inherit = "mrp.bom"

@api.onchange("product_tmpl_id")
def onchange_product_tmpl_id(self):
if self.product_tmpl_id:
self.product_uom_id = self.product_tmpl_id.uom_id.id
if self.product_id.product_tmpl_id != self.product_tmpl_id:
self.product_id = False

for line in self.bom_line_ids:
bom_product_template_attribute_value_ids = self.env["product.template.attribute.value"]

for attribute_value in line.bom_product_template_attribute_value_ids:
for possible_value in line.possible_bom_product_template_attribute_value_ids:
if attribute_value.name == possible_value.name:
bom_product_template_attribute_value_ids |= possible_value

line.bom_product_template_attribute_value_ids = bom_product_template_attribute_value_ids


class MrpBomLine(models.Model):
_inherit = "mrp.bom.line"
# _rec_name = "name"

bom_product_template_attribute_value_ids = fields.Many2many("product.template.attribute.value", copy=True)

# name = fields.Char(string="Name")
#
# @api.onchange("product_id")
# def onchange_product_id(self):
# super(MrpBomLine, self).onchange_product_id()
# if self.product_id:
# self.name = self.product_id.name
#
# @api.model
# def create(self, vals):
# if "name" not in vals:
# product = self.env["product.product"].browse(vals["product_id"])
# vals["name"] = product.name
# return super(MrpBomLine, self).create(vals)

def open_bom(self):
self.ensure_one()
if self.child_bom_id:
# print "Deschid sublista de materiale"
return {
"res_id": self.child_bom_id.id,
"domain": "[('id','=', " + str(self.child_bom_id.id) + ")]",
"name": _("BOM"),
"view_mode": "form,tree",
"res_model": "mrp.bom",
"view_id": False,
"target": "current",
"nodestroy": True,
"type": "ir.actions.act_window",
}

#
# def init(self):
# super(MrpBomLine, self).init()
# lines = self.search([("name", "=", False)])
# for line in lines:
# line.write({"name": line.product_id.name})
5 changes: 5 additions & 0 deletions deltatech_mrp_bom/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

Features:
- adugare buton pentru accesare rapida sub-LDM

- adds button for quick access of sub-LDM
Binary file added deltatech_mrp_bom/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ee91065

Please sign in to comment.