purchase_stock_generic_product and sale_stock_generic_product: allows the use of generic products
This commit is contained in:
3
purchase_stock_generic_product/README.rst
Normal file
3
purchase_stock_generic_product/README.rst
Normal 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**.
|
||||
1
purchase_stock_generic_product/__init__.py
Normal file
1
purchase_stock_generic_product/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
18
purchase_stock_generic_product/__manifest__.py
Normal file
18
purchase_stock_generic_product/__manifest__.py
Normal 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,
|
||||
}
|
||||
1
purchase_stock_generic_product/models/__init__.py
Normal file
1
purchase_stock_generic_product/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import purchase_order_line
|
||||
17
purchase_stock_generic_product/models/purchase_order_line.py
Normal file
17
purchase_stock_generic_product/models/purchase_order_line.py
Normal 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
|
||||
Reference in New Issue
Block a user