diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 51f0d43c350..f8f482dfdda 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -310,7 +310,7 @@
-
+
@@ -466,7 +466,7 @@
- Credit Memo
+ Customer Refundsaccount.invoiceformtree,form,calendar,graph
@@ -474,7 +474,7 @@
[('type','=','out_refund')]{'type':'out_refund', 'journal_type': 'sale_refund'}
- Credit Memo helps you manage the credit notes issued/to be issued for your customers. A refund invoice is a document that cancels an invoice or a part of it. You can easily generate refunds and reconcile them from the invoice form.
+ This menu helps you manage the credit notes issued/to be issued for your customers. A refund invoice is a document that cancels an invoice or a part of it. You can easily generate refunds and reconcile them from the invoice form.
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 932a8799c36..2b12b6f91c5 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2446,7 +2446,7 @@
-
+
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 6f39652d34b..b6d8fcb9de0 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -1397,30 +1397,20 @@ class account_invoice_line(osv.osv):
a = res.product_tmpl_id.property_account_expense.id
if not a:
a = res.categ_id.property_account_expense_categ.id
-
a = fpos_obj.map_account(cr, uid, fpos, a)
if a:
result['account_id'] = a
- tax_ids = tax_obj.search(cr, uid, [('company_id', '=', company_id)])
if type in ('out_invoice', 'out_refund'):
- sale_taxes_def = map(lambda x: x.id, res.taxes_id)
- sale_tax_ids = [tax for tax in tax_ids if tax in sale_taxes_def]
- sale_taxes = tax_obj.browse(cr, uid, sale_tax_ids)
- sale_taxes_all = sale_taxes and sale_taxes or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False)
- tax_id = fpos_obj.map_tax(cr, uid, fpos, sale_taxes_all)
+ taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
else:
- pur_taxes_def = map(lambda x: x.id, res.supplier_taxes_id)
- pur_tax_ids = [tax for tax in tax_ids if tax in pur_taxes_def]
- pur_taxes = tax_obj.browse(cr, uid, pur_tax_ids)
- pur_taxes_all = pur_taxes and pur_taxes or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False)
- tax_id = fpos_obj.map_tax(cr, uid, fpos, pur_taxes_all)
+ taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
+ tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
if type in ('in_invoice', 'in_refund'):
result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )
else:
result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
-# if not name:
result['name'] = res.partner_ref
domain = {}
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 347a82e33c2..5f429270e29 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -79,7 +79,7 @@
Tax multi-company
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+ ['|',('company_id','=',False),('company_id','=',user.company_id.id)]
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index c874cc3e5d2..b7775c48c8d 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -72,8 +72,8 @@
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
-"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,0,0,0
-"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,0,0,0
+"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,1,1,1
+"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 5907c9ac797..8fe5da805b4 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -155,9 +155,7 @@ class hr_holidays(osv.osv):
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
'category_id': fields.many2one('hr.employee.category', "Category", help='Category Of employee'),
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
- 'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)'),
- # Todo: Add below field in view?
- 'category_holiday_id': fields.many2one('hr.holidays', 'Holiday', help='For allocation By Employee Category (Link between Employee Category holiday and related holidays for employees of that category)')
+ 'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
}
_defaults = {
@@ -169,14 +167,6 @@ class hr_holidays(osv.osv):
'holiday_type': 'employee'
}
- def _get_category_leave_ids(self, cr, uid, ids):
- """Returns the leaves taken by the employees of the category if holiday type is 'category'."""
- leave_ids = []
- for record in self.browse(cr, uid, ids):
- if record.holiday_type == 'category' and record.type == 'remove':
- leave_ids += self.search(cr, uid, [('category_holiday_id', '=', record.id)])
- return leave_ids
-
def _create_resource_leave(self, cr, uid, vals, context=None):
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
obj_res_leave = self.pool.get('resource.calendar.leaves')
@@ -240,6 +230,7 @@ class hr_holidays(osv.osv):
list_ids = [ lr.id for lr in record.linked_request_ids]
self.holidays_cancel(cr, uid, list_ids)
self.unlink(cr, uid, list_ids)
+ return True
def _check_date(self, cr, uid, ids, context=None):
for rec in self.read(cr, uid, ids, ['number_of_days_temp', 'date_from','date_to', 'type']):
@@ -257,7 +248,6 @@ class hr_holidays(osv.osv):
def unlink(self, cr, uid, ids, context=None):
self._update_user_holidays(cr, uid, ids)
- ids += self._get_category_leave_ids(cr, uid, ids)
self._remove_resouce_leave(cr, uid, ids, context=context)
return super(hr_holidays, self).unlink(cr, uid, ids, context)
@@ -341,32 +331,35 @@ class hr_holidays(osv.osv):
'holiday_id': record.id
}
self._create_resource_leave(cr, uid, vals)
- elif record.holiday_type == 'category' and record.type == 'remove':
+ elif record.holiday_type == 'category':
+ # Create leave/allocation request for employees in the category
emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
+ leave_ids = []
for emp in obj_emp.browse(cr, uid, emp_ids):
vals = {
- 'name': record.name,
- 'date_from': record.date_from,
- 'date_to': record.date_to,
- 'calendar_id': emp.calendar_id.id,
- 'company_id': emp.company_id.id,
- 'resource_id': emp.resource_id.id,
- 'holiday_id':record.id
- }
-# self._create_resource_leave(cr, uid, vals)
- # Validate all the leave requests of the category
- for leave_id in self.search(cr, uid, [('category_holiday_id', '=', record.id)]):
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
+ 'name': record.name,
+ 'type': record.type,
+ 'holiday_type': 'employee',
+ 'holiday_status_id': record.holiday_status_id.id,
+ 'date_from': record.date_from,
+ 'date_to': record.date_to,
+ 'notes': record.notes,
+ 'number_of_days_temp': record.number_of_days_temp,
+ 'parent_id': record.id,
+ 'employee_id': emp.id
+ }
+ leave_ids.append(self.create(cr, uid, vals, context=None))
+ # Confirm and validate all the leave requests of the category
+ for leave_id in leave_ids:
+ wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
+ wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
return True
def holidays_confirm(self, cr, uid, ids, *args):
obj_hr_holiday_status = self.pool.get('hr.holidays.status')
- obj_emp = self.pool.get('hr.employee')
- wf_service = netsvc.LocalService("workflow")
for record in self.browse(cr, uid, ids):
user_id = False
leave_asked = record.number_of_days_temp
- leave_ids = []
if record.holiday_type == 'employee' and record.type == 'remove':
if record.employee_id and not record.holiday_status_id.limit:
leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
@@ -379,23 +372,6 @@ class hr_holidays(osv.osv):
if leaves_rest < leave_asked:
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name))
nb = -(record.number_of_days_temp)
- # Create leave request for employees in the category
- emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
- for emp in obj_emp.browse(cr, uid, emp_ids):
- vals = {
- 'name': record.name,
- 'holiday_status_id': record.holiday_status_id.id,
- 'date_from': record.date_from,
- 'date_to': record.date_to,
- 'notes': record.notes,
- 'number_of_days_temp': record.number_of_days_temp,
- 'category_holiday_id': record.id,
- 'employee_id': emp.id
- }
- leave_ids.append(self.create(cr, uid, vals, context=None))
- # Confirm all the leave requests of the category
- for leave_id in leave_ids:
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
else:
nb = record.number_of_days_temp
@@ -420,11 +396,8 @@ class hr_holidays(osv.osv):
def holidays_cancel(self, cr, uid, ids, *args):
self._update_user_holidays(cr, uid, ids)
- self._remove_resouce_leave(cr, uid, ids)
self.write(cr, uid, ids, {'state': 'cancel'})
- leave_ids = self._get_category_leave_ids(cr, uid, ids)
- if leave_ids:
- self.unlink(cr, uid, leave_ids) # unlink all the leave requests of the category
+ self._remove_resouce_leave(cr, uid, ids)
return True
def holidays_draft(self, cr, uid, ids, *args):
diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml
index cb8897f141e..8ecd991ce8d 100644
--- a/addons/hr_payroll/hr_payroll_view.xml
+++ b/addons/hr_payroll/hr_payroll_view.xml
@@ -87,18 +87,6 @@
-
- res.partner.bank.form
- res.partner.bank
- form
-
-
-
-
-
-
-
-
hr.hr.employee.view.form2hr.employee
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 227d317bd30..0aa1d6e7f62 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -162,7 +162,7 @@
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 29cd5ea593a..a789ad287f3 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -724,7 +724,6 @@ class sale_order(osv.osv):
})
proc_ids.append(proc_id)
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
-
if order.state == 'shipping_except':
for pick in order.picking_ids:
for move in pick.move_lines:
diff --git a/addons/sale_layout/__openerp__.py b/addons/sale_layout/__openerp__.py
index 1f771ff3044..f8db8d5d868 100755
--- a/addons/sale_layout/__openerp__.py
+++ b/addons/sale_layout/__openerp__.py
@@ -27,7 +27,7 @@
This module provides features to improve the layout of the Sales Order.
It gives you the possibility to
- * order all the lines of an sales order
+ * order all the lines of a sales order
* add titles, comment lines, sub total lines
* draw horizontal lines and put page breaks