From f852bfc5bae7c524b9d8c503769d7ab492ce3832 Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Thu, 3 Jun 2021 10:21:41 -0600 Subject: [PATCH] [FIX] Error no attribute bom_id AttributeError: 'product.configurator.sale' object has no attribute 'bom_id' Added Readme Typo --- product_configurator_sale_mrp/README.rst | 65 +++++++++++++++++++ .../readme/DESCRIPTION.rst | 1 + .../wizard/product_configurator.py | 4 +- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 product_configurator_sale_mrp/README.rst create mode 100644 product_configurator_sale_mrp/readme/DESCRIPTION.rst diff --git a/product_configurator_sale_mrp/README.rst b/product_configurator_sale_mrp/README.rst new file mode 100644 index 0000000000..b2f8b5e2ea --- /dev/null +++ b/product_configurator_sale_mrp/README.rst @@ -0,0 +1,65 @@ +============================= +Product Configurator Sale MRP +============================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fproduct--configurator-lightgray.png?logo=github + :target: https://github.com/OCA/product-configurator/tree/14.0/product_configurator_sale_mrp + :alt: OCA/product-configurator +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-configurator-14-0/product-configurator-14-0-product_configurator_sale_mrp + :alt: Translate me on Weblate + +|badge1| |badge2| |badge3| |badge4| + +Product Configurator Sale wizard adds Bom to Sales Order Line. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Pledra + +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. + +This module is part of the `OCA/product-configurator `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_configurator_sale_mrp/readme/DESCRIPTION.rst b/product_configurator_sale_mrp/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..eee5646256 --- /dev/null +++ b/product_configurator_sale_mrp/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Product Configurator Sale wizard adds Bom to Sales Order Line. diff --git a/product_configurator_sale_mrp/wizard/product_configurator.py b/product_configurator_sale_mrp/wizard/product_configurator.py index 127460c818..dd65e66281 100644 --- a/product_configurator_sale_mrp/wizard/product_configurator.py +++ b/product_configurator_sale_mrp/wizard/product_configurator.py @@ -5,7 +5,6 @@ class ProductConfiguratorSale(models.TransientModel): - _inherit = "product.configurator.sale" def _get_order_line_vals(self, product_id): @@ -13,5 +12,6 @@ def _get_order_line_vals(self, product_id): vals = super(ProductConfiguratorSale, self)._get_order_line_vals( product_id=product_id ) - vals.update(bom_id=self.bom_id.id) + bom = self.env["mrp.bom"].search([("product_id", "=", product_id)], limit=1) + vals.update(bom_id=bom.id) return vals