Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] Module sale_configurator_option_product. #62

Open
wants to merge 10 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions sale_configurator_option_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
================================
sale configurator option product
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:89ffda89ad8d03a4d6bec4a1451d11f73e5574add8c56efdb019827fd5c24b89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-akretion%2Fsale--configurator-lightgray.png?logo=github
:target: https://github.com/akretion/sale-configurator/tree/14.0/sale_configurator_option_product
:alt: akretion/sale-configurator

|badge1| |badge2| |badge3|

This module allows the options with type "product", to be add to the manufactur
order that have been create with on a sale order.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/akretion/sale-configurator/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/akretion/sale-configurator/issues/new?body=module:%20sale_configurator_option_product%0Aversion:%2014.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
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

* Thomas BONNERUE <[email protected]>

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

This module is part of the `akretion/sale-configurator <https://github.com/akretion/sale-configurator/tree/14.0/sale_configurator_option_product>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions sale_configurator_option_product/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
24 changes: 24 additions & 0 deletions sale_configurator_option_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2024 Akretion (http://www.akretion.com).
# @author Thomas BONNERUE <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


{
"name": "sale configurator option product",
"license": "AGPL-3",
"summary": "add modification for adding option product in the Manufactur order",
"category": "Uncategorized",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/akretion/sale-configurator",
"version": "14.0.1.0.0",
"application": False,
"installable": True,
"depends": [
"mrp",
"sale_configurator_option",
"mrp_sale_info",
],
"data": [],
"demo": [],
"qweb": [],
}
1 change: 1 addition & 0 deletions sale_configurator_option_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_option
31 changes: 31 additions & 0 deletions sale_configurator_option_product/models/product_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2024 Akretion (http://www.akretion.com).
# @author Thomas BONNERUE <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models


class MrpProduction(models.Model):
_inherit = "mrp.production"

def _get_moves_raw_values(self):
moves = super()._get_moves_raw_values()
moves_temp = []
for prod in self:
moves_temp = self.env["sale.order.line"].read_group(
[
("product_id.type", "=", "product"),
("id", "in", prod.sale_line_ids.option_ids.ids),
],
fields=["product_uom_qty:sum"],
groupby=["product_id", "product_uom"],
lazy=False,
)
for lines in moves_temp:
moves.append(
prod._get_move_raw_values(
self.env["product.product"].browse(lines["product_id"][0]),
lines["product_uom_qty"],
self.env["uom.uom"].browse(lines["product_uom"][0]),
)
)
return moves
1 change: 1 addition & 0 deletions sale_configurator_option_product/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Thomas BONNERUE <[email protected]>
2 changes: 2 additions & 0 deletions sale_configurator_option_product/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows the options with type "product", to be add to the manufactur
order that have been create with on a sale order.
Loading
Loading