diff options
| author | Goffin Simon <sig@odoo.com> | 2020-08-31 15:47:19 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2020-09-01 12:12:16 +0000 |
| commit | 4d88f892c8d4cdcb77a7680e772a70e0c0a51241 (patch) | |
| tree | 6e99ace0d3cdbc7c8470fdfc583816f96223fedf | |
| parent | 715a24333bf000d5d98b9ede5155d3af32de067c (diff) | |
[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#56882
X-original-commit: afe0f0d5566df9bccc28535e85dec98d3c7587b4
Related: odoo/enterprise#12840
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
| -rw-r--r-- | addons/sale/models/product_template.py | 5 | ||||
| -rw-r--r-- | addons/sale_product_configurator/views/templates.xml | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/addons/sale/models/product_template.py b/addons/sale/models/product_template.py index 4f4e31f3515..25c6aaa16f5 100644 --- a/addons/sale/models/product_template.py +++ b/addons/sale/models/product_template.py @@ -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') diff --git a/addons/sale_product_configurator/views/templates.xml b/addons/sale_product_configurator/views/templates.xml index 5386d4bd787..11ad527cd18 100644 --- a/addons/sale_product_configurator/views/templates.xml +++ b/addons/sale_product_configurator/views/templates.xml @@ -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> |
