mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[11.0][FIX] stock_secondary_unit: Remove procurement_rule move. Fix dependencies
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
'application': False,
|
||||
'installable': True,
|
||||
'depends': [
|
||||
'sale_stock',
|
||||
'stock',
|
||||
'product_secondary_unit',
|
||||
],
|
||||
'data': [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from . import procurement_rule
|
||||
from . import product
|
||||
from . import stock_move
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# Copyright 2018 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ProcurementRule(models.Model):
|
||||
_inherit = 'procurement.rule'
|
||||
|
||||
def _get_stock_move_values(self, product_id, product_qty, product_uom,
|
||||
location_id, name, origin, values, group_id):
|
||||
res = super(ProcurementRule, self)._get_stock_move_values(
|
||||
product_id, product_qty, product_uom, location_id, name, origin,
|
||||
values, group_id
|
||||
)
|
||||
if values.get('sale_line_id', False):
|
||||
sale_line = self.env['sale.order.line'].browse(
|
||||
values['sale_line_id'])
|
||||
if sale_line.secondary_uom_id:
|
||||
res.update({
|
||||
'secondary_uom_id': sale_line.secondary_uom_id.id,
|
||||
'secondary_uom_qty': sale_line.secondary_uom_qty,
|
||||
})
|
||||
return res
|
||||
Reference in New Issue
Block a user