summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-02-10 15:55:48 +0100
committerDenis Ledoux <dle@odoo.com>2016-02-10 15:55:48 +0100
commitc2d230ad683fc2b7ae23431b81d94f0d71bbd380 (patch)
treea53f7c0f4189d41ee6bc261f36f6d9a2a52a94ba /addons
parent95c37d1b0ec95fd7bf0a1182cb09ee8f480984af (diff)
parent47bb1bd2257c7af5ae68b9bb23455dd1bd21644c (diff)
[MERGE] forward port of branch 9.0 up to 47bb1bd
Diffstat (limited to 'addons')
-rw-r--r--addons/account/i18n/account.pot3
-rw-r--r--addons/account/models/account_invoice.py2
-rw-r--r--addons/account/models/account_move.py9
-rw-r--r--addons/account/models/res_config.py4
-rw-r--r--addons/account/report/account_invoice_report.py13
-rw-r--r--addons/account_tax_python/account_tax_python.py2
-rw-r--r--addons/delivery/i18n/delivery.pot6
-rw-r--r--addons/delivery/models/stock_picking.py6
-rw-r--r--addons/im_livechat/models/im_livechat_channel.py4
-rw-r--r--addons/mail/static/src/less/announcement.less2
-rw-r--r--addons/payment_ogone/models/ogone.py3
-rw-r--r--addons/portal_sale/security/ir.model.access.csv1
-rw-r--r--addons/procurement/procurement.py5
-rw-r--r--addons/purchase/report/purchase_report.py13
-rw-r--r--addons/sale/i18n/sale.pot6
-rw-r--r--addons/sale/report/sale_report.py13
-rw-r--r--addons/sale/sale.py2
-rw-r--r--addons/website/i18n/website.pot2
-rw-r--r--addons/website/models/ir_http.py1
-rw-r--r--addons/website/models/website.py2
-rw-r--r--addons/website/views/res_config.xml15
-rw-r--r--addons/website_crm/models/crm_lead.py6
22 files changed, 61 insertions, 59 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot
index 5412aee63fc..038c3340bc5 100644
--- a/addons/account/i18n/account.pot
+++ b/addons/account/i18n/account.pot
@@ -1561,7 +1561,6 @@ msgstr ""
#: model:ir.model.fields,help:account.field_account_config_settings_module_account_asset
msgid "Asset management: This allows you to manage the assets owned by a company or a person. It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.\n"
"\n"
-"Revenue recognition: This allows you to manage the Revenue recognition on selling product. It keeps track of the installment occurred on those revenue recognition, and creates account move for those installment lines.\n"
"-This installs the module account_asset. If you do not check this box, you will be able to do invoicing & payments, but not accounting (Journal Items, Chart of Accounts, ...)"
msgstr ""
@@ -1572,7 +1571,7 @@ msgstr ""
#. module: account
#: model:ir.model.fields,field_description:account.field_account_config_settings_module_account_asset
-msgid "Assets management & Revenue recognition"
+msgid "Assets management"
msgstr ""
#. module: account
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index f7e2ca4fc3d..19b305babd4 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -960,7 +960,7 @@ class AccountInvoice(models.Model):
recs = self.browse(cr, uid, ids, context)
pay_journal = self.pool.get('account.journal').browse(cr, uid, pay_journal_id, context=context)
writeoff_acc = self.pool.get('account.account').browse(cr, uid, writeoff_acc_id, context=context)
- return recs.pay_and_reconcile(pay_journal, pay_amount, date, writeoff_acc)
+ return AccountInvoice.pay_and_reconcile(recs, pay_journal, pay_amount, date, writeoff_acc)
@api.multi
def _track_subtype(self, init_values):
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index aa3d81ef3b4..6a6aaf17bdc 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -599,8 +599,9 @@ class AccountMoveLine(models.Model):
@api.v7
def prepare_move_lines_for_reconciliation_widget(self, cr, uid, line_ids, target_currency_id=False, context=None):
+ recs = self.browse(cr, uid, line_ids, context)
target_currency = target_currency_id and self.pool.get('res.currency').browse(cr, uid, target_currency_id, context=context) or False
- return self.browse(cr, uid, line_ids, context).prepare_move_lines_for_reconciliation_widget(target_currency=target_currency)
+ return AccountMoveLine.prepare_move_lines_for_reconciliation_widget(recs, target_currency=target_currency)
@api.v8
def prepare_move_lines_for_reconciliation_widget(self, target_currency=False, target_date=False):
@@ -695,11 +696,7 @@ class AccountMoveLine(models.Model):
accounts = self.pool['account.account'].browse(cr, uid, datum['id'], context=context)
self.pool['account.account'].mark_as_reconciled(cr, uid, accounts.ids, context=context)
- @api.v7
- def process_reconciliation(self, cr, uid, mv_line_ids, new_mv_line_dicts, context=None):
- return self.browse(cr, uid, mv_line_ids, context).process_reconciliation(new_mv_line_dicts)
-
- @api.v8
+ @api.multi
def process_reconciliation(self, new_mv_line_dicts):
""" Create new move lines from new_mv_line_dicts (if not empty) then call reconcile_partial on self and new move lines
diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py
index e7a06af17b9..893ed5ede7b 100644
--- a/addons/account/models/res_config.py
+++ b/addons/account/models/res_config.py
@@ -82,11 +82,9 @@ class AccountConfigSettings(models.TransientModel):
currency_exchange_journal_id = fields.Many2one('account.journal',
related='company_id.currency_exchange_journal_id',
string="Rate Difference Journal",)
- module_account_asset = fields.Boolean(string='Assets management & Revenue recognition',
+ module_account_asset = fields.Boolean(string='Assets management',
help='Asset management: This allows you to manage the assets owned by a company or a person. '
'It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.\n\n'
- 'Revenue recognition: This allows you to manage the Revenue recognition on selling product. '
- 'It keeps track of the installment occurred on those revenue recognition, and creates account move for those installment lines.\n'
'-This installs the module account_asset. If you do not check this box, you will be able to do invoicing & payments, '
'but not accounting (Journal Items, Chart of Accounts, ...)')
module_account_budget = fields.Boolean(string='Budget management',
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index f2d0548819a..b2f2f0fa83c 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -158,23 +158,16 @@ class AccountInvoiceReport(models.Model):
# self._table = account_invoice_report
tools.drop_view_if_exists(cr, self._table)
cr.execute("""CREATE or REPLACE VIEW %s as (
- WITH currency_rate (currency_id, rate, date_start, date_end) AS (
- SELECT r.currency_id, r.rate, r.name AS date_start,
- (SELECT name FROM res_currency_rate r2
- WHERE r2.name > r.name AND
- r2.currency_id = r.currency_id
- ORDER BY r2.name ASC
- LIMIT 1) AS date_end
- FROM res_currency_rate r
- )
+ WITH currency_rate AS (%s)
%s
FROM (
%s %s %s
) AS sub
LEFT JOIN currency_rate cr ON
(cr.currency_id = sub.currency_id AND
+ cr.company_id = sub.company_id AND
cr.date_start <= COALESCE(sub.date, NOW()) AND
(cr.date_end IS NULL OR cr.date_end > COALESCE(sub.date, NOW())))
)""" % (
- self._table,
+ self._table, self.pool['res.currency']._select_companies_rates(),
self._select(), self._sub_select(), self._from(), self._group_by()))
diff --git a/addons/account_tax_python/account_tax_python.py b/addons/account_tax_python/account_tax_python.py
index 42a83610f79..57527de81f8 100644
--- a/addons/account_tax_python/account_tax_python.py
+++ b/addons/account_tax_python/account_tax_python.py
@@ -52,7 +52,7 @@ class AccountTaxPython(models.Model):
partner = partner_id and self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) or None
ids = isinstance(ids, (int, long)) and [ids] or ids
recs = self.browse(cr, uid, ids, context=context)
- return recs.compute_all(price_unit, currency, quantity, product, partner)
+ return AccountTaxPython.compute_all(recs, price_unit, currency, quantity, product, partner)
class AccountTaxTemplatePython(models.Model):
_inherit = 'account.tax.template'
diff --git a/addons/delivery/i18n/delivery.pot b/addons/delivery/i18n/delivery.pot
index bfa7f28248d..1160acc2328 100644
--- a/addons/delivery/i18n/delivery.pot
+++ b/addons/delivery/i18n/delivery.pot
@@ -1075,6 +1075,12 @@ msgid "Shipment sent to carrier %s for expedition with tracking number %s"
msgstr ""
#. module: delivery
+#: code:addons/delivery/models/stock_picking.py:106
+#, python-format
+msgid "Your delivery method has no redirect on courier provider's website to track this order."
+msgstr ""
+
+#. module: delivery
#: model:ir.model.fields,field_description:delivery.field_stock_picking_carrier_price
msgid "Shipping Cost"
msgstr ""
diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py
index 9c1b93440c2..6ed00f66a62 100644
--- a/addons/delivery/models/stock_picking.py
+++ b/addons/delivery/models/stock_picking.py
@@ -100,11 +100,15 @@ class StockPicking(models.Model):
@api.multi
def open_website_url(self):
self.ensure_one()
+ if self.carrier_id.get_tracking_link(self):
+ url = self.carrier_id.get_tracking_link(self)[0]
+ else:
+ raise UserError(_("Your delivery method has no redirect on courier provider's website to track this order."))
client_action = {'type': 'ir.actions.act_url',
'name': "Shipment Tracking Page",
'target': 'new',
- 'url': self.carrier_id.get_tracking_link(self)[0]
+ 'url': url,
}
return client_action
diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py
index c4f66518c50..061b94fcc69 100644
--- a/addons/im_livechat/models/im_livechat_channel.py
+++ b/addons/im_livechat/models/im_livechat_channel.py
@@ -200,6 +200,10 @@ class ImLivechatChannel(models.Model):
info['options']["default_username"] = username
return info
+ # FIXME: to remove in master
+ @api.model
+ def match_rules(self, request, channel_id, username='Visitor'):
+ pass
class ImLivechatChannelRule(models.Model):
""" Channel Rules
diff --git a/addons/mail/static/src/less/announcement.less b/addons/mail/static/src/less/announcement.less
index 6efcfb69adb..896577b3773 100644
--- a/addons/mail/static/src/less/announcement.less
+++ b/addons/mail/static/src/less/announcement.less
@@ -1,4 +1,4 @@
-.openerp .annoucement_bar {
+.openerp .announcement_bar {
display: none;
}
diff --git a/addons/payment_ogone/models/ogone.py b/addons/payment_ogone/models/ogone.py
index 47d8cc49814..0a07315467f 100644
--- a/addons/payment_ogone/models/ogone.py
+++ b/addons/payment_ogone/models/ogone.py
@@ -7,6 +7,7 @@ from lxml import etree, objectify
from openerp.tools.translate import _
from pprint import pformat
import time
+from unicodedata import normalize
from urllib import urlencode
import urllib2
import urlparse
@@ -478,7 +479,7 @@ class PaymentMethod(osv.Model):
'TRANSACTION_CODE': 'ATR',
'OPERATION': 'SAL',
'NB_PAYMENTS': 1, # even if we do not actually have any payment, ogone want it to not be 0
- 'FILE': line,
+ 'FILE': normalize('NFKD', line).encode('ascii','ignore'), # Ogone Batch must be ASCII only
'REPLY_TYPE': 'XML',
'PSPID': acquirer.ogone_pspid,
'USERID': acquirer.ogone_userid,
diff --git a/addons/portal_sale/security/ir.model.access.csv b/addons/portal_sale/security/ir.model.access.csv
index 88cd0e961d3..4ca1fb4c2b9 100644
--- a/addons/portal_sale/security/ir.model.access.csv
+++ b/addons/portal_sale/security/ir.model.access.csv
@@ -8,6 +8,7 @@ access_account_journal,account.journal,account.model_account_journal,base.group_
access_product_list,product.pricelist,product.model_product_pricelist,base.group_portal,1,0,0,0
access_res_partner,res.partner,base.model_res_partner,base.group_portal,1,0,0,0
access_account_tax,account.tax,account.model_account_tax,base.group_portal,1,0,0,0
+access_account_tax_group,account.tax.group,account.model_account_tax_group,base.group_portal,1,0,0,0
access_res_partner_category,res.partner.category,base.model_res_partner_category,base.group_portal,1,0,0,0
access_product_attribute_portal,product.attribute portal,product.model_product_attribute,base.group_portal,1,0,0,0
access_product_attribute_value_portal,product.attribute value portal,product.model_product_attribute_value,base.group_portal,1,0,0,0
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index e3ff3e49e89..a7f21cb4b84 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -182,11 +182,6 @@ class procurement_order(osv.osv):
def reset_to_confirmed(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'confirmed'}, context=context)
- @api.v8
- def run(self, autocommit=False):
- return self._model.run(self._cr, self._uid, self.ids, autocommit=False, context=self._context)
-
- @api.v7
def run(self, cr, uid, ids, autocommit=False, context=None):
for procurement_id in ids:
#we intentionnaly do the browse under the for loop to avoid caching all ids which would be resource greedy
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index 4786e46a7b9..59381718b1b 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -49,15 +49,7 @@ class purchase_report(osv.osv):
tools.sql.drop_view_if_exists(cr, 'purchase_report')
cr.execute("""
create or replace view purchase_report as (
- WITH currency_rate (currency_id, rate, date_start, date_end) AS (
- SELECT r.currency_id, r.rate, r.name AS date_start,
- (SELECT name FROM res_currency_rate r2
- WHERE r2.name > r.name AND
- r2.currency_id = r.currency_id
- ORDER BY r2.name ASC
- LIMIT 1) AS date_end
- FROM res_currency_rate r
- )
+ WITH currency_rate as (%s)
select
min(l.id) as id,
s.date_order as date,
@@ -96,6 +88,7 @@ class purchase_report(osv.osv):
left join stock_picking_type spt on (spt.id=s.picking_type_id)
left join account_analytic_account analytic_account on (l.account_analytic_id = analytic_account.id)
left join currency_rate cr on (cr.currency_id = s.currency_id and
+ cr.company_id = s.company_id and
cr.date_start <= coalesce(s.date_order, now()) and
(cr.date_end is null or cr.date_end > coalesce(s.date_order, now())))
group by
@@ -125,4 +118,4 @@ class purchase_report(osv.osv):
partner.commercial_partner_id,
analytic_account.id
)
- """)
+ """ % self.pool['res.currency']._select_companies_rates())
diff --git a/addons/sale/i18n/sale.pot b/addons/sale/i18n/sale.pot
index e158af64e08..2ce03cb92df 100644
--- a/addons/sale/i18n/sale.pot
+++ b/addons/sale/i18n/sale.pot
@@ -1094,6 +1094,12 @@ msgid "Please define an accounting sale journal for this company."
msgstr ""
#. module: sale
+#: code:addons/sale/sale.py:316
+#, python-format
+msgid "There is no invoicable line."
+msgstr ""
+
+#. module: sale
#: code:addons/sale/sale.py:654
#, python-format
msgid "Please define income account for this product: \"%s\" (id:%d) - or for its category: \"%s\"."
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 68ec0b37b02..507a2560d9e 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -43,15 +43,7 @@ class sale_report(osv.osv):
def _select(self):
select_str = """
- WITH currency_rate (currency_id, rate, date_start, date_end) AS (
- SELECT r.currency_id, r.rate, r.name AS date_start,
- (SELECT name FROM res_currency_rate r2
- WHERE r2.name > r.name AND
- r2.currency_id = r.currency_id
- ORDER BY r2.name ASC
- LIMIT 1) AS date_end
- FROM res_currency_rate r
- )
+ WITH currency_rate as (%s)
SELECT min(l.id) as id,
l.product_id as product_id,
t.uom_id as product_uom,
@@ -75,7 +67,7 @@ class sale_report(osv.osv):
p.product_tmpl_id,
partner.country_id as country_id,
partner.commercial_partner_id as commercial_partner_id
- """
+ """ % self.pool['res.currency']._select_companies_rates()
return select_str
def _from(self):
@@ -89,6 +81,7 @@ class sale_report(osv.osv):
left join product_uom u2 on (u2.id=t.uom_id)
left join product_pricelist pp on (s.pricelist_id = pp.id)
left join currency_rate cr on (cr.currency_id = pp.currency_id and
+ cr.company_id = s.company_id and
cr.date_start <= coalesce(s.date_order, now()) and
(cr.date_end is null or cr.date_end > coalesce(s.date_order, now())))
"""
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index c1f76256219..512f6a6d16c 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -311,6 +311,8 @@ class SaleOrder(models.Model):
line.invoice_line_create(invoices[group_key].id, line.qty_to_invoice)
for invoice in invoices.values():
+ if not invoice.invoice_line_ids:
+ raise UserError(_('There is no invoicable line.'))
# If invoice is negative, do a refund invoice instead
if invoice.amount_untaxed < 0:
invoice.type = 'out_refund'
diff --git a/addons/website/i18n/website.pot b/addons/website/i18n/website.pot
index b3c23ef7493..282fec6c8f5 100644
--- a/addons/website/i18n/website.pot
+++ b/addons/website/i18n/website.pot
@@ -3149,7 +3149,7 @@ msgstr ""
#. module: website
#: model:ir.ui.view,arch_db:website.view_website_config_settings
-msgid "Speed"
+msgid "Optimization"
msgstr ""
#. module: website
diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py
index 5b5f175338f..303d3d07a8a 100644
--- a/addons/website/models/ir_http.py
+++ b/addons/website/models/ir_http.py
@@ -158,6 +158,7 @@ class ir_http(orm.AbstractModel):
redirect.set_cookie('website_lang', request.lang)
return redirect
elif url_lang:
+ request.uid = None
path.pop(1)
return self.reroute('/'.join(path) or '/')
if path[1] == request.website.default_lang_code:
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index 112064e743f..bdd79a4c1df 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -187,7 +187,7 @@ class website(osv.osv):
'company_id': lambda self,cr,uid,c: self.pool['ir.model.data'].xmlid_to_res_id(cr, openerp.SUPERUSER_ID,'base.main_company'),
'compress_html': False,
'cdn_activated': False,
- 'cdn_url': '//localhost:8069/',
+ 'cdn_url': '',
'cdn_filters': '\n'.join(DEFAULT_CDN_FILTERS),
'language_ids': _active_languages,
'default_lang_id': _default_language,
diff --git a/addons/website/views/res_config.xml b/addons/website/views/res_config.xml
index 459e99fa2df..20a883735e0 100644
--- a/addons/website/views/res_config.xml
+++ b/addons/website/views/res_config.xml
@@ -100,8 +100,8 @@
<label for="module_website_version"/>
</div>
</div>
- <label for="id" string="Speed"/>
- <div>
+ <label for="id" string="Optimization" groups="base.group_no_one"/>
+ <div groups="base.group_no_one">
<div>
<field name="compress_html"/>
<label for="compress_html"/>
@@ -109,11 +109,16 @@
<div>
<field name="cdn_activated"/>
<label for="cdn_activated"/>
- </div><div>
+ </div>
+ <div attrs="{'invisible': [('cdn_activated', '=', False)]}">
<label for="cdn_url"/>
- <field name="cdn_url" attrs="{'invisible': [('cdn_activated', '=', False)] }"/>
+ <field name="cdn_url"
+ attrs="{'required': [('cdn_activated', '=', True)]}"
+ placeholder="//mycompany.mycdn.com/"
+ t-translation="off"/>
<label for="cdn_filters"/>
- <field name="cdn_filters" attrs="{'invisible': [('cdn_activated', '=', False)] }"/>
+ <field name="cdn_filters"
+ attrs="{'required': [('cdn_activated', '=', True)]}"/>
</div>
</div>
diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py
index ce1fad60cdd..b9b29aa37ab 100644
--- a/addons/website_crm/models/crm_lead.py
+++ b/addons/website_crm/models/crm_lead.py
@@ -4,5 +4,9 @@ class Lead(models.Model):
_inherit = 'crm.lead'
def website_form_input_filter(self, request, values):
- values.setdefault('medium_id', request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'crm.crm_medium_website'))
+ values['medium_id'] = (
+ values.get('medium_id') or
+ self.default_get(['medium_id']).get('medium_id') or
+ self.sudo().env['ir.model.data'].xmlid_to_res_id('utm.utm_medium_website')
+ )
return values