purchase_stock_generic_product and sale_stock_generic_product: allows the use of generic products

This commit is contained in:
Alexis de Lattre
2024-06-15 12:24:12 +02:00
parent d07e38e1f3
commit 740d167331
13 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
This module **purchase_stock_generic_product** allows the use of generic products whose exact properties is written in the description. With this module, the exact product description written in the *name* field of purchase.order.line is written in the field *description_picking* of stock.move.
The module has a twin module for sale orders: **sale_stock_generic_product**.

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,18 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Purchase Stock Generic Product',
'version': '16.0.1.0.0',
'category': 'Purchases',
'license': 'AGPL-3',
'summary': 'Generic product for purchase orders',
'author': 'Akretion',
'maintainers': ['alexis-via'],
"development_status": "Mature",
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['purchase_stock'],
'data': [],
'installable': True,
}

View File

@@ -0,0 +1 @@
from . import purchase_order_line

View File

@@ -0,0 +1,17 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
def _prepare_stock_move_vals(
self, picking, price_unit, product_uom_qty, product_uom):
vals = super()._prepare_stock_move_vals(
picking, price_unit, product_uom_qty, product_uom)
# native : product.description_pickingin or self.name
vals['description_picking'] = self.name
return vals