diff --git a/addons/base_import/models/base_import.py b/addons/base_import/models/base_import.py index ad69cb01402..b9e22ad9925 100644 --- a/addons/base_import/models/base_import.py +++ b/addons/base_import/models/base_import.py @@ -615,7 +615,7 @@ class Import(models.TransientModel): for num, line in enumerate(data): if line[index]: try: - line[index] = dt.strftime(dt.strptime(ustr(line[index]).encode('utf-8'), user_format), server_format) + line[index] = dt.strftime(dt.strptime(ustr(line[index].strip()).encode('utf-8'), user_format), server_format) except ValueError, e: raise ValueError(_("Column %s contains incorrect values. Error in line %d: %s") % (name, num + 1, ustr(e.message))) except Exception, e: diff --git a/addons/l10n_fr_certification/models/account.py b/addons/l10n_fr_certification/models/account.py index bef0880d7ca..07d5fc04e41 100644 --- a/addons/l10n_fr_certification/models/account.py +++ b/addons/l10n_fr_certification/models/account.py @@ -10,7 +10,7 @@ ERR_MSG = _("According to the french law, you cannot modify a %s in order for it #forbidden fields MOVE_FIELDS = ['date', 'journal_id', 'company_id'] -LINE_FIELDS = ['debit', 'credit', 'account_id', 'move_id', 'partner_id'] +LINE_FIELDS = ['debit', 'credit', 'account_id', 'partner_id'] class AccountMove(models.Model): @@ -55,7 +55,8 @@ class AccountMove(models.Model): for line in move.line_ids: for field in LINE_FIELDS: - values[field] = _getattrstring(line, field) + k = 'line_%d_%s' % (line.id, field) + values[k] = _getattrstring(line, field) #make the json serialization canonical # (https://tools.ietf.org/html/draft-staykov-hu-json-canonical-form-00) move.l10n_fr_string_to_hash = dumps(values, sort_keys=True, encoding="utf-8", diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index f1bfa24db60..b1150134460 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -562,7 +562,7 @@ class MassMailing(models.Model): def retry_failed_mail(self): failed_mails = self.env['mail.mail'].search([('mailing_id', 'in', self.ids), ('state', '=', 'exception')]) failed_mails.mapped('statistics_ids').unlink() - failed_mails.unlink() + failed_mails.sudo().unlink() self.write({'state': 'in_queue'}) #------------------------------------------------------ diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index abe09f05fd6..e6c402bc95a 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -106,7 +106,7 @@ class Pricelist(models.Model): """ self.ensure_one() if not date: - date = self._context.get('date', fields.Date.today()) + date = self._context.get('date') or fields.Date.today() if not uom_id and self._context.get('uom'): uom_id = self._context['uom'] if uom_id: diff --git a/addons/resource/i18n/resource.pot b/addons/resource/i18n/resource.pot index 5256eed99ac..258b2f8006d 100644 --- a/addons/resource/i18n/resource.pot +++ b/addons/resource/i18n/resource.pot @@ -314,6 +314,12 @@ msgstr "" msgid "Sunday" msgstr "" +#. module: resource +#: code:addons/resource/models/resource.py:714 +#, python-format +msgid "The efficiency factor cannot be equal to 0." +msgstr "" + #. module: resource #: model:ir.model.fields,help:resource.field_resource_resource_time_efficiency msgid "This field is used to calculate the the expected duration of a work order at this work center. For example, if a work order takes one hour and the efficiency factor is 100%, then the expected duration will be one hour. If the efficiency factor is 200%, however the expected duration will be 30 minutes." diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 867028ff223..4b71e041a09 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -885,6 +885,21 @@ class SaleOrderLine(models.Model): uom=self.product_uom.id ) + result = {'domain': domain} + + title = False + message = False + warning = {} + if product.sale_line_warn != 'no-message': + title = _("Warning for %s") % product.name + message = product.sale_line_warn_msg + warning['title'] = title + warning['message'] = message + result = {'warning': warning} + if product.sale_line_warn == 'block': + self.product_id = False + return result + name = product.name_get()[0][1] if product.description_sale: name += '\n' + product.description_sale @@ -896,22 +911,11 @@ class SaleOrderLine(models.Model): vals['price_unit'] = self.env['account.tax']._fix_tax_included_price(self._get_display_price(product), product.taxes_id, self.tax_id) self.update(vals) - title = False - message = False - warning = {} - if product.sale_line_warn != 'no-message': - title = _("Warning for %s") % product.name - message = product.sale_line_warn_msg - warning['title'] = title - warning['message'] = message - if product.sale_line_warn == 'block': - self.product_id = False - return {'warning': warning} - return {'domain': domain} + return result @api.onchange('product_uom', 'product_uom_qty') def product_uom_change(self): - if not self.product_uom: + if not self.product_uom or not self.product_id: self.price_unit = 0.0 return if self.order_id.pricelist_id and self.order_id.partner_id: diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py index 113dddb8f49..f66900de681 100644 --- a/addons/stock_account/models/stock.py +++ b/addons/stock_account/models/stock.py @@ -315,8 +315,8 @@ class StockMove(models.Model): 'product_uom_id': self.product_id.uom_id.id, 'ref': self.picking_id.name, 'partner_id': partner_id, - 'debit': debit_value, - 'credit': 0, + 'debit': debit_value if debit_value > 0 else 0, + 'credit': -debit_value if debit_value < 0 else 0, 'account_id': debit_account_id, } credit_line_vals = { @@ -326,8 +326,8 @@ class StockMove(models.Model): 'product_uom_id': self.product_id.uom_id.id, 'ref': self.picking_id.name, 'partner_id': partner_id, - 'credit': credit_value, - 'debit': 0, + 'credit': credit_value if credit_value > 0 else 0, + 'debit': -credit_value if credit_value < 0 else 0, 'account_id': credit_account_id, } res = [(0, 0, debit_line_vals), (0, 0, credit_line_vals)] diff --git a/addons/website_crm_partner_assign/report/crm_lead_report.py b/addons/website_crm_partner_assign/report/crm_lead_report.py index e72a1b3dedf..07676117473 100644 --- a/addons/website_crm_partner_assign/report/crm_lead_report.py +++ b/addons/website_crm_partner_assign/report/crm_lead_report.py @@ -67,7 +67,7 @@ class CrmLeadReportAssign(models.Model): p.grade_id, p.date as partner_date, c.planned_revenue*(c.probability/100) as probable_revenue, - 1 as nbr, + 1 as nbr_cases, c.create_date as create_date, extract('epoch' from (c.write_date-c.create_date))/(3600*24) as delay_close, extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24) as delay_expected, diff --git a/doc/howtos/backend/exercise-dashboard b/doc/howtos/backend/exercise-dashboard index ba5c1320623..affbc7bdc8f 100644 --- a/doc/howtos/backend/exercise-dashboard +++ b/doc/howtos/backend/exercise-dashboard @@ -9,8 +9,8 @@ Index: addons/openacademy/__manifest__.py 'version': '0.1', # any module necessary for this one to work correctly -- 'depends': ['base'], -+ 'depends': ['base', 'board'], +- 'depends': ['base', 'report'], ++ 'depends': ['base', 'report', 'board'], # always loaded 'data': [ diff --git a/doc/howtos/backend/exercise-report b/doc/howtos/backend/exercise-report index 797174e247a..08ac677b5c0 100644 --- a/doc/howtos/backend/exercise-report +++ b/doc/howtos/backend/exercise-report @@ -1,6 +1,19 @@ # HG changeset patch # Parent c140f0a861a08881d8737bca0ffb83904a2059a3 +Index: addons/openacademy/__manifest__.py +=================================================================== +--- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:21.535783052 +0200 ++++ addons/openacademy/__manifest__.py 2014-08-26 17:26:21.531783052 +0200 +@@ -21,7 +21,7 @@ + 'version': '0.1', + + # any module necessary for this one to work correctly +- 'depends': ['base'], ++ 'depends': ['base', 'report'], + + # always loaded + 'data': [ Index: addons/openacademy/__manifest__.py =================================================================== --- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200 diff --git a/doc/index.rst b/doc/index.rst index dcdd6ab752b..21231b7ce3f 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -17,7 +17,6 @@ Index api_integration setup reference - business .. ifconfig:: todo_include_todos diff --git a/doc/setup/install.rst b/doc/setup/install.rst index de21d6c53ab..aae7d03b8ba 100644 --- a/doc/setup/install.rst +++ b/doc/setup/install.rst @@ -546,7 +546,7 @@ default db to serve on localhost:8069 http://www.enterprisedb.com/products-services-training/pgdownload .. _Quilt: http://en.wikipedia.org/wiki/Quilt_(software) .. _saas: https://www.odoo.com/page/start -.. _the wkhtmltopdf download page: http://wkhtmltopdf.org/downloads.html +.. _the wkhtmltopdf download page: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.1 .. _UAC: http://en.wikipedia.org/wiki/User_Account_Control .. _wkhtmltopdf: http://wkhtmltopdf.org .. _pip: https://pip.pypa.io