[FIX] sale, sale_product_configurator: Quantity not copied from Configurator to Rental Wizard
Steps to reproduce the bug: - Let's consider a rental product RP with variants - Configure product configurator - Create a rental order - Select RP and set a quantity in the product configurator - Click on Add Bug: When the rental.wizard was opened, the quantity was not taken into account and was reset to 1. opw:2321357 closes odoo/odoo#56913 X-original-commit: afe0f0d5566df9bccc28535e85dec98d3c7587b4 Related: odoo/enterprise#12871 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
@@ -33,6 +33,7 @@ class ProductTemplate(models.Model):
|
||||
"With this option, a validated expense can be re-invoice to a customer at its cost or sales price.")
|
||||
visible_expense_policy = fields.Boolean("Re-Invoice Policy visible", compute='_compute_visible_expense_policy', default=lambda self: self._default_visible_expense_policy())
|
||||
sales_count = fields.Float(compute='_compute_sales_count', string='Sold')
|
||||
visible_qty_configurator = fields.Boolean("Quantity visible in configurator", compute='_compute_visible_qty_configurator')
|
||||
invoice_policy = fields.Selection([
|
||||
('order', 'Ordered quantities'),
|
||||
('delivery', 'Delivered quantities')], string='Invoicing Policy',
|
||||
@@ -40,6 +41,10 @@ class ProductTemplate(models.Model):
|
||||
'Delivered Quantity: Invoice quantities delivered to the customer.',
|
||||
default='order')
|
||||
|
||||
def _compute_visible_qty_configurator(self):
|
||||
for product_template in self:
|
||||
product_template.visible_qty_configurator = True
|
||||
|
||||
@api.depends('name')
|
||||
def _compute_visible_expense_policy(self):
|
||||
visibility = self.user_has_groups('analytic.group_analytic_accounting')
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"display_currency": (pricelist or product).currency_id
|
||||
}'/>
|
||||
</h2>
|
||||
<div class="css_quantity input-group">
|
||||
<div class="css_quantity input-group" t-if="product.visible_qty_configurator">
|
||||
<div class="input-group-prepend">
|
||||
<button t-attf-href="#" class="btn btn-primary js_add_cart_json d-none d-md-inline-block" aria-label="Remove one" title="Remove one">
|
||||
<i class="fa fa-minus"></i>
|
||||
|
||||
Reference in New Issue
Block a user