Añadidos módulos de OCA/e-commerce para la tienda online

This commit is contained in:
santiky 2021-09-14 14:07:34 +02:00
parent 10bfdb5a49
commit c14ed5b4ef
Signed by: snt
GPG key ID: A9FD34930EADBE71
99 changed files with 5359 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class Product(models.Model):
_inherit = 'product.product'
def _compute_quantities_dict(self, lot_id, owner_id, package_id,
from_date=False, to_date=False):
res = super()._compute_quantities_dict(
lot_id, owner_id, package_id, from_date, to_date)
if self.env.context.get('website_sale_stock_available'):
for product in self.with_context(
website_sale_stock_available=False):
immediately = product.immediately_usable_qty
res[product.id]['virtual_available'] = immediately
return res