merge from trunk
bzr revid: ls@numerigraphe.fr-20090205175616-sw42e2tk7xeyzjqi
This commit is contained in:
commit
eee44f919a
|
@ -70,6 +70,6 @@
|
|||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '80331923549',
|
||||
'certificate': '0080331923549',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -52,17 +52,17 @@ class account_payment_term(osv.osv):
|
|||
amount = value
|
||||
result = []
|
||||
for line in pt.line_ids:
|
||||
if line.value=='fixed':
|
||||
if line.value == 'fixed':
|
||||
amt = round(line.value_amount, 2)
|
||||
elif line.value=='procent':
|
||||
elif line.value == 'procent':
|
||||
amt = round(value * line.value_amount, 2)
|
||||
elif line.value=='balance':
|
||||
elif line.value == 'balance':
|
||||
amt = round(amount, 2)
|
||||
if amt:
|
||||
next_date = mx.DateTime.strptime(date_ref, '%Y-%m-%d') + RelativeDateTime(days=line.days)
|
||||
if line.days2<0:
|
||||
if line.days2 < 0:
|
||||
next_date += RelativeDateTime(day=line.days2)
|
||||
if line.days2>0:
|
||||
if line.days2 > 0:
|
||||
next_date += RelativeDateTime(day=line.days2, months=1)
|
||||
result.append( (next_date.strftime('%Y-%m-%d'), amt) )
|
||||
amount -= amt
|
||||
|
@ -74,14 +74,14 @@ class account_payment_term_line(osv.osv):
|
|||
_name = "account.payment.term.line"
|
||||
_description = "Payment Term Line"
|
||||
_columns = {
|
||||
'name': fields.char('Line Name', size=32,required=True),
|
||||
'name': fields.char('Line Name', size=32, required=True),
|
||||
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"),
|
||||
'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True),
|
||||
'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Value',required=True),
|
||||
'value_amount': fields.float('Value Amount'),
|
||||
'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month." \
|
||||
'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \
|
||||
"If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."),
|
||||
'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),
|
||||
'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True),
|
||||
'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),
|
||||
'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True),
|
||||
}
|
||||
_defaults = {
|
||||
'value': lambda *a: 'balance',
|
||||
|
@ -100,7 +100,7 @@ class account_account_type(osv.osv):
|
|||
'code': fields.char('Code', size=32, required=True),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of account types."),
|
||||
'partner_account': fields.boolean('Partner account'),
|
||||
'close_method': fields.selection([('none','None'), ('balance','Balance'), ('detail','Detail'),('unreconciled','Unreconciled')], 'Deferral Method', required=True),
|
||||
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
|
||||
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -131,7 +131,6 @@ class account_account(osv.osv):
|
|||
_name = "account.account"
|
||||
_description = "Account"
|
||||
_parent_store = True
|
||||
_parent_order = 'length(code),code'
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
|
@ -139,11 +138,11 @@ class account_account(osv.osv):
|
|||
context = {}
|
||||
pos = 0
|
||||
|
||||
while pos<len(args):
|
||||
while pos < len(args):
|
||||
|
||||
if args[pos][0]=='code' and args[pos][1] in ('like','ilike') and args[pos][2]:
|
||||
args[pos] = ('code', '=like', str(args[pos][2].replace('%',''))+'%')
|
||||
if args[pos][0]=='journal_id':
|
||||
if args[pos][0] == 'code' and args[pos][1] in ('like', 'ilike') and args[pos][2]:
|
||||
args[pos] = ('code', '=like', str(args[pos][2].replace('%', ''))+'%')
|
||||
if args[pos][0] == 'journal_id':
|
||||
if not args[pos][2]:
|
||||
del args[pos]
|
||||
continue
|
||||
|
@ -152,19 +151,19 @@ class account_account(osv.osv):
|
|||
del args[pos]
|
||||
continue
|
||||
ids3 = map(lambda x: x.code, jour.type_control_ids)
|
||||
ids1 = super(account_account,self).search(cr, uid, [('type','in',ids3)])
|
||||
ids1 = super(account_account, self).search(cr, uid, [('type', 'in', ids3)])
|
||||
ids1 += map(lambda x: x.id, jour.account_control_ids)
|
||||
args[pos] = ('id','in',ids1)
|
||||
pos+=1
|
||||
args[pos] = ('id', 'in', ids1)
|
||||
pos += 1
|
||||
|
||||
if context and context.has_key('consolidate_childs'): #add consolidated childs of accounts
|
||||
ids = super(account_account,self).search(cr, uid, args, offset, limit,
|
||||
ids = super(account_account, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
for consolidate_child in self.browse(cr, uid, context['account_id']).child_consol_ids:
|
||||
ids.append(consolidate_child.id)
|
||||
return ids
|
||||
|
||||
return super(account_account,self).search(cr, uid, args, offset, limit,
|
||||
return super(account_account, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
def _get_children_and_consol(self, cr, uid, ids, context={}):
|
||||
|
@ -176,7 +175,7 @@ class account_account(osv.osv):
|
|||
ids3.append(child.id)
|
||||
if ids3:
|
||||
ids3 = self._get_children_and_consol(cr, uid, ids3, context)
|
||||
return ids2+ids3
|
||||
return ids2 + ids3
|
||||
|
||||
def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''):
|
||||
#compute the balance/debit/credit accordingly to the value of field_name for the given account ids
|
||||
|
@ -237,12 +236,12 @@ class account_account(osv.osv):
|
|||
return result
|
||||
|
||||
def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result={}
|
||||
result = {}
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
if record.child_parent_ids:
|
||||
result[record.id]=[x.id for x in record.child_parent_ids]
|
||||
result[record.id] = [x.id for x in record.child_parent_ids]
|
||||
else:
|
||||
result[record.id]=[]
|
||||
result[record.id] = []
|
||||
|
||||
if record.child_consol_ids:
|
||||
for acc in record.child_consol_ids:
|
||||
|
@ -255,26 +254,26 @@ class account_account(osv.osv):
|
|||
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Force all moves for this account to have this secondary currency."),
|
||||
'code': fields.char('Code', size=64, required=True),
|
||||
'type': fields.selection([
|
||||
('receivable','Receivable'),
|
||||
('payable','Payable'),
|
||||
('view','View'),
|
||||
('consolidation','Consolidation'),
|
||||
('other','Others'),
|
||||
('closed','Closed'),
|
||||
('receivable', 'Receivable'),
|
||||
('payable', 'Payable'),
|
||||
('view', 'View'),
|
||||
('consolidation', 'Consolidation'),
|
||||
('other', 'Others'),
|
||||
('closed', 'Closed'),
|
||||
], 'Internal Type', required=True,),
|
||||
|
||||
'user_type': fields.many2one('account.account.type', 'Account Type', required=True),
|
||||
'parent_id': fields.many2one('account.account','Parent', ondelete='cascade'),
|
||||
'child_parent_ids':fields.one2many('account.account','parent_id','Children'),
|
||||
'child_consol_ids':fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'),
|
||||
'child_id': fields.function(_get_child_ids, method=True, type='many2many',relation="account.account",string="Child Accounts"),
|
||||
'balance': fields.function(__compute, digits=(16,2), method=True, string='Balance', multi='balance'),
|
||||
'credit': fields.function(__compute, digits=(16,2), method=True, string='Credit', multi='balance'),
|
||||
'debit': fields.function(__compute, digits=(16,2), method=True, string='Debit', multi='balance'),
|
||||
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
|
||||
'child_parent_ids': fields.one2many('account.account','parent_id','Children'),
|
||||
'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'),
|
||||
'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"),
|
||||
'balance': fields.function(__compute, digits=(16, 2), method=True, string='Balance', multi='balance'),
|
||||
'credit': fields.function(__compute, digits=(16, 2), method=True, string='Credit', multi='balance'),
|
||||
'debit': fields.function(__compute, digits=(16, 2), method=True, string='Debit', multi='balance'),
|
||||
'reconcile': fields.boolean('Reconcile', help="Check this if the user is allowed to reconcile entries in this account."),
|
||||
'shortcut': fields.char('Shortcut', size=12),
|
||||
'tax_ids': fields.many2many('account.tax', 'account_account_tax_default_rel',
|
||||
'account_id','tax_id', 'Default Taxes'),
|
||||
'account_id', 'tax_id', 'Default Taxes'),
|
||||
'note': fields.text('Note'),
|
||||
'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Company Currency'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
|
@ -282,7 +281,7 @@ class account_account(osv.osv):
|
|||
|
||||
'parent_left': fields.integer('Parent Left', select=1),
|
||||
'parent_right': fields.integer('Parent Right', select=1),
|
||||
'currency_mode': fields.selection([('current','At Date'),('average','Average Rate')], 'Outgoing Currencies Rate',
|
||||
'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',
|
||||
help=
|
||||
'This will select how the current currency rate for outgoing transactions is computed. '\
|
||||
'In most countries the legal method is "average" but only a few software systems are able to '\
|
||||
|
@ -301,7 +300,7 @@ class account_account(osv.osv):
|
|||
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
_defaults = {
|
||||
'type' : lambda *a :'view',
|
||||
'type': lambda *a : 'view',
|
||||
'reconcile': lambda *a: False,
|
||||
'company_id': _default_company,
|
||||
'active': lambda *a: True,
|
||||
|
@ -310,22 +309,22 @@ class account_account(osv.osv):
|
|||
}
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
obj_self=self.browse(cr,uid,ids[0])
|
||||
p_id=obj_self.parent_id and obj_self.parent_id.id
|
||||
obj_self = self.browse(cr, uid, ids[0])
|
||||
p_id = obj_self.parent_id and obj_self.parent_id.id
|
||||
if (obj_self in obj_self.child_consol_ids) or (p_id and (p_id is obj_self.id)):
|
||||
return False
|
||||
while(ids):
|
||||
cr.execute('select distinct child_id from account_account_consol_rel where parent_id in ('+','.join(map(str,ids))+')')
|
||||
child_ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
c_ids=child_ids
|
||||
cr.execute('select distinct child_id from account_account_consol_rel where parent_id in ('+','.join(map(str, ids))+')')
|
||||
child_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
|
||||
c_ids = child_ids
|
||||
if (p_id and (p_id in c_ids)) or (obj_self.id in c_ids):
|
||||
return False
|
||||
while len(c_ids):
|
||||
s_ids=self.search(cr,uid,[('parent_id','in',c_ids)])
|
||||
s_ids = self.search(cr, uid, [('parent_id', 'in', c_ids)])
|
||||
if p_id and (p_id in s_ids):
|
||||
return False
|
||||
c_ids=s_ids
|
||||
ids=child_ids
|
||||
c_ids = s_ids
|
||||
ids = child_ids
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
|
@ -333,7 +332,7 @@ class account_account(osv.osv):
|
|||
]
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
if not args:
|
||||
args=[]
|
||||
args = []
|
||||
if not context:
|
||||
context = {}
|
||||
args = args[:]
|
||||
|
@ -342,20 +341,20 @@ class account_account(osv.osv):
|
|||
if name and str(name).startswith('partner:'):
|
||||
part_id = int(name.split(':')[1])
|
||||
part = self.pool.get('res.partner').browse(cr, user, part_id, context)
|
||||
args += [('id','in', (part.property_account_payable.id, part.property_account_receivable.id))]
|
||||
args += [('id', 'in', (part.property_account_payable.id, part.property_account_receivable.id))]
|
||||
name = False
|
||||
if name and str(name).startswith('type:'):
|
||||
type = name.split(':')[1]
|
||||
args += [('type','=', type)]
|
||||
args += [('type', '=', type)]
|
||||
name = False
|
||||
except:
|
||||
pass
|
||||
if name:
|
||||
ids = self.search(cr, user, [('code','=like',name+"%")]+ args, limit=limit)
|
||||
ids = self.search(cr, user, [('code', '=like', name+"%")]+args, limit=limit)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('shortcut','=',name)]+ args, limit=limit)
|
||||
ids = self.search(cr, user, [('shortcut', '=', name)]+ args, limit=limit)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
|
||||
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit)
|
||||
else:
|
||||
ids = self.search(cr, user, args, context=context, limit=limit)
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
@ -363,28 +362,28 @@ class account_account(osv.osv):
|
|||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
return []
|
||||
reads = self.read(cr, uid, ids, ['name','code'], context)
|
||||
reads = self.read(cr, uid, ids, ['name', 'code'], context)
|
||||
res = []
|
||||
for record in reads:
|
||||
name = record['name']
|
||||
if record['code']:
|
||||
name = record['code']+' '+name
|
||||
res.append((record['id'],name ))
|
||||
name = record['code'] + ' '+name
|
||||
res.append((record['id'], name))
|
||||
return res
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context={},done_list=[]):
|
||||
def copy(self, cr, uid, id, default={}, context={}, done_list=[]):
|
||||
account = self.browse(cr, uid, id, context=context)
|
||||
new_child_ids = []
|
||||
if not default:
|
||||
default={}
|
||||
default=default.copy()
|
||||
default = {}
|
||||
default = default.copy()
|
||||
default['parent_id'] = False
|
||||
if account.id in done_list:
|
||||
return False
|
||||
done_list.append(account.id)
|
||||
if account:
|
||||
for child in account.child_id:
|
||||
child_ids=self.copy(cr, uid, child.id, default, context=context,done_list=done_list)
|
||||
child_ids = self.copy(cr, uid, child.id, default, context=context, done_list=done_list)
|
||||
if child_ids:
|
||||
new_child_ids.append(child_ids)
|
||||
default['child_parent_ids'] = [(6, 0, new_child_ids)]
|
||||
|
@ -394,7 +393,7 @@ class account_account(osv.osv):
|
|||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if not context:
|
||||
context={}
|
||||
context = {}
|
||||
if 'active' in vals and not vals['active']:
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
account_ids = self.search(cr, uid, [('id', 'child_of', ids)])
|
||||
|
@ -441,7 +440,7 @@ class account_journal(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Journal Name', size=64, required=True, translate=True),
|
||||
'code': fields.char('Code', size=16),
|
||||
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True),
|
||||
'type': fields.selection([('sale', 'Sale'), ('purchase', 'Purchase'), ('cash', 'Cash'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True),
|
||||
'refund_journal': fields.boolean('Refund Journal'),
|
||||
|
||||
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
|
||||
|
@ -527,7 +526,6 @@ class account_fiscalyear(osv.osv):
|
|||
|
||||
def create_period(self,cr, uid, ids, context={}, interval=1):
|
||||
for fy in self.browse(cr, uid, ids, context):
|
||||
dt = fy.date_start
|
||||
ds = mx.DateTime.strptime(fy.date_start, '%Y-%m-%d')
|
||||
while ds.strftime('%Y-%m-%d')<fy.date_stop:
|
||||
de = ds + RelativeDateTime(months=interval, days=-1)
|
||||
|
@ -585,7 +583,11 @@ class account_period(osv.osv):
|
|||
for obj_period in self.browse(cr,uid,ids):
|
||||
if obj_period.special:
|
||||
continue
|
||||
if obj_period.fiscalyear_id.date_stop < obj_period.date_stop or obj_period.fiscalyear_id.date_stop < obj_period.date_start or obj_period.fiscalyear_id.date_start > obj_period.date_start or obj_period.fiscalyear_id.date_start > obj_period.date_stop:
|
||||
|
||||
if obj_period.fiscalyear_id.date_stop < obj_period.date_stop or \
|
||||
obj_period.fiscalyear_id.date_stop < obj_period.date_start or \
|
||||
obj_period.fiscalyear_id.date_start > obj_period.date_start or \
|
||||
obj_period.fiscalyear_id.date_start > obj_period.date_stop:
|
||||
return False
|
||||
|
||||
pids = self.search(cr, uid, [('date_stop','>=',obj_period.date_start),('date_start','<=',obj_period.date_stop),('special','=',False),('id','<>',obj_period.id)])
|
||||
|
@ -862,7 +864,7 @@ class account_move(osv.osv):
|
|||
def unlink(self, cr, uid, ids, context={}, check=True):
|
||||
toremove = []
|
||||
for move in self.browse(cr, uid, ids, context):
|
||||
if move['state'] <> 'draft':
|
||||
if move['state'] != 'draft':
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('You can not delete posted movement: "%s"!') % \
|
||||
move['name'])
|
||||
|
@ -935,6 +937,8 @@ class account_move(osv.osv):
|
|||
# Validate a balanced move. If it is a centralised journal, create a move.
|
||||
#
|
||||
def validate(self, cr, uid, ids, context={}):
|
||||
if context and ('__last_update' in context):
|
||||
del context['__last_update']
|
||||
ok = True
|
||||
for move in self.browse(cr, uid, ids, context):
|
||||
#unlink analytic lines on move_lines
|
||||
|
@ -960,7 +964,7 @@ class account_move(osv.osv):
|
|||
|
||||
if line.account_id.currency_id:
|
||||
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
|
||||
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
|
||||
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
|
||||
|
||||
if abs(amount) < 0.0001:
|
||||
if not len(line_draft_ids):
|
||||
|
@ -1108,9 +1112,9 @@ class account_tax_code(osv.osv):
|
|||
fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False)
|
||||
where = ''
|
||||
if fiscalyear_id:
|
||||
pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids)
|
||||
if pids:
|
||||
where = ' and period_id in (' + (','.join(pids))+')'
|
||||
pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids)
|
||||
if pids:
|
||||
where = ' and period_id in (' + (','.join(pids))+')'
|
||||
return self._sum(cr, uid, ids, name, args, context,
|
||||
where=where)
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class account_move_line(osv.osv):
|
|||
account = journal_obj.default_debit_account_id
|
||||
|
||||
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data:
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data and (data['partner_id']):
|
||||
part = self.pool.get('res.partner').browse(cr, uid, data['partner_id'])
|
||||
account = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, account.id)
|
||||
account = self.pool.get('account.account').browse(cr, uid, account)
|
||||
|
@ -707,6 +707,7 @@ class account_move_line(osv.osv):
|
|||
return result
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}, check=True):
|
||||
print "CC"
|
||||
self._update_check(cr, uid, ids, context)
|
||||
result = False
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
|
|
|
@ -1309,7 +1309,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_move_line_tree1" model="ir.actions.act_window">
|
||||
<field name="name" eval="False"/>
|
||||
<field name="name">Entry Lines</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -632,7 +632,7 @@ class account_invoice(osv.osv):
|
|||
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
|
||||
if journal.centralisation:
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Can not create invoice move on centralised journal'))
|
||||
_('Cannot create invoice move on centralised journal'))
|
||||
move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date}
|
||||
period_id=inv.period_id and inv.period_id.id or False
|
||||
if not period_id:
|
||||
|
|
|
@ -34,7 +34,7 @@ class product_category(osv.osv):
|
|||
string="Income Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used instead of the default one to value incoming stock for the current product category"),
|
||||
help="This account will be used to value incoming stock for the current product category"),
|
||||
'property_account_expense_categ': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
|
@ -42,7 +42,7 @@ class product_category(osv.osv):
|
|||
string="Expense Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used instead of the default one to value outgoing stock for the current product category"),
|
||||
help="This account will be used to value outgoing stock for the current product category"),
|
||||
}
|
||||
product_category()
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@
|
|||
<para style="terp_default_9">[[ l.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]]</para>
|
||||
<para style="terp_default_9">[[ ', '.join([ lt.description or '' for lt in l.invoice_line_tax_id ]) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l.quantity)]]</para>
|
||||
|
@ -489,7 +489,7 @@
|
|||
<blockTable colWidths="53.0,60.0,65.0" style="Table_Tax_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ t.name ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ lt.description and lt.description + ' - ' + t.name or t.name ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">[[ formatLang(t.base) ]]</para>
|
||||
|
|
|
@ -27,7 +27,7 @@ class wizard_account_chart(wizard.interface):
|
|||
_account_chart_arch = '''<?xml version="1.0"?>
|
||||
<form string="Account charts">
|
||||
<field name="fiscalyear"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal year)"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
|
||||
<field name="target_move"/>
|
||||
</form>'''
|
||||
|
||||
|
|
|
@ -43,6 +43,6 @@ Add menu to show relevant information for each manager.""",
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '42927202589',
|
||||
'certificate': '0042927202589',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -41,6 +41,6 @@ Allows to automatically select analytic accounts based on criterions:
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '74229833581',
|
||||
'certificate': '0074229833581',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -66,6 +66,6 @@ for one account entry.
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '36417675373',
|
||||
'certificate': '0036417675373',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -47,6 +47,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '81928745309',
|
||||
'certificate': '0081928745309',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -37,7 +37,7 @@ dates_form = '''<?xml version="1.0"?>
|
|||
<notebook tabpos="up">
|
||||
<page string="Report Options">
|
||||
<separator string="Select Fiscal Year(s)(Maximum Three Years)" colspan="4"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal year)"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
|
||||
<field name="fiscalyear" colspan="5" nolabel="1"/>
|
||||
<field name="landscape" colspan="4"/>
|
||||
<field name="show_columns" colspan="4"/>
|
||||
|
|
|
@ -58,6 +58,6 @@ Three reports are available:
|
|||
'demo_xml': ['crossovered_budget_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '43819694157',
|
||||
'certificate': '0043819694157',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -33,6 +33,6 @@
|
|||
'update_xml': [],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '73332443901',
|
||||
'certificate': '0073332443901',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -42,6 +42,6 @@ period !"
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '66174843389',
|
||||
'certificate': '0066174843389',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,6 +51,6 @@
|
|||
'demo_xml': ['followup_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '72481076453',
|
||||
'certificate': '0072481076453',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -48,6 +48,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '57235078173',
|
||||
'certificate': '0057235078173',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -125,11 +125,11 @@ class account_invoice_line(osv.osv):
|
|||
vals['name'] = ' '
|
||||
return super(account_invoice_line, self).write(cr, user, ids, vals, context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
default['state'] = self.browse(cr, uid, id).state
|
||||
return super(account_invoice_line, self).copy(cr, uid, id, default, context)
|
||||
return super(account_invoice_line, self).copy_data(cr, uid, id, default, context)
|
||||
|
||||
def _fnct(self, cr, uid, id, name, args, context):
|
||||
res = {}
|
||||
|
|
|
@ -49,6 +49,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '61703998541',
|
||||
'certificate': '0061703998541',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -42,6 +42,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '50976406925',
|
||||
'certificate': '0050976406925',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '72305016797',
|
||||
'certificate': '0072305016797',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -38,6 +38,6 @@ This module implement the modification on the invoice form.
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '70514190381',
|
||||
'certificate': '0070514190381',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -46,8 +46,8 @@ class account_invoice_line(osv.osv):
|
|||
"""
|
||||
res = {}
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
res_init = super(account_invoice_line, self)._amount_line(cr, uid, ids, name, args, context)
|
||||
for line in self.browse(cr, uid, ids):
|
||||
res_init = super(account_invoice_line, self)._amount_line(cr, uid, [line.id], name, args, context)
|
||||
res[line.id] = {
|
||||
'price_subtotal': 0.0,
|
||||
'price_subtotal_incl': 0.0,
|
||||
|
|
|
@ -49,6 +49,6 @@ Basic Accounting, plus new things that are available:
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '37580727101',
|
||||
'certificate': '0037580727101',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -40,6 +40,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '30271787965',
|
||||
'certificate': '0030271787965',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -40,6 +40,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '82277138269',
|
||||
'certificate': '0082277138269',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -42,6 +42,6 @@
|
|||
'demo_xml': ['auction_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '39333102717',
|
||||
'certificate': '0039333102717',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
'demo_xml': ['audittrail_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '62572348749',
|
||||
'certificate': '0062572348749',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,6 +51,6 @@
|
|||
'demo_xml': ['base_contact_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '31287885469',
|
||||
'certificate': '0031287885469',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<!-- Create the functions -->
|
||||
<record id="res_partner_function_privateaddress0" model="res.partner.function">
|
||||
<field eval=""""Private Address"""" name="name"/>
|
||||
<field name="ref"></field>
|
||||
<field name="code">PA</field>
|
||||
</record>
|
||||
|
||||
<!-- Create the contacts -->
|
||||
|
|
|
@ -35,6 +35,6 @@ This module install the base for IBAN bank accounts.
|
|||
'update_xml': ['base_iban_view.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '50014379549',
|
||||
'certificate': '0050014379549',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -38,13 +38,13 @@ class res_partner_bank(osv.osv):
|
|||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
#overwrite to format the iban number correctly
|
||||
if vals.has_key('iban'):
|
||||
if 'iban' in vals and vals['iban']:
|
||||
vals['iban'] = _format_iban(vals['iban'])
|
||||
return super(res_partner_bank, self).create(cr, uid, vals, context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
#overwrite to format the iban number correctly
|
||||
if vals.has_key('iban'):
|
||||
if 'iban' in vals and vals['iban']:
|
||||
vals['iban'] = _format_iban(vals['iban'])
|
||||
return super(res_partner_bank, self).write(cr, uid, ids, vals, context)
|
||||
|
||||
|
|
|
@ -41,6 +41,6 @@
|
|||
'update_xml': ['base_module_merge_wizard.xml'],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '35756279709',
|
||||
'certificate': '0035756279709',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -43,6 +43,6 @@ to call this button when you want to release a new version of your module.
|
|||
'update_xml': ['base_module_publish_wizard.xml'],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '67939821245',
|
||||
'certificate': '0067939821245',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,6 +51,6 @@ How to use it:
|
|||
'update_xml': ['security/ir.model.access.csv', 'base_module_record_wizard.xml'],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '83134865813',
|
||||
'certificate': '0083134865813',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -182,7 +182,7 @@ class base_module_record(osv.osv):
|
|||
val = str(val)
|
||||
|
||||
val = val and ('"""%s"""' % val.replace('\\', '\\\\').replace('"', '\"')) or 'False'
|
||||
field.setAttribute(u"eval", val)
|
||||
field.setAttribute(u"eval", val.decode('utf-8'))
|
||||
record.appendChild(field)
|
||||
return record_list, noupdate
|
||||
|
||||
|
@ -324,8 +324,8 @@ class base_module_record(osv.osv):
|
|||
data.appendChild(res)
|
||||
elif rec[0]=='assert':
|
||||
pass
|
||||
res = doc.toprettyxml(indent="\t")
|
||||
return doc.toprettyxml(indent="\t").encode('utf8')
|
||||
|
||||
return doc.toprettyxml(indent="\t").encode('utf-8')
|
||||
base_module_record()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -44,6 +44,6 @@ the "Dashboard" menu.
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '31285794149',
|
||||
'certificate': '0031285794149',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -37,6 +37,6 @@ OpenOffice.
|
|||
'demo_xml': ['base_report_data.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '56379010493',
|
||||
'certificate': '0056379010493',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -46,6 +46,6 @@
|
|||
'demo_xml': ['base_setup_demo.xml'],
|
||||
'installable': True,
|
||||
'active': True,
|
||||
'certificate': '86711085869',
|
||||
'certificate': '0086711085869',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -31,6 +31,6 @@
|
|||
'update_xml': ['base_vat_data.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '84849360989',
|
||||
'certificate': '0084849360989',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '76912305725',
|
||||
'certificate': '0076912305725',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -48,6 +48,6 @@
|
|||
'demo_xml': ['board_account_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '76016921229',
|
||||
'certificate': '0076016921229',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -34,6 +34,6 @@ This module implements a dashboard for associations.
|
|||
'demo_xml': ['board_association_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '79647781773',
|
||||
'certificate': '0079647781773',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -35,6 +35,6 @@
|
|||
'demo_xml': ['board_auction_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '49187078189',
|
||||
'certificate': '0049187078189',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -40,6 +40,6 @@ This module implements a dashboard for CRM that includes:
|
|||
'demo_xml': ['board_crm_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '71599098909',
|
||||
'certificate': '0071599098909',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
'demo_xml': ['board_document_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '44628458429',
|
||||
'certificate': '0044628458429',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
'demo_xml': ['board_manufacturing_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '30407612797',
|
||||
'certificate': '0030407612797',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -47,6 +47,6 @@ This module implements a dashboard for project member that includes:
|
|||
'demo_xml': ['board_project_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '39350482013',
|
||||
'certificate': '0039350482013',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -39,6 +39,6 @@ This module implements a dashboard for salesman that includes:
|
|||
'demo_xml': ['board_sale_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '46503501021',
|
||||
'certificate': '0046503501021',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -57,6 +57,6 @@ between mails and Open ERP.""",
|
|||
'demo_xml': ['crm_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '79056041421',
|
||||
'certificate': '0079056041421',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -181,7 +181,7 @@ class crm_case_section(osv.osv):
|
|||
'object': True
|
||||
})
|
||||
return True
|
||||
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
return []
|
||||
|
@ -295,7 +295,7 @@ class crm_case_rule(osv.osv):
|
|||
except (ValueError, KeyError, TypeError):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
_constraints = [
|
||||
(_check_mail, 'Error: The mail is not well formated', ['act_mail_body']),
|
||||
]
|
||||
|
@ -505,7 +505,7 @@ class crm_case(osv.osv):
|
|||
action_ids = newactions
|
||||
level -= 1
|
||||
return True
|
||||
|
||||
|
||||
def format_body(self, body):
|
||||
return tools.ustr(body.encode('ascii', 'replace'))
|
||||
|
||||
|
@ -614,11 +614,11 @@ class crm_case(osv.osv):
|
|||
|
||||
# Send an email
|
||||
tools.email_send(
|
||||
src,
|
||||
dest,
|
||||
src,
|
||||
dest,
|
||||
"Reminder: [%s] %s" % (str(case.id), case.name, ),
|
||||
self.format_body(body),
|
||||
reply_to=case.section_id.reply_to,
|
||||
reply_to=case.section_id.reply_to,
|
||||
tinycrm=str(case.id),
|
||||
attach=attach_to_send
|
||||
)
|
||||
|
@ -646,6 +646,9 @@ class crm_case(osv.osv):
|
|||
if not case.email_from:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('You must put a Partner eMail to use this action!'))
|
||||
if not case.description:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('Can not send mail with empty body,you should have description in the body'))
|
||||
self.__history(cr, uid, cases, _('Send'), history=True, email=False)
|
||||
for case in cases:
|
||||
self.write(cr, uid, [case.id], {
|
||||
|
@ -655,15 +658,15 @@ class crm_case(osv.osv):
|
|||
})
|
||||
emails = [case.email_from] + (case.email_cc or '').split(',')
|
||||
emails = filter(None, emails)
|
||||
body = case.description
|
||||
body = case.description or ''
|
||||
if case.user_id.signature:
|
||||
body += '\n\n%s' % (case.user_id.signature)
|
||||
tools.email_send(
|
||||
case.user_id.address_id.email,
|
||||
case.user_id.address_id.email,
|
||||
emails,
|
||||
'['+str(case.id)+'] '+case.name,
|
||||
'['+str(case.id)+'] '+case.name,
|
||||
self.format_body(body),
|
||||
reply_to=case.section_id.reply_to,
|
||||
reply_to=case.section_id.reply_to,
|
||||
tinycrm=str(case.id)
|
||||
)
|
||||
return True
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<field name="sequence"/>
|
||||
<field name="active" select="2"/>
|
||||
<field name="user_id" select="2"/>
|
||||
<field name="parent_id" select="2"/>
|
||||
<field name="parent_id" select="2" domain="[('id', '!=', active_id)]"/>
|
||||
<field name="reply_to" select="2"/>
|
||||
<label colspan="2" string="Complete this if you use the mail gateway."/>
|
||||
</page>
|
||||
|
|
|
@ -55,6 +55,6 @@ meetings, eso.
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '80531386589',
|
||||
'certificate': '0080531386589',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
</record>
|
||||
<record id="crm_case_financejob0" model="crm.case">
|
||||
<field eval="time.strftime('%Y-%m-26 17:39:42')" name="date"/>
|
||||
<field eval="time.strftime('%Y-%m-29')" name="date_deadline"/>
|
||||
<field eval="time.strftime('%Y-%m-28')" name="date_deadline"/>
|
||||
<field name="category2_id" ref="crm_configuration.category_job2"/>
|
||||
<field name="partner_id" ref="base.res_partner_11"/>
|
||||
<field eval=""4"" name="priority"/>
|
||||
|
|
|
@ -45,6 +45,6 @@
|
|||
'demo_xml': ['crm_profiling_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '33984979005',
|
||||
'certificate': '0033984979005',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -33,6 +33,6 @@
|
|||
'update_xml': [],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '59915476845',
|
||||
'certificate': '0059915476845',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
'demo_xml': ['delivery_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '33981912253',
|
||||
'certificate': '0033981912253',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -43,6 +43,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '70515416461',
|
||||
'certificate': '0070515416461',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -510,24 +510,31 @@ class document_file(osv.osv):
|
|||
if not value:
|
||||
return True
|
||||
#if (not context) or context.get('store_method','fs')=='fs':
|
||||
path = self._get_filestore(cr)
|
||||
if not os.path.isdir(path):
|
||||
os.makedirs(path)
|
||||
flag = None
|
||||
# This can be improved
|
||||
for dirs in os.listdir(path):
|
||||
if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
|
||||
flag = dirs
|
||||
break
|
||||
flag = flag or create_directory(path)
|
||||
filename = random_name()
|
||||
fname = os.path.join(path, flag, filename)
|
||||
fp = file(fname,'wb')
|
||||
v = base64.decodestring(value)
|
||||
fp.write(v)
|
||||
filesize = os.stat(fname).st_size
|
||||
cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id))
|
||||
return True
|
||||
try:
|
||||
path = self._get_filestore(cr)
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except:
|
||||
raise except_orm('Permission Denied !', 'You do not permissions to write on the server side.')
|
||||
|
||||
flag = None
|
||||
# This can be improved
|
||||
for dirs in os.listdir(path):
|
||||
if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
|
||||
flag = dirs
|
||||
break
|
||||
flag = flag or create_directory(path)
|
||||
filename = random_name()
|
||||
fname = os.path.join(path, flag, filename)
|
||||
fp = file(fname,'wb')
|
||||
v = base64.decodestring(value)
|
||||
fp.write(v)
|
||||
filesize = os.stat(fname).st_size
|
||||
cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id))
|
||||
return True
|
||||
except Exception,e :
|
||||
raise except_orm('Error!', str(e))
|
||||
|
||||
_columns = {
|
||||
'user_id': fields.many2one('res.users', 'Owner', select=1),
|
||||
|
@ -609,7 +616,7 @@ class document_file(osv.osv):
|
|||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
vals['title']=vals['name']
|
||||
vals['parent_id'] = context.get('parent_id',False)
|
||||
vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False)
|
||||
if not vals.get('res_id', False) and context.get('default_res_id',False):
|
||||
vals['res_id']=context.get('default_res_id',False)
|
||||
if not vals.get('res_model', False) and context.get('default_res_model',False):
|
||||
|
|
|
@ -34,6 +34,6 @@
|
|||
'demo_xml': ['document_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '71242387229',
|
||||
'certificate': '0071242387229',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,6 +51,6 @@
|
|||
'demo_xml': ['event_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '83059161581',
|
||||
'certificate': '0083059161581',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -36,6 +36,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '69726863885',
|
||||
'certificate': '0069726863885',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -36,6 +36,6 @@ url widget.""",
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '29498930765',
|
||||
'certificate': '0029498930765',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -49,6 +49,6 @@
|
|||
'demo_xml': ['hr_demo.xml', 'hr_department_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '86710558965',
|
||||
'certificate': '0086710558965',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -126,6 +126,7 @@ class hr_employee(osv.osv):
|
|||
'marital': fields.selection([('maried','Maried'),('unmaried','Unmaried'),('divorced','Divorced'),('other','Other')],'Marital Status', size=32),
|
||||
|
||||
'address_id': fields.many2one('res.partner.address', 'Working Address'),
|
||||
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
|
||||
'work_phone': fields.char('Work Phone', size=32),
|
||||
'work_email': fields.char('Work Email', size=128),
|
||||
'work_location': fields.char('Office Location', size=32),
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Contact Information" colspan="2"/>
|
||||
<field name="address_home_id" colspan="2"/>
|
||||
<field name="address_id" colspan="2"/>
|
||||
<field name="work_phone"/>
|
||||
<field name="work_email" widget="email" />
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
'demo_xml': ['hr_attendance_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '63495605613',
|
||||
'certificate': '0063495605613',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -45,6 +45,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '46298028637',
|
||||
'certificate': '0046298028637',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
'hr_expense_report.xml',
|
||||
'process/hr_expense_process.xml'
|
||||
],
|
||||
'demo_xml': ['hr_expense_demo.xml', 'hr.expense.expense.csv'],
|
||||
'demo_xml': ['hr.expense.expense.csv'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '62479841789',
|
||||
'certificate': '0062479841789',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
name,ref,employee_id,line_ids/date_value,line_ids/name,line_ids/analytic_account,line_ids/unit_quantity,line_ids/ref,line_ids/unit_amount
|
||||
September Expenses,09/06,Fabien Pinckaers,2006-09-05,Travel by Car - Customer Seagate 2 - Double,Thymbra,130.0,,0.22
|
||||
,,,2006-09-05,Travel by Car - Trainging,Trainings,100.0,,0.22
|
||||
,,,2006-09-05,Basic PC - Server for Seagate,Seagate P2,1.0,S1234435,300.0
|
||||
|
|
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -41,6 +41,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '86579209325',
|
||||
'certificate': '0086579209325',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -50,6 +50,6 @@ to set up a management by affair.
|
|||
'demo_xml': ['hr_timesheet_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '71405533469',
|
||||
'certificate': '0071405533469',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -42,6 +42,6 @@ reports, eso.""",
|
|||
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '56091842381',
|
||||
'certificate': '0056091842381',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -57,6 +57,6 @@ The validation can be configured in te company:
|
|||
'demo_xml': ['hr_timesheet_sheet_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '73297700829',
|
||||
'certificate': '0073297700829',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '71515601309',
|
||||
'certificate': '0071515601309',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import company
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -58,6 +58,6 @@
|
|||
'account.report.report.csv'
|
||||
],
|
||||
'installable': True,
|
||||
'certificate': '31977724637',
|
||||
'certificate': '0031977724637',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -6628,6 +6628,16 @@
|
|||
<!-- VAT Template -->
|
||||
<!-- Régime National -->
|
||||
<!-- Sales VAT -->
|
||||
<record id="vat_0_co" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">Cocontractants 0%</field>
|
||||
<field name="description">NSCS 0</field>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a45"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record id="vat_0" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">TVA 0%</field>
|
||||
|
@ -6638,16 +6648,6 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record id="vat_0_co" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">Cocontractants 0%</field>
|
||||
<field name="description">NSS 0</field>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a45"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record id="vat_6" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">TVA 6%</field>
|
||||
|
@ -6655,7 +6655,7 @@
|
|||
<field eval="0.06" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_collected_id" ref="vat_payable06"/>
|
||||
<field name="account_paid_id" ref="vat_refund06"/>
|
||||
<field name="account_paid_id" ref="vat_payable06"/>
|
||||
<field name="base_code_id" ref="vat_code_a01"/>
|
||||
<field name="tax_code_id" ref="vat_code_a54"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
|
@ -6669,7 +6669,7 @@
|
|||
<field eval="0.12" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_collected_id" ref="vat_payable12"/>
|
||||
<field name="account_paid_id" ref="vat_refund12"/>
|
||||
<field name="account_paid_id" ref="vat_payable12"/>
|
||||
<field name="base_code_id" ref="vat_code_a02"/>
|
||||
<field name="tax_code_id" ref="vat_code_a54"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
|
@ -6683,7 +6683,7 @@
|
|||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_collected_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="base_code_id" ref="vat_code_a03"/>
|
||||
<field name="tax_code_id" ref="vat_code_a54"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
|
@ -6705,7 +6705,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_0_buy_bsd"/>
|
||||
<field name="name">Biens et Services Divers Déductibles 0% (1)</field>
|
||||
<field eval="0.06" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a85"/>
|
||||
|
@ -6715,7 +6715,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_0_buy_bsd"/>
|
||||
<field name="name">Biens et Services Divers Déductibles 0% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6724,7 +6724,7 @@
|
|||
<record id="vat_0_buy_mar" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">Marchandises Déductibles 0%</field>
|
||||
<field name="description">NSGSD 0</field>
|
||||
<field name="description">NSTF 0</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field eval="1" name="child_depend"/>
|
||||
|
@ -6744,23 +6744,12 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_0_buy_mar"/>
|
||||
<field name="name">Marchandises Déductibles 0% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a81"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
||||
<record id="vat_0_co_buy" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">Cocontractants 0%</field>
|
||||
<field name="description">NSS 0</field>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a45"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record id="vat_6_buy_bsd" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">Biens et Services Divers Déductibles 6%</field>
|
||||
|
@ -6776,7 +6765,7 @@
|
|||
<field name="name">Biens et Services Divers Déductibles 6% (1)</field>
|
||||
<field eval="0.06" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable06"/>
|
||||
<field name="account_paid_id" ref="vat_refund06"/>
|
||||
<field name="account_collected_id" ref="vat_refund06"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6788,7 +6777,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_6_buy_bsd"/>
|
||||
<field name="name">Biens et Services Divers Déductibles 6% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6809,7 +6798,7 @@
|
|||
<field name="name">Biens et Services Divers Déductibles 12% (1)</field>
|
||||
<field eval="0.12" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable12"/>
|
||||
<field name="account_paid_id" ref="vat_refund12"/>
|
||||
<field name="account_collected_id" ref="vat_refund12"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6821,7 +6810,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_12_buy_bsd"/>
|
||||
<field name="name">Biens et Services Divers Déductibles 12% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6842,7 +6831,7 @@
|
|||
<field name="name">Biens Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6854,7 +6843,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_21_buy_bsd"/>
|
||||
<field name="name">Biens Déductibles 21% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6875,7 +6864,7 @@
|
|||
<field name="name">Services Divers Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6887,7 +6876,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_21_buy_ser"/>
|
||||
<field name="name">Services Divers Déductibles 21% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6910,7 +6899,7 @@
|
|||
<field name="name">Marchandises Déductibles 6% (1)</field>
|
||||
<field eval="0.06" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable06"/>
|
||||
<field name="account_paid_id" ref="vat_refund06"/>
|
||||
<field name="account_collected_id" ref="vat_refund06"/>
|
||||
<field name="base_code_id" ref="vat_code_a81"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6922,7 +6911,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_6_buy_mar"/>
|
||||
<field name="name">Marchandises Déductibles 6% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a81"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6943,7 +6932,7 @@
|
|||
<field name="name">Marchandises Déductibles 12% (1)</field>
|
||||
<field eval="0.12" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable12"/>
|
||||
<field name="account_paid_id" ref="vat_refund12"/>
|
||||
<field name="account_collected_id" ref="vat_refund12"/>
|
||||
<field name="base_code_id" ref="vat_code_a81"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6955,7 +6944,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_12_buy_mar"/>
|
||||
<field name="name">Marchandises Déductibles 12% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a81"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6976,7 +6965,7 @@
|
|||
<field name="name">Marchandises Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a81"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
|
@ -6988,7 +6977,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_21_buy_mar"/>
|
||||
<field name="name">Marchandises Déductibles 21% (2)</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a81"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -6999,9 +6988,9 @@
|
|||
<!-- Sales VAT -->
|
||||
<record id="vat_XO" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">VAT 0% Exportations</field>
|
||||
<field name="name">TVA 0% Exportations</field>
|
||||
<field name="description">ISEXP 0</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a47"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
|
@ -7028,9 +7017,9 @@
|
|||
<!-- Sales VAT -->
|
||||
<record id="vat_IO" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="name">VAT 0% Intracommunautaire</field>
|
||||
<field name="name">TVA 0% Intracommunautaire</field>
|
||||
<field name="description">VI 0</field>
|
||||
<field eval="1.00" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_a47"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a49"/>
|
||||
|
@ -7052,7 +7041,7 @@
|
|||
<field name="name">Biens Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a55"/>
|
||||
|
@ -7063,10 +7052,13 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21b"/>
|
||||
<field name="name">Biens Déductibles 21% (2)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="-0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_collected_id" ref="vat_payable21"/>
|
||||
<field name="base_code_id" ref="vat_code_a86"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
<field eval="-1" name="tax_sign"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
|
@ -7075,7 +7067,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21b"/>
|
||||
<field name="name">Biens Déductibles 21% (3)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a86"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -7096,7 +7088,7 @@
|
|||
<field name="name">Marchandises Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a81"/>
|
||||
<field name="tax_code_id" ref="vat_code_a55"/>
|
||||
|
@ -7107,10 +7099,13 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21m"/>
|
||||
<field name="name">Marchandises Déductibles 21% (2)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="-0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_collected_id" ref="vat_payable21"/>
|
||||
<field name="base_code_id" ref="vat_code_a86"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
<field eval="-1" name="tax_sign"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a81"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
|
@ -7119,7 +7114,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21m"/>
|
||||
<field name="name">Marchandises Déductibles 21% (3)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a86"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
@ -7140,10 +7135,10 @@
|
|||
<field name="name">Services Divers Déductibles 21% (1)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_paid_id" ref="vat_refund21"/>
|
||||
<field name="account_collected_id" ref="vat_refund21"/>
|
||||
<field name="base_code_id" ref="vat_code_a82"/>
|
||||
<field name="tax_code_id" ref="vat_code_a56"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a85"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
@ -7151,10 +7146,13 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21s"/>
|
||||
<field name="name">Services Divers Déductibles 21% (2)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="-0.21" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_paid_id" ref="vat_payable21"/>
|
||||
<field name="account_collected_id" ref="vat_payable21"/>
|
||||
<field name="base_code_id" ref="vat_code_a87"/>
|
||||
<field name="tax_code_id" ref="vat_code_a59"/>
|
||||
<field name="tax_code_id" ref="vat_code_a56"/>
|
||||
<field eval="-1" name="tax_sign"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_a82"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
|
@ -7163,7 +7161,7 @@
|
|||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field name="parent_id" ref="vat_IO_buy_21s"/>
|
||||
<field name="name">Services Divers Déductibles 21% (3)</field>
|
||||
<field eval="0.21" name="amount"/>
|
||||
<field eval="0.00" name="amount"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="ref_base_code_id" ref="vat_code_a87"/>
|
||||
<field eval="-1" name="ref_base_sign"/>
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
_description = 'res.company'
|
||||
|
||||
|
||||
def _get_default_ad(self, addresses):
|
||||
city = post_code = address = ""
|
||||
for ads in addresses:
|
||||
if ads.type == 'default':
|
||||
city = ads.city or ""
|
||||
post_code = ads.zip or ""
|
||||
if ads.street:
|
||||
address = ads.street or ""
|
||||
if ads.street2:
|
||||
address += " " + ads.street2
|
||||
return city, post_code, address
|
||||
res_company()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -91,11 +91,6 @@
|
|||
<field name="tax_src_id" ref="l10n_be.vat_0_buy_mar" />
|
||||
<field name="tax_dest_id" ref="l10n_be.vat_XO_buy" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_14" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="l10n_be.vat_0_co_buy" />
|
||||
<field name="tax_dest_id" ref="l10n_be.vat_XO_buy" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_15" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="l10n_be.vat_21" />
|
||||
|
|
|
@ -1,27 +1,35 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem
|
||||
id="menu_finance_belgian_statement"
|
||||
name="Belgium Statements"
|
||||
parent="account.menu_finance_legal_statement"/>
|
||||
|
||||
<wizard
|
||||
string="Enlist Vat Details"
|
||||
string="Annual Listing of VAT-Subjected Customers"
|
||||
model="res.partner"
|
||||
name="list.vat.detail"
|
||||
menu="False"
|
||||
id="partner_wizard_vat"/>
|
||||
|
||||
<menuitem
|
||||
name="Listing of VAT Customers"
|
||||
parent="account.menu_finance_legal_statement"
|
||||
name="Annual Listing of VAT-Subjected Customers"
|
||||
parent="menu_finance_belgian_statement"
|
||||
action="partner_wizard_vat"
|
||||
type="wizard"
|
||||
id="partner_wizard_vat_menu"/>
|
||||
|
||||
<wizard
|
||||
string="Taxes Statement"
|
||||
string="Periodical VAT Declaration"
|
||||
name="wizard.account.xml.vat.declaration"
|
||||
menu="False"
|
||||
id="wizard_xml_vat_declaration"/>
|
||||
|
||||
<menuitem
|
||||
name="Taxes Statement"
|
||||
parent="account.menu_finance_legal_statement"
|
||||
name="Periodical VAT Declaration"
|
||||
parent="menu_finance_belgian_statement"
|
||||
action="wizard_xml_vat_declaration"
|
||||
type="wizard"
|
||||
id="account_wizard_vat_declaration"/>
|
||||
|
|
|
@ -25,6 +25,8 @@ import datetime
|
|||
import pooler
|
||||
import base64
|
||||
|
||||
from tools.translate import _
|
||||
|
||||
form_fyear = """<?xml version="1.0"?>
|
||||
<form string="Select Period">
|
||||
<field name="period" />
|
||||
|
@ -48,6 +50,7 @@ fields = {
|
|||
'readonly': True,},
|
||||
}
|
||||
|
||||
|
||||
class wizard_vat_declaration(wizard.interface):
|
||||
|
||||
def _create_xml(self, cr, uid, data, context):
|
||||
|
@ -58,7 +61,7 @@ class wizard_vat_declaration(wizard.interface):
|
|||
user_cmpny = obj_company.name
|
||||
vat_no=obj_company.partner_id.vat
|
||||
if not vat_no:
|
||||
raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!')
|
||||
raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
|
||||
|
||||
tax_ids = pool_obj.get('account.tax.code').search(cr,uid,[])
|
||||
ctx = context.copy()
|
||||
|
@ -69,30 +72,34 @@ class wizard_vat_declaration(wizard.interface):
|
|||
if not obj_company.partner_id.address:
|
||||
address=post_code=city=''
|
||||
|
||||
for ads in obj_company.partner_id.address:
|
||||
if ads.type=='default':
|
||||
if ads.zip_id:
|
||||
city=ads.zip_id.city
|
||||
post_code=ads.zip_id.name
|
||||
if ads.street:
|
||||
address=ads.street
|
||||
if ads.street2:
|
||||
address +=ads.street2
|
||||
city, post_code, address = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address)
|
||||
|
||||
obj_fyear = pool_obj.get('account.fiscalyear')
|
||||
year_id = obj_fyear.find(cr, uid)
|
||||
current_year = obj_fyear.browse(cr,uid,year_id).name
|
||||
month=time.strftime('%m')
|
||||
|
||||
account_period=pool_obj.get('account.period').browse(cr, uid, data['form']['period'])
|
||||
current_year = account_period.fiscalyear_id.name
|
||||
period_code = account_period.code
|
||||
|
||||
period_code = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).code
|
||||
send_ref = user_cmpny
|
||||
if period_code:
|
||||
send_ref = send_ref + period_code
|
||||
|
||||
data_of_file='<?xml version="1.0"?>\n<VATSENDING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MultiDeclarationTVA-NoSignature-14.xml">'
|
||||
data_of_file +='\n\t<DECLARER>\n\t\t<VATNUMBER>'+str(vat_no)+'</VATNUMBER>\n\t\t<NAME>'+str(obj_company.name)+'</NAME>\n\t\t<ADDRESS>'+str(address)+'</ADDRESS>'
|
||||
data_of_file +='\n\t\t<POSTCODE>'+str(post_code)+'</POSTCODE>\n\t\t<CITY>'+str(city)+'</CITY>\n\t\t<SENDINGREFERENCE>'+send_ref+'</SENDINGREFERENCE>\n\t</DECLARER>'
|
||||
data_of_file +='\n\t<VATRECORD>\n\t\t<RECNUM>1</RECNUM>\n\t\t<VATNUMBER>'+str(vat_no)+'</VATNUMBER>\n\t\t<DPERIODE>\n\t\t\t<MONTH>'+str(month)+'</MONTH>\n\t\t\t<YEAR>'+str(current_year[-4:])+'</YEAR>\n\t\t</DPERIODE>\n\t\t<ASK RESTITUTION="NO" PAYMENT="NO"/>'
|
||||
data_of_file +='\n\t<DECLARER>\n\t\t<VATNUMBER>'+str(vat_no)+'</VATNUMBER>\n\t\t<NAME>'+str(obj_company.name)+'</NAME>\n\t\t<ADDRESS>'+address+'</ADDRESS>'
|
||||
data_of_file +='\n\t\t<POSTCODE>'+post_code+'</POSTCODE>\n\t\t<CITY>'+city+'</CITY>\n\t\t<SENDINGREFERENCE>'+send_ref+'</SENDINGREFERENCE>\n\t</DECLARER>'
|
||||
data_of_file +='\n\t<VATRECORD>\n\t\t<RECNUM>1</RECNUM>\n\t\t<VATNUMBER>'+str(vat_no)+'</VATNUMBER>\n\t\t<DPERIODE>\n\t\t\t'
|
||||
|
||||
starting_month = account_period.date_start[5:7]
|
||||
ending_month = account_period.date_stop[5:7]
|
||||
if starting_month != ending_month:
|
||||
#starting month and ending month of selected period are not the same
|
||||
#it means that the accounting isn't based on periods of 1 month but on quarters
|
||||
quarter = str(((int(starting_month) - 1) / 3) + 1)
|
||||
data_of_file += '<QUARTER>'+quarter+'</QUARTER>\n\t\t\t'
|
||||
else:
|
||||
data_of_file += '<MONTH>'+starting_month+'</MONTH>\n\t\t\t'
|
||||
data_of_file += '<YEAR>' + str(account_period.date_stop[:4]) + '</YEAR>\n\t\t</DPERIODE>\n\t\t<ASK RESTITUTION="NO" PAYMENT="NO"/>'
|
||||
data_of_file +='\n\t\t<DATA>\n\t\t\t<DATA_ELEM>'
|
||||
|
||||
for item in tax_info:
|
||||
|
|
|
@ -62,27 +62,23 @@ class wizard_vat(wizard.interface):
|
|||
|
||||
def _create_xml(self, cr, uid, data, context):
|
||||
datas=[]
|
||||
# now wizard will use user->company instead of directly company from res.company
|
||||
|
||||
seq_controlref = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'controlref')
|
||||
seq_declarantnum = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'declarantnum')
|
||||
obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id
|
||||
company_vat = obj_cmpny.partner_id.vat
|
||||
if not company_vat: #if not vat_company:
|
||||
if not company_vat:
|
||||
raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!')
|
||||
|
||||
cref = company_vat + seq_controlref
|
||||
dnum = cref + seq_declarantnum
|
||||
# obj_company=pooler.get_pool(cr.dbname).get('res.company').browse(cr,uid,1)
|
||||
# vat_company=obj_company.partner_id.vat
|
||||
|
||||
#TODO: can be improved if we replace this test => add a new field on res_partner for cases when a partner has a number and is not subjected to the VAT... have to see if this situation could happen
|
||||
p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat','!=',False)])
|
||||
p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)])
|
||||
|
||||
if not p_id_list:
|
||||
raise wizard.except_wizard('Data Insufficient!','No partner has a VAT Number asociated with him.')
|
||||
obj_year=pooler.get_pool(cr.dbname).get('account.fiscalyear').browse(cr,uid,data['form']['fyear'])
|
||||
period="to_date('" + str(obj_year.date_start) + "','yyyy-mm-dd') and to_date('" + str(obj_year.date_stop) +"','yyyy-mm-dd')"
|
||||
period_ids = pooler.get_pool(cr.dbname).get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fyear'])])
|
||||
period = "("+','.join(map(lambda x: str(x), period_ids)) +")"
|
||||
|
||||
street=zip_city=country=''
|
||||
addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice'])
|
||||
|
@ -109,39 +105,57 @@ class wizard_vat(wizard.interface):
|
|||
data_file +='\n<AgentRepr DecNumber="1">\n\t<CompanyInfo>\n\t\t<VATNum>'+str(company_vat)+'</VATNum>\n\t\t<Name>'+str(obj_cmpny.name)+'</Name>\n\t\t<Street>'+ str(street) +'</Street>\n\t\t<CityAndZipCode>'+ str(zip_city) +'</CityAndZipCode>'
|
||||
data_file +='\n\t\t<Country>'+ str(country) +'</Country>\n\t</CompanyInfo>\n</AgentRepr>'
|
||||
data_comp ='\n<CompanyInfo>\n\t<VATNum>'+str(company_vat)+'</VATNum>\n\t<Name>'+str(obj_cmpny.name)+'</Name>\n\t<Street>'+ str(street) +'</Street>\n\t<CityAndZipCode>'+ str(zip_city) +'</CityAndZipCode>\n\t<Country>'+ str(country) +'</Country>\n</CompanyInfo>'
|
||||
data_period ='\n<Period>'+ str(obj_year.name[-4:]) +'</Period>'
|
||||
data_period ='\n<Period>'+ str(obj_year.date_stop[:4]) +'</Period>'
|
||||
error_message=[]
|
||||
|
||||
for p_id in p_id_list:
|
||||
record=[] # this holds record per partner
|
||||
obj_partner=pooler.get_pool(cr.dbname).get('res.partner').browse(cr,uid,p_id)
|
||||
cr.execute('select b.code,sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code in ('"'produit'"','"'tax'"') and l.partner_id=%%s and l.date between %s group by b.code' % (period,), (p_id,))
|
||||
record = {} # this holds record per partner
|
||||
obj_partner = pooler.get_pool(cr.dbname).get('res.partner').browse(cr,uid,p_id)
|
||||
|
||||
#This listing is only for customers located in belgium, that's the
|
||||
#reason why we skip all the partners that haven't their
|
||||
#(or one of their) default address(es) located in Belgium.
|
||||
go_ahead = False
|
||||
for ads in obj_partner.address:
|
||||
if ads.type == 'default' and (ads.country_id and ads.country_id.code == 'BE'):
|
||||
go_ahead = True
|
||||
break
|
||||
if not go_ahead:
|
||||
continue
|
||||
query = 'select b.code,sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code in ('"'produit'"','"'tax'"') and l.partner_id='+str(p_id)+' and l.period_id in '+period+' group by b.code'
|
||||
cr.execute(query)
|
||||
line_info=cr.fetchall()
|
||||
if not line_info:
|
||||
continue
|
||||
|
||||
record.append(obj_partner.vat)
|
||||
addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_partner.id], ['invoice'])
|
||||
if addr.get('invoice',False):
|
||||
ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0]
|
||||
record['vat'] = obj_partner.vat
|
||||
|
||||
#it seems that this listing is only for belgian customers
|
||||
record['country'] = 'BE'
|
||||
|
||||
#...deprecated...
|
||||
#~addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_partner.id], ['invoice'])
|
||||
|
||||
if ads.country_id:
|
||||
record.append(ads.country_id.code)
|
||||
else:
|
||||
error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no country associated with its Invoice address!')
|
||||
#~ if addr.get('invoice',False):
|
||||
#~ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0]
|
||||
|
||||
#~ if ads.country_id:
|
||||
#~ record.append(ads.country_id.code)
|
||||
#~ else:
|
||||
#~ error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no country associated with its Invoice address!')
|
||||
|
||||
if len(record)<2:
|
||||
record.append('')
|
||||
error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no Invoice address!')
|
||||
if len(line_info)==1:
|
||||
if line_info[0][0]=='produit':
|
||||
record.append(0.00)
|
||||
record.append(line_info[0][1])
|
||||
#~ if len(record)<2:
|
||||
#~ record.append('')
|
||||
#~ error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no Invoice address!')
|
||||
|
||||
record['amount'] = 0
|
||||
record['turnover'] = 0
|
||||
|
||||
for item in line_info:
|
||||
if item[0]=='produit':
|
||||
record['turnover'] += item[1]
|
||||
else:
|
||||
record.append(line_info[0][1])
|
||||
record.append(0.00)
|
||||
else:
|
||||
for item in line_info:
|
||||
record.append(item[1])
|
||||
record['amount'] += item[1]
|
||||
datas.append(record)
|
||||
|
||||
seq=0
|
||||
|
@ -152,12 +166,12 @@ class wizard_vat(wizard.interface):
|
|||
data['form']['msg']='Exception : \n' +'-'*50+'\n'+ '\n'.join(error_message)
|
||||
return data['form']
|
||||
for line in datas:
|
||||
if line[3]< data['form']['limit_amount']:
|
||||
if line['turnover'] < data['form']['limit_amount']:
|
||||
continue
|
||||
seq +=1
|
||||
sum_tax +=line[2]
|
||||
sum_turnover +=line[3]
|
||||
data_clientinfo +='\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+line[0] +'</VATNum>\n\t\t<Country>'+line[1] +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(line[2] * 100)) +'</Amount>\n\t<TurnOver>'+str(int(line[3] * 100)) +'</TurnOver>\n</ClientList>'
|
||||
sum_tax +=line['amount']
|
||||
sum_turnover +=line['turnover']
|
||||
data_clientinfo +='\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+line['vat'] +'</VATNum>\n\t\t<Country>'+line['country'] +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(line['amount'] * 100)) +'</Amount>\n\t<TurnOver>'+str(int(line['turnover'] * 100)) +'</TurnOver>\n</ClientList>'
|
||||
|
||||
data_decl ='\n<DeclarantList SequenceNum="1" DeclarantNum="'+ dnum + '" ClientNbr="'+ str(seq) +'" TurnOverSum="'+ str(int(sum_turnover * 100)) +'" TaxSum="'+ str(int(sum_tax * 100)) +'" />'
|
||||
data_file += str(data_decl) + str(data_comp) + str(data_period) + str(data_clientinfo) + '\n</VatList>'
|
||||
|
|
|
@ -76,6 +76,6 @@
|
|||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '64392144797',
|
||||
'certificate': '0064392144797',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -51,7 +51,7 @@ Credits: Sistheo Zeekom CrysaLEAD
|
|||
"security/ir.model.access.csv",
|
||||
],
|
||||
"demo_xml" : [],
|
||||
"certificate" : "435321693876313629",
|
||||
"certificate" : "00435321693876313629",
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ This module installs:
|
|||
],
|
||||
'demo_xml': ['account.report.report.csv'],
|
||||
'installable': True,
|
||||
'certificate': '78164766621',
|
||||
'certificate': '0078164766621',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,35 +1,36 @@
|
|||
"ref_base_code_id:id","ref_base_sign","name","ref_tax_code_id:id","account_collected_id:id","amount","chart_template_id:id","tax_code_id:id","child_depend","include_base_amount","parent_id:id","tax_sign","account_paid_id:id","base_code_id:id","id","ref_tax_sign"
|
||||
"account_tax_code_template_9",-1,"Intra Travail à façon 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_1",1
|
||||
"account_tax_code_template_9",-1,"Intra Livraison avec installation 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_2",1
|
||||
"account_tax_code_template_9",-1,"Intra transfert de biens 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_3",1
|
||||
"account_tax_code_template_13",-1,"Vente de tabacs 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_13","account_tax_template_9",1
|
||||
"account_tax_code_template_10",-1,"Exportations 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_10","account_tax_template_10",1
|
||||
,1,"Achats frais généraux 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,,"account_tax_template_11",1
|
||||
"account_tax_code_template_29",-1,"Ventes 3%","account_tax_code_template_34","account_451000","0.0300","l10nlu_chart_template","account_tax_code_template_34",0,0,,1,"account_451000","account_tax_code_template_29","account_tax_template_5",-1
|
||||
"account_tax_code_template_28",-1,"Ventes 6%","account_tax_code_template_33","account_451000","0.0600","l10nlu_chart_template","account_tax_code_template_33",0,0,,1,"account_451000","account_tax_code_template_28","account_tax_template_6",-1
|
||||
"account_tax_code_template_30",-1,"Ventes 12%","account_tax_code_template_35","account_451000","0.1200","l10nlu_chart_template","account_tax_code_template_35",0,0,,1,"account_451000","account_tax_code_template_30","account_tax_template_7",-1
|
||||
"account_tax_code_template_27",-1,"Ventes 15%","account_tax_code_template_32","account_451000","0.1500","l10nlu_chart_template","account_tax_code_template_32",0,0,,1,"account_451000","account_tax_code_template_27","account_tax_template_8",-1
|
||||
,1,"Achats frais généraux 15%","account_tax_code_template_18","account_411000","0.1500","l10nlu_chart_template","account_tax_code_template_18",0,0,,1,"account_411000",,"account_tax_template_12",-1
|
||||
,1,"Achats Intra-Co",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_13",1
|
||||
,1,"Achats de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_18",1
|
||||
,1,"Ventes de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_21",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,,1,"account_411000","account_tax_code_template_38","account_tax_template_26",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,,-1,"account_451000",,"account_tax_template_25",1
|
||||
,1,"Importations a des fins de l'entreprise",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_30",1
|
||||
,1,"Importations a des fins privées",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_33",1
|
||||
,1,"Livraisons de Biens Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_36",1
|
||||
,1,"Livraison de Biens triangulaire",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_24",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_24",-1,"account_451000",,"account_tax_template_22",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_24",1,"account_411000","account_tax_code_template_38","account_tax_template_23",1
|
||||
,1,"Importations Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_56",0,0,"account_tax_template_30",-1,"account_411000","account_tax_code_template_51","account_tax_template_28",1
|
||||
,1,"Importations Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_30",1,"account_411000",,"account_tax_template_29",1
|
||||
,1,"Importations Fins Privées",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_64",0,0,"account_tax_template_33",-1,"account_411000","account_tax_code_template_60","account_tax_template_31",1
|
||||
,1,"Importations Fins Privées",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_33",1,"account_411000",,"account_tax_template_32",1
|
||||
,1,"Livraison de Biens Art26",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_36",-1,"account_451000",,"account_tax_template_34",1
|
||||
,1,"Livraisons de Biens Art26",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_82",0,0,"account_tax_template_36",1,"account_411000","account_tax_code_template_78","account_tax_template_35",1
|
||||
,1,"Achats Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_19",0,0,"account_tax_template_13",1,"account_411000","account_tax_code_template_38","account_tax_template_14",1
|
||||
,1,"Achats Intra-CO2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_13",-1,"account_411000",,"account_tax_template_15",1
|
||||
,1,"Services Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_18",-1,"account_411000",,"account_tax_template_17",1
|
||||
,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_18",1,"account_411000","account_tax_code_template_38","account_tax_template_16",1
|
||||
,1,"Services Intra-Co2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_21",-1,"account_451000",,"account_tax_template_19",1
|
||||
,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_86",0,0,"account_tax_template_21",1,"account_411000","account_tax_code_template_74","account_tax_template_20",1
|
||||
"ref_base_code_id:id","ref_base_sign","name","description","type_tax_use","ref_tax_code_id:id","account_collected_id:id","amount","chart_template_id:id","tax_code_id:id","child_depend","include_base_amount","parent_id:id","tax_sign","account_paid_id:id","base_code_id:id","id","ref_tax_sign"
|
||||
"account_tax_code_template_9",-1,"Intra Travail à façon 0%","ESWRK0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_1",1
|
||||
"account_tax_code_template_9",-1,"Intra Livraison avec installation 0%","ESDLI0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_2",1
|
||||
"account_tax_code_template_9",-1,"Intra transfert de biens 0%","ESTRF0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_3",1
|
||||
"account_tax_code_template_13",-1,"Vente de tabacs 0%","NSNST0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_13","account_tax_template_9",1
|
||||
"account_tax_code_template_10",-1,"Exportations 0%","ISEXP0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_10","account_tax_template_10",1
|
||||
,1,"Achats frais généraux 0%","ESSDD0","purchase",,,"0.0000","l10nlu_chart_template",,0,0,,1,,,"account_tax_template_11",1
|
||||
"account_tax_code_template_29",-1,"Ventes 3%","NSS 3","sale","account_tax_code_template_34","account_451000","0.0300","l10nlu_chart_template","account_tax_code_template_34",0,0,,1,"account_451000","account_tax_code_template_29","account_tax_template_5",-1
|
||||
"account_tax_code_template_28",-1,"Ventes 6%","NSS 6","sale","account_tax_code_template_33","account_451000","0.0600","l10nlu_chart_template","account_tax_code_template_33",0,0,,1,"account_451000","account_tax_code_template_28","account_tax_template_6",-1
|
||||
"account_tax_code_template_30",-1,"Ventes 12%","NSS 12","sale","account_tax_code_template_35","account_451000","0.1200","l10nlu_chart_template","account_tax_code_template_35",0,0,,1,"account_451000","account_tax_code_template_30","account_tax_template_7",-1
|
||||
"account_tax_code_template_27",-1,"Ventes 15%","NSS 15","sale","account_tax_code_template_32","account_451000","0.1500","l10nlu_chart_template","account_tax_code_template_32",0,0,,1,"account_451000","account_tax_code_template_27","account_tax_template_8",-1
|
||||
,1,"Achats frais généraux 15%","NSGSD15","purchase","account_tax_code_template_18","account_411000","0.1500","l10nlu_chart_template","account_tax_code_template_18",0,0,,1,"account_411000",,"account_tax_template_12",-1
|
||||
,1,"Achats Intra-Co",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_13",1
|
||||
,1,"Achats de Services Art.26",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_18",1
|
||||
,1,"Ventes de Services Art.26",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_21",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,,1,"account_411000","account_tax_code_template_38","account_tax_template_26",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,,-1,"account_451000",,"account_tax_template_25",1
|
||||
,1,"Importations a des fins de l'entreprise",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_30",1
|
||||
,1,"Importations a des fins privées",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_33",1
|
||||
,1,"Livraisons de Biens Art.26",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_36",1
|
||||
,1,"Livraison de Biens triangulaire",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_24",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_24",-1,"account_451000",,"account_tax_template_22",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_24",1,"account_411000","account_tax_code_template_38","account_tax_template_23",1
|
||||
,1,"Importations Intra-Co2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_56",0,0,"account_tax_template_30",-1,"account_411000","account_tax_code_template_51","account_tax_template_28",1
|
||||
,1,"Importations Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_30",1,"account_411000",,"account_tax_template_29",1
|
||||
,1,"Importations Fins Privées",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_64",0,0,"account_tax_template_33",-1,"account_411000","account_tax_code_template_60","account_tax_template_31",1
|
||||
,1,"Importations Fins Privées",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_33",1,"account_411000",,"account_tax_template_32",1
|
||||
,1,"Livraison de Biens Art26",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_36",-1,"account_451000",,"account_tax_template_34",1
|
||||
,1,"Livraisons de Biens Art26",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_82",0,0,"account_tax_template_36",1,"account_411000","account_tax_code_template_78","account_tax_template_35",1
|
||||
,1,"Achats Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_19",0,0,"account_tax_template_13",1,"account_411000","account_tax_code_template_38","account_tax_template_14",1
|
||||
,1,"Achats Intra-CO2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_13",-1,"account_411000",,"account_tax_template_15",1
|
||||
,1,"Services Intra-Co2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_18",-1,"account_411000",,"account_tax_template_17",1
|
||||
,1,"Services Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_18",1,"account_411000","account_tax_code_template_38","account_tax_template_16",1
|
||||
,1,"Services Intra-Co2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_21",-1,"account_451000",,"account_tax_template_19",1
|
||||
,1,"Services Intra-Co 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_86",0,0,"account_tax_template_21",1,"account_411000","account_tax_code_template_74","account_tax_template_20",1
|
||||
|
||||
|
|
|
|
@ -49,6 +49,6 @@ invoice and send propositions for membership renewal.
|
|||
'demo_xml': ['membership_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '42907796381',
|
||||
'certificate': '0042907796381',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -469,24 +469,6 @@ class Invoice(osv.osv):
|
|||
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
result = super(Invoice, self).create(cr, uid, vals, context)
|
||||
invoice = self.browse(cr, uid, result)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
for line in invoice.invoice_line:
|
||||
if line.product_id and line.product_id.membership:
|
||||
date_from = line.product_id.membership_date_from
|
||||
date_to = line.product_id.membership_date_to
|
||||
if invoice.date_invoice > date_from and invoice.date_invoice < date_to:
|
||||
date_from = invoice.date_invoice
|
||||
line_id = member_line_obj.create(cr, uid, {
|
||||
'partner': invoice.partner_id.id,
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
})
|
||||
return result
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
'''Create a 'date_cancel' on the membership_line object'''
|
||||
if context is None:
|
||||
|
@ -730,3 +712,58 @@ class ReportPartnerMemberYearNew(osv.osv):
|
|||
ReportPartnerMemberYearNew()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
_inherit='account.invoice.line'
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if not context:
|
||||
context={}
|
||||
res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
for line in self.browse(cr, uid, ids):
|
||||
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
|
||||
if line.product_id and line.product_id.membership and not ml_ids:
|
||||
# Product line has changed to a membership product
|
||||
date_from = line.product_id.membership_date_from
|
||||
date_to = line.product_id.membership_date_to
|
||||
if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to:
|
||||
date_from = line.invoice_id.date_invoice
|
||||
line_id = member_line_obj.create(cr, uid, {
|
||||
'partner': line.invoice_id.partner_id.id,
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
})
|
||||
if line.product_id and not line.product_id.membership and ml_ids:
|
||||
# Product line has changed to a non membership product
|
||||
member_line_obj.unlink(cr, uid, ml_ids, context=context)
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
if not context:
|
||||
context={}
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
for id in ids:
|
||||
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',id)])
|
||||
member_line_obj.unlink(cr, uid, ml_ids, context=context)
|
||||
return super(account_invoice_line, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
result = super(account_invoice_line, self).create(cr, uid, vals, context)
|
||||
line = self.browse(cr, uid, result)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
|
||||
if line.product_id and line.product_id.membership and not ml_ids:
|
||||
# Product line is a membership product
|
||||
date_from = line.product_id.membership_date_from
|
||||
date_to = line.product_id.membership_date_to
|
||||
if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to:
|
||||
date_from = line.invoice_id.date_invoice
|
||||
line_id = member_line_obj.create(cr, uid, {
|
||||
'partner': line.invoice_id.partner_id.id,
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
})
|
||||
return result
|
||||
account_invoice_line()
|
||||
|
|
|
@ -75,6 +75,6 @@
|
|||
'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '32052481373',
|
||||
'certificate': '0032052481373',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1044,7 +1044,7 @@ class mrp_procurement(osv.osv):
|
|||
|
||||
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
|
||||
|
||||
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.seller_delay or 0.0)
|
||||
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
|
||||
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
|
||||
context.update({'lang':partner.lang})
|
||||
product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context)
|
||||
|
|
|
@ -42,6 +42,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '86634760061',
|
||||
'certificate': '0086634760061',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -64,6 +64,6 @@
|
|||
'demo_xml': ['mrp_operation_data.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '56233813133',
|
||||
'certificate': '0056233813133',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -47,6 +47,6 @@
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '60814381277',
|
||||
'certificate': '0060814381277',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -471,10 +471,10 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
_name = 'mrp.repair.line'
|
||||
_description = 'Repair Operations Lines'
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if not default: default = {}
|
||||
default.update( {'invoice_line_id':False,'move_id':False,'invoiced':False,'state':'draft'})
|
||||
return super(mrp_repair_line, self).copy(cr, uid, id, default, context)
|
||||
return super(mrp_repair_line, self).copy_data(cr, uid, id, default, context)
|
||||
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
|
@ -539,10 +539,10 @@ mrp_repair_line()
|
|||
class mrp_repair_fee(osv.osv, ProductChangeMixin):
|
||||
_name = 'mrp.repair.fee'
|
||||
_description = 'Repair Fees line'
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if not default: default = {}
|
||||
default.update( {'invoice_line_id':False,'invoiced':False})
|
||||
return super(mrp_repair_fee, self).copy(cr, uid, id, default, context)
|
||||
return super(mrp_repair_fee, self).copy_data(cr, uid, id, default, context)
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
|
|
|
@ -41,6 +41,6 @@ With this module:
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '50060616733',
|
||||
'certificate': '0050060616733',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -50,6 +50,6 @@ Main features :
|
|||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'certificate': '48272150909',
|
||||
'certificate': '0048272150909',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -36,6 +36,6 @@ This module allows you to manage your process for the end-users.
|
|||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '55447636669',
|
||||
'certificate': '0055447636669',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue