diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-10-28 12:01:30 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-10-28 12:01:30 +0100 |
| commit | c8d6b3663277b10e7f5479dbdc483b9ffbe607b6 (patch) | |
| tree | 0d066cb155176be2450ffc3443f102103343598d /addons | |
| parent | c0066c600e614edb50743e3fc6ffcbbd3566dfa9 (diff) | |
| parent | a0c64bebe673050fe5b9e32afb740a30ff1ec749 (diff) | |
[MERGE] forward port of branch saas-6 up to a0c64bebe673050fe5b9e32afb740a30ff1ec749
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mass_mailing/models/mail_mail.py | 5 | ||||
| -rw-r--r-- | addons/point_of_sale/report/pos_order_report_view.xml | 4 | ||||
| -rw-r--r-- | addons/sale/report/sale_report_view.xml | 2 | ||||
| -rw-r--r-- | addons/stock/stock.py | 5 | ||||
| -rw-r--r-- | addons/stock_landed_costs/stock_landed_costs.py | 2 | ||||
| -rw-r--r-- | addons/stock_landed_costs/stock_landed_costs_view.xml | 2 | ||||
| -rw-r--r-- | addons/web/controllers/main.py | 6 | ||||
| -rw-r--r-- | addons/website_quote/controllers/main.py | 4 | ||||
| -rw-r--r-- | addons/website_quote/static/src/js/website_quotation.js | 3 | ||||
| -rw-r--r-- | addons/website_quote/views/website_quotation.xml | 8 |
10 files changed, 28 insertions, 13 deletions
diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 7ad891944ac..4efc67fffda 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -82,8 +82,9 @@ class MailMail(osv.Model): body = tools.append_content_to_html(base, body, plaintext=False, container_tag='div') # resolve relative image url to absolute for outlook.com def _sub_relative2absolute(match): - return match.group(1) + urlparse.urljoin(domain, match.group(2)) + '"' - body = re.sub('(<img(?=\s)[^>]*\ssrc=")(/[^/][^"]+)"', _sub_relative2absolute, body) + return match.group(1) + urlparse.urljoin(domain, match.group(2)) + body = re.sub('(<img(?=\s)[^>]*\ssrc=")(/[^/][^"]+)', _sub_relative2absolute, body) + body = re.sub(r'(<[^>]+\bstyle="[^"]+\burl\(\'?)(/[^/\'][^\'")]+)', _sub_relative2absolute, body) # generate tracking URL if mail.statistics_ids: diff --git a/addons/point_of_sale/report/pos_order_report_view.xml b/addons/point_of_sale/report/pos_order_report_view.xml index 724136b1bb3..56eb552b557 100644 --- a/addons/point_of_sale/report/pos_order_report_view.xml +++ b/addons/point_of_sale/report/pos_order_report_view.xml @@ -40,8 +40,8 @@ <field name="config_id"/> <field name="partner_id"/> <field name="user_id"/> - <field name="partner_id"/> - <field name="user_id"/> + <field name="product_id"/> + <field name="product_categ_id"/> <group expand="1" string="Group By"> <filter string="Salesperson" name="User" context="{'group_by':'user_id'}"/> <filter string="Product Category" context="{'group_by':'product_categ_id'}"/> diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index ec87e15eb8b..7e26b9fb9d5 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -66,7 +66,7 @@ <field name="product_id"/> <field name="user_id"/> <group expand="0" string="Extended Filters"> - <field name="categ_id"/> + <field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/> <field name="company_id" groups="base.group_multi_company"/> </group> <group expand="1" string="Group By"> diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9d1d26cc0d1..c009cf1f086 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2783,12 +2783,15 @@ class stock_move(osv.osv): 'product_uom_qty': uom_qty, 'procure_method': 'make_to_stock', 'restrict_lot_id': restrict_lot_id, - 'restrict_partner_id': restrict_partner_id, 'split_from': move.id, 'procurement_id': move.procurement_id.id, 'move_dest_id': move.move_dest_id.id, 'origin_returned_move_id': move.origin_returned_move_id.id, } + + if restrict_partner_id: + defaults['restrict_partner_id'] = restrict_partner_id + if context.get('source_location_id'): defaults['location_id'] = context['source_location_id'] new_move = self.copy(cr, uid, move.id, defaults, context=context) diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 83d96f44035..20a81845924 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -182,13 +182,13 @@ class stock_landed_cost(osv.osv): if not cost.valuation_adjustment_lines or not self._check_sum(cr, uid, cost, context=context): raise UserError(_('You cannot validate a landed cost which has no valid valuation adjustments lines. Did you click on Compute?')) move_id = self._create_account_move(cr, uid, cost, context=context) - quant_dict = {} for line in cost.valuation_adjustment_lines: if not line.move_id: continue per_unit = line.final_cost / line.quantity diff = per_unit - line.former_cost_per_unit quants = [quant for quant in line.move_id.quant_ids] + quant_dict = {} for quant in quants: if quant.id not in quant_dict: quant_dict[quant.id] = quant.cost + diff diff --git a/addons/stock_landed_costs/stock_landed_costs_view.xml b/addons/stock_landed_costs/stock_landed_costs_view.xml index ee57b5e8e0a..b4a7e6c4861 100644 --- a/addons/stock_landed_costs/stock_landed_costs_view.xml +++ b/addons/stock_landed_costs/stock_landed_costs_view.xml @@ -189,7 +189,7 @@ <group> <field name="split_method"/> <field name="standard_price"/> - <field name="property_account_expense_id"/> + <field name="property_account_expense_id" domain="[('internal_type','=','other'),('deprecated', '=', False)]"/> </group> <group> <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 5e87d40cac5..44e6bca6e4d 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -34,7 +34,6 @@ import openerp import openerp.modules.registry from openerp.addons.base.ir.ir_qweb import AssetsBundle, QWebTemplateNotFound from openerp.modules import get_module_resource -from openerp.service import model as service_model from openerp.tools import topological_sort from openerp.tools.translate import _ from openerp.tools import ustr @@ -961,10 +960,7 @@ class DataSet(http.Controller): if method.startswith('_'): raise AccessError(_("Underscore prefixed methods cannot be remotely called")) - @service_model.check - def checked_call(__dbname, *args, **kwargs): - return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) - return checked_call(request.db, *args, **kwargs) + return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) @http.route('/web/dataset/call', type='json', auth="user") def call(self, model, method, args, domain_id=None, context_id=None): diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index 9da22cba870..2a282855813 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -85,6 +85,8 @@ class sale_quote(http.Controller): return request.website.render('website.404') if order.require_payment: return request.website.render('website.404') + if order.state != 'sent': + return False attachments=sign and [('signature.png', sign.decode('base64'))] or [] order_obj.action_confirm(request.cr, SUPERUSER_ID, [order_id], context=request.context) message = _('Order signed by %s') % (signer,) @@ -97,6 +99,8 @@ class sale_quote(http.Controller): order = order_obj.browse(request.cr, SUPERUSER_ID, order_id) if token != order.access_token: return request.website.render('website.404') + if order.state != 'sent': + return werkzeug.utils.redirect("/quote/%s/%s?message=4" % (order_id, token)) request.registry.get('sale.order').action_cancel(request.cr, SUPERUSER_ID, [order_id]) message = post.get('decline_message') if message: diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js index c43f3a2e7a6..b694a7e957b 100644 --- a/addons/website_quote/static/src/js/website_quotation.js +++ b/addons/website_quote/static/src/js/website_quotation.js @@ -62,6 +62,7 @@ if(!$('.o_website_quote').length) { submitForm: function(ev){ // extract data var self = this; + var $confirm_btn = self.$el.find('button[type="submit"]'); var href = self.$el.find('form').attr("action"); var action = href.match(/quote\/([a-z]+)/); var order_id = href.match(/order_id=(.*)&/); @@ -84,6 +85,8 @@ if(!$('.o_website_quote').length) { }) return false; } + $confirm_btn.prepend('<i class="fa fa-spinner fa-spin"></i> '); + $confirm_btn.attr('disabled', true); ajax.jsonRpc("/quote/"+action[1], 'call', { 'order_id': parseInt(order_id[1]), 'token': token, diff --git a/addons/website_quote/views/website_quotation.xml b/addons/website_quote/views/website_quotation.xml index edec1d0a6b8..37ea63232e3 100644 --- a/addons/website_quote/views/website_quotation.xml +++ b/addons/website_quote/views/website_quotation.xml @@ -225,6 +225,14 @@ Your transaction is waiting confirmation. <span t-if='tx_post_msg' t-raw="tx_post_msg"/> </div> + <div class="alert alert-warning alert-dismissable" t-if="message==4 and quotation.state != 'sent'"> + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> + This order has already been + <t t-if="quotation.state=='cancel'">cancelled</t> + <t t-if="quotation.state not in ('cancel','draft')">validated</t> + ! You can <a href="#discussion">contact us</a> for + any question. + </div> <!-- modal relative to the actions Accept/Reject/Cancel --> <div class="modal fade" id="modalaccept" role="dialog" aria-hidden="true"> |
