mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD] mrp_account_bom_attribute_match
This commit is contained in:
@@ -1,83 +1 @@
|
||||
===============================
|
||||
MRP Account BOM Attribute Match
|
||||
===============================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/manufacture/tree/15.0/mrp_account_bom_attribute_match
|
||||
:alt: OCA/manufacture
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/manufacture-15-0/manufacture-15-0-mrp_account_bom_attribute_match
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
||||
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/manufacture&target_branch=15.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
Glue module between `mrp_bom_attribute_match` and `mrp_account`.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_account_bom_attribute_match%0Aversion:%2015.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
|
||||
~~~~~~~
|
||||
|
||||
* Camptocamp
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* `Camptocamp <https://www.camptocamp.com>`_
|
||||
|
||||
* Iván Todorovich <ivan.todorovich@camptocamp.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px
|
||||
:target: https://github.com/ivantodorovich
|
||||
:alt: ivantodorovich
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-ivantodorovich|
|
||||
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/15.0/mrp_account_bom_attribute_match>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
TO BE GENERATED
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"name": "MRP Account BOM Attribute Match",
|
||||
"summary": "Glue module between `mrp_account` and `mrp_bom_attribute_match`",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||
"maintainers": ["ivantodorovich"],
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
from odoo import Command, models
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
def _compute_bom_price(self, bom, boms_to_recompute=False):
|
||||
def _compute_bom_price(self, bom, boms_to_recompute=False, byproduct_bom=False):
|
||||
# OVERRIDE to fill in the `line.product_id` if a component template is used.
|
||||
# To avoid a complete override, we HACK the bom by replacing it with a virtual
|
||||
# record, and modifying it's lines on-the-fly.
|
||||
@@ -30,6 +30,5 @@ class ProductProduct(models.Model):
|
||||
else:
|
||||
line.product_id = line_product
|
||||
if to_ignore_line_ids:
|
||||
for to_ignore_line_id in to_ignore_line_ids:
|
||||
bom.bom_line_ids = [(3, to_ignore_line_id, 0)]
|
||||
return super()._compute_bom_price(bom, boms_to_recompute)
|
||||
bom.bom_line_ids = [Command.unlink(id) for id in to_ignore_line_ids]
|
||||
return super()._compute_bom_price(bom, boms_to_recompute, byproduct_bom)
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
from . import common
|
||||
from . import test_mrp_account_bom_attribute_match
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from .common import TestMrpBomAttributeMatchBase
|
||||
from odoo.addons.mrp_bom_attribute_match.tests.common import (
|
||||
TestMrpBomAttributeMatchBase,
|
||||
)
|
||||
|
||||
|
||||
class TestMrpAccount(TestMrpBomAttributeMatchBase):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from odoo.tests import Form, common
|
||||
from odoo.tests import Form, TransactionCase
|
||||
|
||||
|
||||
class TestMrpAttachmentMgmtBase(common.SavepointCase):
|
||||
class TestMrpBomAttributeMatchBase(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
from odoo.tests import Form
|
||||
|
||||
from .common import TestMrpAttachmentMgmtBase
|
||||
from .common import TestMrpBomAttributeMatchBase
|
||||
|
||||
|
||||
class TestMrpAttachmentMgmt(TestMrpAttachmentMgmtBase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
class TestMrpAttachmentMgmt(TestMrpBomAttributeMatchBase):
|
||||
def test_bom_1(self):
|
||||
mrp_bom_form = Form(self.env["mrp.bom"])
|
||||
mrp_bom_form.product_tmpl_id = self.product_sword
|
||||
|
||||
Reference in New Issue
Block a user