diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 2117f6e49ea..f0a420f7496 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -39,7 +39,6 @@ class account_analytic_line(osv.osv):
}
_defaults = {
- 'date': fields.date.context_today,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
_order = 'date desc'
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 16393f0ea49..b01fc974bef 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -865,8 +865,11 @@ class account_invoice(osv.osv):
self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
# I disabled the check_total feature
- #if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
- # raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
+ group_check_total_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'group_supplier_inv_check_total')[1]
+ group_check_total = self.pool.get('res.groups').browse(cr, uid, group_check_total_id, context=context)
+ if group_check_total and uid in [x.id for x in group_check_total.users]:
+ if (inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0)):
+ raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe encoded total does not match the computed total.'))
if inv.payment_term:
total_fixed = total_percent = 0
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index b08a5f1a410..2f722d07aeb 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -186,6 +186,7 @@
+
diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 17df4377548..41121db20f7 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -120,6 +120,8 @@ class account_config_settings(osv.osv_memory):
'group_analytic_accounting': fields.boolean('Analytic accounting',
implied_group='analytic.group_analytic_accounting',
help="Allows you to use the analytic accounting."),
+ 'group_check_supplier_invoice_total': fields.boolean('Check the total of supplier invoices',
+ implied_group="account.group_supplier_inv_check_total"),
}
def _default_company(self, cr, uid, context=None):
diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml
index 728eefe8078..d4bafca41be 100644
--- a/addons/account/res_config_view.xml
+++ b/addons/account/res_config_view.xml
@@ -220,6 +220,10 @@
+
+
+
+
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 4b90e0c8ad5..cc44f866169 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -26,6 +26,11 @@
+
+ Check Total on supplier invoices
+
+
+
Account Entry
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index f25318727df..e1caf190316 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -988,11 +988,11 @@ class account_voucher(osv.osv):
if amount_residual > 0:
account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
if not account_id:
- raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Expense Currency Rate' on the company, then create accounting entry for currency rate difference."))
+ raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Loss Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
else:
account_id = line.voucher_id.company_id.income_currency_exchange_account_id
if not account_id:
- raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Income Currency Rate' on the company, then create accounting entry for currency rate difference."))
+ raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
# Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
# the receivable/payable account may have a secondary currency, which render this field mandatory
account_currency_id = company_currency <> current_currency and current_currency or False
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 3cb98d81f43..35fd6674d06 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -305,8 +305,15 @@ class account_analytic_line(osv.osv):
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
}
+
+ def _get_default_date(self, cr, uid, context=None):
+ return fields.date.context_today(self, cr, uid, context=context)
+
+ def __get_default_date(self, cr, uid, context=None):
+ return self._get_default_date(cr, uid, context=context)
+
_defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'date': __get_default_date,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
'amount': 0.00
}
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 4e51864db51..9902d82d95b 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -223,16 +223,26 @@ class hr_timesheet_sheet(osv.osv):
hr_timesheet_sheet()
-
-class hr_timesheet_line(osv.osv):
- _inherit = "hr.analytic.timesheet"
+class account_analytic_line(osv.osv):
+ _inherit = "account.analytic.line"
def _get_default_date(self, cr, uid, context=None):
if context is None:
context = {}
- if 'date' in context:
- return context['date']
- return time.strftime('%Y-%m-%d')
+ #get the default date (should be: today)
+ res = super(account_analytic_line, self)._get_default_date(cr, uid, context=context)
+ #if we got the dates from and to from the timesheet and if the default date is in between, we use the default
+ #but if the default isn't included in those dates, we use the date start of the timesheet as default
+ if context.get('timesheet_date_from') and context.get('timesheet_date_to'):
+ if context['timesheet_date_from'] <= res <= context['timesheet_date_to']:
+ return res
+ return context.get('timesheet_date_from')
+ #if we don't get the dates from the timesheet, we return the default value from super()
+ return res
+
+
+class hr_timesheet_line(osv.osv):
+ _inherit = "hr.analytic.timesheet"
def _sheet(self, cursor, user, ids, name, args, context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
@@ -278,9 +288,6 @@ class hr_timesheet_line(osv.osv):
},
),
}
- _defaults = {
- 'date': _get_default_date,
- }
def _check_sheet_state(self, cr, uid, ids, context=None):
if context is None:
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index c41aae4c21f..5cbb46f74a6 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -103,7 +103,7 @@
-
+
diff --git a/addons/sale_crm/__openerp__.py b/addons/sale_crm/__openerp__.py
index 88608af8922..82e267337f9 100644
--- a/addons/sale_crm/__openerp__.py
+++ b/addons/sale_crm/__openerp__.py
@@ -37,7 +37,7 @@ modules.
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/crm_statistics_dashboard.jpeg', 'images/opportunity_to_quote.jpeg'],
- 'depends': ['sale_stock', 'crm'],
+ 'depends': ['sale', 'crm'],
'data': [
'wizard/crm_make_sale_view.xml',
'sale_crm_view.xml',
diff --git a/addons/sale_margin/__openerp__.py b/addons/sale_margin/__openerp__.py
index bb2f78f409c..badb87d3628 100644
--- a/addons/sale_margin/__openerp__.py
+++ b/addons/sale_margin/__openerp__.py
@@ -31,7 +31,7 @@ Price and Cost Price.
""",
'author':'OpenERP SA',
'images':['images/sale_margin.jpeg'],
- 'depends':['sale_stock'],
+ 'depends':['sale'],
'demo':['sale_margin_demo.xml'],
'test': ['test/sale_margin.yml'],
'data':['security/ir.model.access.csv','sale_margin_view.xml'],
diff --git a/addons/sale_margin/test/sale_margin.yml b/addons/sale_margin/test/sale_margin.yml
index 8038ea1aa5f..1d6b295b3a1 100644
--- a/addons/sale_margin/test/sale_margin.yml
+++ b/addons/sale_margin/test/sale_margin.yml
@@ -14,7 +14,6 @@
product_uom: product.product_uom_unit
product_uom_qty: 100.0
state: draft
- delay: 7.0
product_id: product.product_product_24
product_uos_qty: 100.0
th_weight: 0.0
@@ -23,7 +22,6 @@
partner_id: base.res_partner_4
partner_invoice_id: base.res_partner_address_7
partner_shipping_id: base.res_partner_address_7
- picking_policy: direct
pricelist_id: product.list0
shop_id: sale.sale_shop_1
-
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 999b495a4d5..dffe1d69cc1 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -618,7 +618,7 @@ class stock_picking(osv.osv):
def create(self, cr, user, vals, context=None):
if ('name' not in vals) or (vals.get('name')=='/'):
- seq_obj_name = 'stock.picking.' + vals['type']
+ seq_obj_name = self._name
vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name)
new_id = super(stock_picking, self).create(cr, user, vals, context)
if new_id:
diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js
index fe955379c21..2f92950262c 100644
--- a/addons/web_shortcuts/static/src/js/web_shortcuts.js
+++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js
@@ -82,7 +82,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
// TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'})
self.rpc('/web/menu/action', {'menu_id': id}).then(function(ir_menu_data) {
if (ir_menu_data.action.length){
- instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id});
+ instance.webclient.on_menu_action({action_id: ir_menu_data.action[0][2].id});
}
});
this.$el.find('.oe_systray_shortcuts').trigger('mouseout');