@@ -1101,9 +1101,10 @@ class account_move_line(osv.osv):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
if context is None:
|
||||
context = {}
|
||||
company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False)
|
||||
if company_id:
|
||||
vals['company_id'] = company_id[0]
|
||||
if vals.get('move_id', False):
|
||||
company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False)
|
||||
if company_id:
|
||||
vals['company_id'] = company_id[0]
|
||||
self._check_date(cr, uid, vals, context, check)
|
||||
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
|
||||
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Available Holidays" type="bar">
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="taken_leaves" string="Leave Days" operator="+"/>
|
||||
<field name="remaining_leave" string="Remaining Days" operator="+"/>
|
||||
<field name="taken_leaves" string="Taken Leaves" operator="+"/>
|
||||
<field name="max_leave" string="Allocated Leaves" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
@@ -48,10 +48,10 @@
|
||||
<search string="Leaves">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string=" Year " domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]" help="Available Leaves of current year"/>
|
||||
<filter icon="terp-go-month" string=" Month " name="month"
|
||||
<filter icon="terp-go-month" string=" Month " name="month"
|
||||
domain="[('date','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Available Leaves of current month"/>
|
||||
<filter icon="terp-go-month" string=" Month-1 " separator="1"
|
||||
<filter icon="terp-go-month" string=" Month-1 " separator="1"
|
||||
domain="[('date','<=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Available Leaves of last month"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import netsvc
|
||||
|
||||
from osv import fields, osv
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
|
||||
class one2many_mod2(fields.one2many):
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
|
||||
Reference in New Issue
Block a user