diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 2125dceeace..350f4d22da2 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -1547,7 +1547,8 @@ class account_invoice_tax(models.Model):
currency = self.env['res.currency'].browse(currency_id)
currency = currency.with_context(date=date_invoice or fields.Date.context_today(self))
amount = currency.compute(amount, company.currency_id, round=False)
- return {'value': {'tax_amount': amount}}
+ tax_sign = (self.tax_amount / self.amount) if self.amount else 1
+ return {'value': {'tax_amount': amount * tax_sign}}
@api.v8
def compute(self, invoice):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 5372d2fe647..51e005a45fb 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1210,8 +1210,8 @@
-
-
+
+
diff --git a/addons/account_cancel/__init__.py b/addons/account_cancel/__init__.py
index 45de899ed49..27c25120965 100644
--- a/addons/account_cancel/__init__.py
+++ b/addons/account_cancel/__init__.py
@@ -18,3 +18,5 @@
# along with this program. If not, see .
#
##############################################################################
+
+import models
diff --git a/addons/account_cancel/account_cancel_view.xml b/addons/account_cancel/account_cancel_view.xml
index 2d037a4b55f..cc19b629755 100644
--- a/addons/account_cancel/account_cancel_view.xml
+++ b/addons/account_cancel/account_cancel_view.xml
@@ -34,6 +34,17 @@
+
+ bank.statement.draft.form.inherit
+ account.bank.statement
+
+
+
+
+
+
+
+
bank.statement.cancel.form.inherit
account.bank.statement
diff --git a/addons/account_cancel/models/__init__.py b/addons/account_cancel/models/__init__.py
new file mode 100644
index 00000000000..433ad1bafd1
--- /dev/null
+++ b/addons/account_cancel/models/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+import account_bank_statement
diff --git a/addons/account_cancel/models/account_bank_statement.py b/addons/account_cancel/models/account_bank_statement.py
new file mode 100644
index 00000000000..821014abf37
--- /dev/null
+++ b/addons/account_cancel/models/account_bank_statement.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from openerp import models, api, _
+from openerp.exceptions import Warning
+
+
+class BankStatement(models.Model):
+ _inherit = 'account.bank.statement'
+
+ @api.multi
+ def button_draft(self):
+ self.state = 'draft'
+
+class BankStatementLine(models.Model):
+ _inherit = 'account.bank.statement.line'
+
+ @api.multi
+ def cancel(self):
+ for line in self:
+ if line.statement_id.state == 'confirm':
+ raise Warning(_("Please set the bank statement to New before canceling."))
+ return super(BankStatementLine, self).cancel()
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py
index 855ee4ced47..583dee5c492 100644
--- a/addons/analytic_user_function/analytic_user_function.py
+++ b/addons/analytic_user_function/analytic_user_function.py
@@ -116,7 +116,7 @@ class hr_analytic_timesheet(osv.osv):
res ['value']['general_account_id']= a
return res
- def on_change_user_id(self, cr, uid, ids, user_id, account_id, unit_amount=0):
+ def on_change_user_id(self, cr, uid, ids, user_id, account_id=False, unit_amount=0):
res = super(hr_analytic_timesheet, self).on_change_user_id(cr, uid, ids, user_id)
if account_id:
diff --git a/addons/board/board.py b/addons/board/board.py
index 96f7ef9cee9..c6ced7e2c49 100644
--- a/addons/board/board.py
+++ b/addons/board/board.py
@@ -66,7 +66,7 @@ class board_board(osv.osv):
res = {}
res = super(board_board, self).fields_view_get(cr, user, view_id, view_type,
- context, toolbar=toolbar, submenu=submenu)
+ context=context, toolbar=toolbar, submenu=submenu)
CustView = self.pool.get('ir.ui.view.custom')
vids = CustView.search(cr, user, [('user_id', '=', user), ('ref_id', '=', view_id)], context=context)
diff --git a/addons/crm_partner_assign/crm_partner_assign.py b/addons/crm_partner_assign/crm_partner_assign.py
index 211a9368bc5..41ea7e2462f 100644
--- a/addons/crm_partner_assign/crm_partner_assign.py
+++ b/addons/crm_partner_assign/crm_partner_assign.py
@@ -205,7 +205,8 @@ class crm_lead(osv.osv):
# warning: point() type takes (longitude, latitude) as parameters in this order!
cr.execute("""SELECT id, distance
FROM (select id, (point(partner_longitude, partner_latitude) <-> point(%s,%s)) AS distance FROM res_partner
- WHERE partner_longitude is not null
+ WHERE active
+ AND partner_longitude is not null
AND partner_latitude is not null
AND partner_weight > 0) AS d
ORDER BY distance LIMIT 1""", (longitude, latitude))
diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py
index 6f37e0ad4da..af7e6e019cd 100644
--- a/addons/delivery/stock.py
+++ b/addons/delivery/stock.py
@@ -82,7 +82,7 @@ class stock_picking(osv.osv):
"""
carrier_obj = self.pool.get('delivery.carrier')
grid_obj = self.pool.get('delivery.grid')
- fpos_obj = self.pool['account.fiscal.position']
+ currency_obj = self.pool.get('res.currency')
if not picking.carrier_id or \
any(inv_line.product_id.id == picking.carrier_id.product_id.id
for inv_line in invoice.invoice_line):
@@ -95,6 +95,9 @@ class stock_picking(osv.osv):
price = grid_obj.get_price_from_picking(cr, uid, grid_id,
invoice.amount_untaxed, picking.weight, picking.volume,
quantity, context=context)
+ if invoice.company_id.currency_id.id != invoice.currency_id.id:
+ price = currency_obj.compute(cr, uid, invoice.company_id.currency_id.id, invoice.currency_id.id,
+ price, context=dict(context or {}, date=invoice.date_invoice))
account_id = picking.carrier_id.product_id.property_account_income.id
if not account_id:
account_id = picking.carrier_id.product_id.categ_id\
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 87bf4ec1e68..877876b57f0 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -42,6 +42,7 @@ from openerp.exceptions import UserError
_logger = logging.getLogger(__name__)
MAX_POP_MESSAGES = 50
+MAIL_TIMEOUT = 60
# Workaround for Python 2.7.8 bug https://bugs.python.org/issue23906
poplib._MAXLINE = 65536
@@ -155,6 +156,8 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p
#connection.user("recent:"+server.user)
connection.user(server.user)
connection.pass_(server.password)
+ # Add timeout on socket
+ connection.sock.settimeout(MAIL_TIMEOUT)
return connection
def button_confirm_login(self, cr, uid, ids, context=None):
diff --git a/addons/google_account/google_account.py b/addons/google_account/google_account.py
index 2cc56d0cba4..ea1482d6925 100644
--- a/addons/google_account/google_account.py
+++ b/addons/google_account/google_account.py
@@ -163,13 +163,13 @@ class google_service(osv.osv_memory):
except:
pass
except urllib2.HTTPError, e:
- if e.code in (400, 401, 410):
- raise e
- elif e.code in (204, 404):
+ if e.code in (204, 404):
status = e.code
response = ""
else:
_logger.exception("Bad google request : %s !" % e.read())
+ if e.code in (400, 401, 410):
+ raise e
raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong with your request to google"), context=context)
return (status, response, ask_time)
diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py
index 4cd17942c1e..b71af0b5279 100644
--- a/addons/google_calendar/google_calendar.py
+++ b/addons/google_calendar/google_calendar.py
@@ -216,8 +216,10 @@ class google_calendar(osv.AbstractModel):
vstype = 'date'
attendee_list = []
for attendee in event.attendee_ids:
+ email = tools.email_split(attendee.email)
+ email = email[0] if email else 'NoEmail@mail.com'
attendee_list.append({
- 'email': attendee.email or 'NoEmail@mail.com',
+ 'email': email,
'displayName': attendee.partner_id.name,
'responseStatus': attendee.state or 'needsAction',
})
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py
index c81ab6016de..d475a10f6a6 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py
@@ -221,17 +221,17 @@ class account_analytic_line(osv.osv):
if factor.customer_name:
factor_name += ' - ' + factor.customer_name
- general_account = product.property_account_income or product.categ_id.property_account_income_categ
- if not general_account:
- raise UserError(_("Configuration Error!") + '\n' + _("Please define income account for product '%s'.") % product.name)
- taxes = product.taxes_id or general_account.tax_ids
- tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes)
- curr_invoice_line.update({
- 'invoice_line_tax_id': [(6, 0, tax)],
- 'name': factor_name,
- 'invoice_line_tax_id': [(6, 0, tax)],
- 'account_id': general_account.id,
- })
+ general_account = product.property_account_income or product.categ_id.property_account_income_categ
+ if not general_account:
+ raise UserError(_("Configuration Error!") + '\n' + _("Please define income account for product '%s'.") % product.name)
+ taxes = product.taxes_id or general_account.tax_ids
+ tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ curr_invoice_line.update({
+ 'invoice_line_tax_id': [(6, 0, tax)],
+ 'name': factor_name,
+ 'invoice_line_tax_id': [(6, 0, tax)],
+ 'account_id': general_account.id,
+ })
note = []
for line in analytic_lines:
diff --git a/addons/l10n_be/account_tax_template.xml b/addons/l10n_be/account_tax_template.xml
index 6958673ae8b..939f9dac732 100644
--- a/addons/l10n_be/account_tax_template.xml
+++ b/addons/l10n_be/account_tax_template.xml
@@ -6,7 +6,7 @@
10
VAT-OUT-21-S
- VAT 21% - Services
+ TVA 21% - Services
@@ -27,7 +27,7 @@
11
VAT-OUT-21-L
- VAT 21%
+ TVA 21%
@@ -48,7 +48,7 @@
20
VAT-OUT-12-S
- VAT 12% - Services
+ TVA 12% - Services
@@ -69,7 +69,7 @@
21
VAT-OUT-12-L
- VAT 12%
+ TVA 12%
@@ -90,7 +90,7 @@
30
VAT-OUT-06-S
- VAT 6% - Services
+ TVA 6% - Services
@@ -111,7 +111,7 @@
31
VAT-OUT-06-L
- VAT 6%
+ TVA 6%
@@ -132,7 +132,7 @@
40
VAT-OUT-00-S
- VAT 0% - Services
+ TVA 0% - Services
0
percent
@@ -149,7 +149,7 @@
41
VAT-OUT-00-L
- VAT 0%
+ TVA 0%
0
percent
@@ -166,7 +166,7 @@
50
VAT-OUT-00-CC
- VAT 0% Cocontractant
+ TVA 0% Cocontractant
0
percent
@@ -183,7 +183,7 @@
60
VAT-OUT-00-EU-S
- Services EU
+ TVA services EU
0
percent
@@ -200,7 +200,7 @@
61
VAT-OUT-00-EU-L
- Marchandises EU (Code L)
+ TVA Marchandises EU (Code L)
0
percent
@@ -217,7 +217,7 @@
62
VAT-OUT-00-EU-T
- Marchandises EU (Code T)
+ TVA marchandises EU (Code T)
0
percent
@@ -234,7 +234,7 @@
70
VAT-OUT-00-ROW
- Export hors EU
+ TVA export hors EU
0
percent
@@ -1981,7 +1981,7 @@
710
VAT-IN-V82-CAR-INC
- TVA Entrant - Frais de voiture - VAT 50% Non Deductible (Price Incl.)
+ TVA entrante - Frais de voiture - TVA 50% Non Deductible (Price Incl.)
1
percent
@@ -1996,7 +1996,7 @@
711
VAT-IN-V82-CAR-INC-C1
- Frais de voiture - VAT 50% Deductible
+ Frais de voiture - TVA 50% Deductible
@@ -2018,7 +2018,7 @@
712
VAT-IN-V82-CAR-INC-C2
- Frais de voiture - Montant de la note de crédit
+ TVA frais de voiture - Montant de la note de crédit
0
@@ -2035,7 +2035,7 @@
720
VAT-IN-V82-CAR-EXC
- TVA Entrant - Frais de voiture - VAT 50% Non Deductible (Price Excl.)
+ TVA entrante - Frais de voiture - TVA 50% Non Déductible (Prix Excl.)
1
percent
@@ -2050,7 +2050,7 @@
721
VAT-IN-V82-CAR-EXC-C1
- Frais de voiture - VAT 50% Non Deductible
+ Frais de voiture - TVA 50% Non Deductible
@@ -2072,7 +2072,7 @@
722
VAT-IN-V82-CAR-EXC-C2
- Frais de voiture - VAT 50% Deductible (Price Excl.)
+ Frais de voiture - TVA 50% Deductible (Prix Excl.)
@@ -2092,7 +2092,7 @@
723
VAT-IN-V82-CAR-EXC-C3
- Frais de voiture - Montant de la note de crédit (Price Excl.)
+ TVA frais de voiture - Montant de la note de crédit (Prix Excl.)
0
diff --git a/addons/l10n_be_coda/l10n_be_coda_demo.xml b/addons/l10n_be_coda/l10n_be_coda_demo.xml
index ce44539a715..0d4671ccb24 100644
--- a/addons/l10n_be_coda/l10n_be_coda_demo.xml
+++ b/addons/l10n_be_coda/l10n_be_coda_demo.xml
@@ -45,6 +45,7 @@
bba
+++240/2838/42818+++
+ 2011-01-20
Otpez Laptop without OS
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index a3a1d08306c..983d2e5dfe4 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -436,7 +436,7 @@ openerp.mail = function (session) {
*/
on_attachment_loaded: function (event, result) {
- if (result.erorr || !result.id ) {
+ if (result.error || !result.id ) {
this.do_warn( session.web.qweb.render('mail.error_upload'), result.error);
this.attachment_ids = _.filter(this.attachment_ids, function (val) { return !val.upload; });
} else {
diff --git a/addons/mrp_byproduct/mrp_byproduct.py b/addons/mrp_byproduct/mrp_byproduct.py
index 56d5f9aa7d4..40996771736 100644
--- a/addons/mrp_byproduct/mrp_byproduct.py
+++ b/addons/mrp_byproduct/mrp_byproduct.py
@@ -94,23 +94,15 @@ class mrp_production(osv.osv):
for sub_product in production.bom_id.sub_products:
product_uom_factor = product_uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, production.bom_id.product_uom.id)
qty1 = sub_product.product_qty
- qty2 = production.product_uos and production.product_uos_qty or False
- product_uos_factor = 0.0
- if qty2 and production.bom_id.product_uos.id:
- product_uos_factor = product_uom_obj._compute_qty(cr, uid, production.product_uos.id, production.product_uos_qty, production.bom_id.product_uos.id)
if sub_product.subproduct_type == 'variable':
if production.product_qty:
qty1 *= product_uom_factor / (production.bom_id.product_qty or 1.0)
- if production.product_uos_qty:
- qty2 *= product_uos_factor / (production.bom_id.product_uos_qty or 1.0)
data = {
'name': 'PROD:'+production.name,
'date': production.date_planned,
'product_id': sub_product.product_id.id,
'product_uom_qty': qty1,
'product_uom': sub_product.product_uom.id,
- 'product_uos_qty': qty2,
- 'product_uos': production.product_uos and production.product_uos.id or False,
'location_id': source,
'location_dest_id': production.location_dest_id.id,
'move_dest_id': production.move_prod_id.id,
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 06a2b1662e8..c5a291a37f2 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -381,7 +381,7 @@ class PaymentTransaction(osv.Model):
('done', 'Done'), ('error', 'Error'),
('cancel', 'Canceled')
], 'Status', required=True,
- track_visiblity='onchange', copy=False),
+ track_visibility='onchange', copy=False),
'state_message': fields.text('Message',
help='Field used to store error and/or validation messages for information'),
# payment
diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml
index 538f673f264..8cfe24bca85 100644
--- a/addons/purchase/partner_view.xml
+++ b/addons/purchase/partner_view.xml
@@ -91,7 +91,7 @@
res.partner
-
+