[MERGE] forward port branch 10.0 up to b16c4f50d4
This commit is contained in:
@@ -248,7 +248,7 @@ class Holidays(models.Model):
|
||||
if nholidays:
|
||||
raise ValidationError(_('You can not have 2 leaves that overlaps on same day!'))
|
||||
|
||||
@api.constrains('state', 'number_of_days_temp')
|
||||
@api.constrains('state', 'number_of_days_temp', 'holiday_status_id')
|
||||
def _check_holidays(self):
|
||||
for holiday in self:
|
||||
if holiday.holiday_type != 'employee' or holiday.type != 'remove' or not holiday.employee_id or holiday.holiday_status_id.limit:
|
||||
|
||||
@@ -349,7 +349,7 @@ class MrpProduction(models.Model):
|
||||
source_location = routing.location_id
|
||||
else:
|
||||
source_location = self.location_src_id
|
||||
original_quantity = self.product_qty - self.qty_produced
|
||||
original_quantity = (self.product_qty - self.qty_produced) or 1.0
|
||||
data = {
|
||||
'sequence': bom_line.sequence,
|
||||
'name': self.name,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import json
|
||||
import logging
|
||||
from werkzeug.exceptions import Forbidden
|
||||
from werkzeug.exceptions import Forbidden, NotFound
|
||||
|
||||
from odoo import http, tools, _
|
||||
from odoo.http import request
|
||||
@@ -193,6 +193,11 @@ class WebsiteSale(http.Controller):
|
||||
else:
|
||||
ppg = PPG
|
||||
|
||||
if category:
|
||||
category = request.env['product.public.category'].search([('id', '=', int(category))], limit=1)
|
||||
if not category:
|
||||
raise NotFound()
|
||||
|
||||
attrib_list = request.httprequest.args.getlist('attrib')
|
||||
attrib_values = [map(int, v.split("-")) for v in attrib_list if v]
|
||||
attributes_ids = set([v[0] for v in attrib_values])
|
||||
@@ -213,9 +218,6 @@ class WebsiteSale(http.Controller):
|
||||
url = "/shop"
|
||||
if search:
|
||||
post["search"] = search
|
||||
if category:
|
||||
category = request.env['product.public.category'].browse(int(category))
|
||||
url = "/shop/category/%s" % slug(category)
|
||||
if attrib_list:
|
||||
post['attrib'] = attrib_list
|
||||
|
||||
@@ -224,6 +226,7 @@ class WebsiteSale(http.Controller):
|
||||
|
||||
parent_category_ids = []
|
||||
if category:
|
||||
url = "/shop/category/%s" % slug(category)
|
||||
parent_category_ids = [category.id]
|
||||
current_category = category
|
||||
while current_category.parent_id:
|
||||
|
||||
Reference in New Issue
Block a user