2013-12-18 13:21:50 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from openerp.osv import orm
|
2014-01-06 14:18:17 +00:00
|
|
|
from openerp import SUPERUSER_ID
|
2013-12-18 13:21:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Website(orm.Model):
|
|
|
|
_inherit = 'website'
|
|
|
|
|
|
|
|
def _ecommerce_create_quotation(self, cr, uid, context=None):
|
|
|
|
order_id = super(Website, self)._ecommerce_create_quotation(cr, uid, context=context)
|
2014-01-17 17:38:36 +00:00
|
|
|
order = self.pool['sale.order'].browse(cr, SUPERUSER_ID, order_id, context=context)
|
2014-04-02 14:45:20 +00:00
|
|
|
self.pool['sale.order']._check_carrier_quotation(cr, uid, order, force_carrier_id=None, context=context)
|
2013-12-18 13:21:50 +00:00
|
|
|
return order_id
|
2014-01-17 17:38:36 +00:00
|
|
|
|
|
|
|
def _ecommerce_add_product_to_cart(self, cr, uid, product_id=0, order_line_id=0, number=1, set_number=-1, context=None):
|
|
|
|
quantity = super(Website, self)._ecommerce_add_product_to_cart(cr, uid,
|
|
|
|
product_id=product_id, order_line_id=order_line_id, number=number, set_number=set_number,
|
|
|
|
context=context)
|
|
|
|
order = self.ecommerce_get_current_order(cr, uid, context=context)
|
2014-04-02 14:45:20 +00:00
|
|
|
return self.pool['sale.order']._check_carrier_quotation(cr, uid, order, force_carrier_id=None, context=context) and quantity or None
|