[MERGE] Merge from master routing conflict
This commit is contained in:
commit
8678d3c890
|
@ -5,6 +5,6 @@ Contributing to Odoo
|
|||
|
||||
TL;DR
|
||||
|
||||
* Use the [template structure](https://raw.githubusercontent.com/odoo/odoo/master/doc/_templates/issue_template.md)
|
||||
* Pull requests made against the [correct version](https://github.com/odoo/odoo/wiki/Contributing#against-which-version-should-i-submit-a-patch)
|
||||
* Read the restrictions for [changes in stable](https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean)
|
||||
* Use this [template](https://raw.githubusercontent.com/odoo/odoo/master/doc/_templates/issue_template.md) when reporting issues, and please search for duplicates first!
|
||||
* Pull requests must be made against the [correct version](https://github.com/odoo/odoo/wiki/Contributing#against-which-version-should-i-submit-a-patch)
|
||||
* There are restrictions on the kind of [changes allowed in stable series](https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
.*
|
||||
**/node_modules
|
|
@ -26,6 +26,9 @@ from openerp.report import report_sxw
|
|||
|
||||
class account_bank_statement(osv.osv):
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if vals.get('name', '/') == '/':
|
||||
journal_id = vals.get('journal_id', self._default_journal_id(cr, uid, context=context))
|
||||
vals['name'] = self._compute_default_statement_name(cr, uid, journal_id, context=context)
|
||||
if 'line_ids' in vals:
|
||||
for idx, line in enumerate(vals['line_ids']):
|
||||
line[2]['sequence'] = idx + 1
|
||||
|
@ -65,17 +68,14 @@ class account_bank_statement(osv.osv):
|
|||
return periods[0]
|
||||
return False
|
||||
|
||||
def _compute_default_statement_name(self, cr, uid, context=None):
|
||||
def _compute_default_statement_name(self, cr, uid, journal_id, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
obj_seq = self.pool.get('ir.sequence')
|
||||
default_journal_id = self._default_journal_id(cr, uid, context=context)
|
||||
if default_journal_id != False:
|
||||
period = self.pool.get('account.period').browse(cr, uid, self._get_period(cr, uid, context=context), context=context)
|
||||
context['fiscalyear_id'] = period.fiscalyear_id.id
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, default_journal_id, None)
|
||||
return obj_seq.next_by_id(cr, uid, journal.sequence_id.id, context=context)
|
||||
return obj_seq.next_by_code(cr, uid, 'account.bank.statement', context=context)
|
||||
period = self.pool.get('account.period').browse(cr, uid, self._get_period(cr, uid, context=context), context=context)
|
||||
context['fiscalyear_id'] = period.fiscalyear_id.id
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, None)
|
||||
return obj_seq.next_by_id(cr, uid, journal.sequence_id.id, context=context)
|
||||
|
||||
def _currency(self, cursor, user, ids, name, args, context=None):
|
||||
res = {}
|
||||
|
@ -150,7 +150,7 @@ class account_bank_statement(osv.osv):
|
|||
}
|
||||
|
||||
_defaults = {
|
||||
'name': _compute_default_statement_name,
|
||||
'name': '/',
|
||||
'date': fields.date.context_today,
|
||||
'state': 'draft',
|
||||
'journal_id': _default_journal_id,
|
||||
|
@ -213,11 +213,8 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
def _get_counter_part_account(sefl, cr, uid, st_line, context=None):
|
||||
"""Retrieve the account to use in the counterpart move.
|
||||
This method may be overridden to implement custom move generation (making sure to
|
||||
call super() to establish a clean extension chain).
|
||||
|
||||
:param browse_record st_line: account.bank.statement.line record to
|
||||
create the move from.
|
||||
:param browse_record st_line: account.bank.statement.line record to create the move from.
|
||||
:return: int/long of the account.account to use as counterpart
|
||||
"""
|
||||
if st_line.amount >= 0:
|
||||
|
@ -226,26 +223,19 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
def _get_counter_part_partner(sefl, cr, uid, st_line, context=None):
|
||||
"""Retrieve the partner to use in the counterpart move.
|
||||
This method may be overridden to implement custom move generation (making sure to
|
||||
call super() to establish a clean extension chain).
|
||||
|
||||
:param browse_record st_line: account.bank.statement.line record to
|
||||
create the move from.
|
||||
:param browse_record st_line: account.bank.statement.line record to create the move from.
|
||||
:return: int/long of the res.partner to use as counterpart
|
||||
"""
|
||||
return st_line.partner_id and st_line.partner_id.id or False
|
||||
|
||||
def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, context=None):
|
||||
"""Compute the args to build the dict of values to create the counter part move line from a
|
||||
statement line by calling the _prepare_move_line_vals. This method may be
|
||||
overridden to implement custom move generation (making sure to call super() to
|
||||
establish a clean extension chain).
|
||||
statement line by calling the _prepare_move_line_vals.
|
||||
|
||||
:param browse_record st_line: account.bank.statement.line record to
|
||||
create the move from.
|
||||
:param browse_record st_line: account.bank.statement.line record to create the move from.
|
||||
:param int/long move_id: ID of the account.move to link the move line
|
||||
:param float amount: amount of the move line
|
||||
:param int/long account_id: ID of account to use as counter part
|
||||
:param int/long company_currency_id: ID of currency of the concerned company
|
||||
:return: dict of value to create() the bank account.move.line
|
||||
"""
|
||||
|
@ -258,7 +248,6 @@ class account_bank_statement(osv.osv):
|
|||
if st_line.statement_id.currency.id != company_currency_id:
|
||||
amt_cur = st_line.amount
|
||||
cur_id = st_line.currency_id or st_line.statement_id.currency.id
|
||||
# TODO : FIXME the amount should be in the journal currency
|
||||
if st_line.currency_id and st_line.amount_currency:
|
||||
amt_cur = st_line.amount_currency
|
||||
cur_id = st_line.currency_id.id
|
||||
|
@ -269,9 +258,7 @@ class account_bank_statement(osv.osv):
|
|||
def _prepare_move_line_vals(self, cr, uid, st_line, move_id, debit, credit, currency_id=False,
|
||||
amount_currency=False, account_id=False, partner_id=False, context=None):
|
||||
"""Prepare the dict of values to create the move line from a
|
||||
statement line. All non-mandatory args will replace the default computed one.
|
||||
This method may be overridden to implement custom move generation (making sure to
|
||||
call super() to establish a clean extension chain).
|
||||
statement line.
|
||||
|
||||
:param browse_record st_line: account.bank.statement.line record to
|
||||
create the move from.
|
||||
|
@ -342,21 +329,29 @@ class account_bank_statement(osv.osv):
|
|||
move_ids.append(st_line.journal_entry_id.id)
|
||||
self.pool.get('account.move').post(cr, uid, move_ids, context=context)
|
||||
self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st.name,), context=context)
|
||||
self.link_bank_to_partner(cr, uid, ids, context=context)
|
||||
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
done = []
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
reconcile_pool = self.pool.get('account.move.reconcile')
|
||||
move_line_pool = self.pool.get('account.move.line')
|
||||
move_ids = []
|
||||
for st in self.browse(cr, uid, ids, context=context):
|
||||
if st.state=='draft':
|
||||
continue
|
||||
move_ids = []
|
||||
for line in st.line_ids:
|
||||
move_ids += [x.id for x in line.move_ids]
|
||||
if line.journal_entry_id:
|
||||
move_ids.append(line.journal_entry_id.id)
|
||||
for aml in line.journal_entry_id.line_id:
|
||||
if aml.reconcile_id:
|
||||
move_lines = [l.id for l in aml.reconcile_id.line_id]
|
||||
move_lines.remove(aml.id)
|
||||
reconcile_pool.unlink(cr, uid, [aml.reconcile_id.id], context=context)
|
||||
if len(move_lines) >= 2:
|
||||
move_line_pool.reconcile_partial(cr, uid, move_lines, 'auto', context=context)
|
||||
if move_ids:
|
||||
account_move_obj.button_cancel(cr, uid, move_ids, context=context)
|
||||
account_move_obj.unlink(cr, uid, move_ids, context)
|
||||
done.append(st.id)
|
||||
return self.write(cr, uid, done, {'state':'draft'}, context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'draft'}, context=context)
|
||||
|
||||
def _compute_balance_end_real(self, cr, uid, journal_id, context=None):
|
||||
res = False
|
||||
|
@ -417,18 +412,35 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
def number_of_lines_reconciled(self, cr, uid, id, context=None):
|
||||
bsl_obj = self.pool.get('account.bank.statement.line')
|
||||
return bsl_obj.search_count(cr, uid, [('statement_id','=',id), ('journal_entry_id','!=',False)], context=context)
|
||||
|
||||
return bsl_obj.search_count(cr, uid, [('statement_id', '=', id), ('journal_entry_id', '!=', False)], context=context)
|
||||
|
||||
def get_format_currency_js_function(self, cr, uid, id, context=None):
|
||||
""" Returns a string that can be used to instanciate a javascript function.
|
||||
That function formats a number according to the statement's journal currency """
|
||||
That function formats a number according to the statement line's currency or the statement currency"""
|
||||
company_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
|
||||
currency_obj = id and self.browse(cr, uid, id, context=context).journal_id.currency or company_currency
|
||||
st = id and self.browse(cr, uid, id, context=context)
|
||||
if not st:
|
||||
return
|
||||
statement_currency = st.journal_id.currency or company_currency
|
||||
digits = 2 # TODO : from currency_obj
|
||||
if currency_obj.position == 'after':
|
||||
return "return amount.toFixed("+str(digits)+") + ' "+currency_obj.symbol+"';"
|
||||
elif currency_obj.position == 'before':
|
||||
return "return '"+currency_obj.symbol+" ' + amount.toFixed("+str(digits)+");"
|
||||
function = ""
|
||||
done_currencies = []
|
||||
for st_line in st.line_ids:
|
||||
st_line_currency = st_line.currency_id or statement_currency
|
||||
if st_line_currency.id not in done_currencies:
|
||||
if st_line_currency.position == 'after':
|
||||
return_str = "return amount.toFixed(" + str(digits) + ") + ' " + st_line_currency.symbol + "';"
|
||||
else:
|
||||
return_str = "return '" + st_line_currency.symbol + " ' + amount.toFixed(" + str(digits) + ");"
|
||||
function += "if (currency_id === " + str(st_line_currency.id) + "){ " + return_str + " }"
|
||||
done_currencies.append(st_line_currency.id)
|
||||
return function
|
||||
|
||||
def link_bank_to_partner(self, cr, uid, ids, context=None):
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
for st_line in statement.line_ids:
|
||||
if st_line.bank_account_id and st_line.partner_id and st_line.bank_account_id.partner_id.id != st_line.partner_id.id:
|
||||
self.pool.get('res.partner.bank').write(cr, uid, [st_line.bank_account_id.id], {'partner_id': st_line.partner_id.id}, context=context)
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
||||
|
@ -436,43 +448,64 @@ class account_bank_statement_line(osv.osv):
|
|||
""" Used to instanciate a batch of reconciliations in a single request """
|
||||
# Build a list of reconciliations data
|
||||
ret = []
|
||||
statement_line_done = {}
|
||||
mv_line_ids_selected = []
|
||||
for st_line in self.browse(cr, uid, ids, context=context):
|
||||
# look for structured communication first
|
||||
exact_match_id = self.search_structured_com(cr, uid, st_line, context=context)
|
||||
if exact_match_id:
|
||||
reconciliation_data = {
|
||||
'st_line': self.get_statement_line_for_reconciliation(cr, uid, st_line.id, context),
|
||||
'reconciliation_proposition': self.make_counter_part_lines(cr, uid, st_line, [exact_match_id], context=context)
|
||||
}
|
||||
for mv_line in reconciliation_data['reconciliation_proposition']:
|
||||
mv_line_ids_selected.append(mv_line['id'])
|
||||
statement_line_done[st_line.id] = reconciliation_data
|
||||
|
||||
for st_line_id in ids:
|
||||
reconciliation_data = {
|
||||
'st_line': self.get_statement_line_for_reconciliation(cr, uid, st_line_id, context),
|
||||
'reconciliation_proposition': self.get_reconciliation_proposition(cr, uid, st_line_id, mv_line_ids_selected, context)
|
||||
}
|
||||
for mv_line in reconciliation_data['reconciliation_proposition']:
|
||||
mv_line_ids_selected.append(mv_line['id'])
|
||||
ret.append(reconciliation_data);
|
||||
|
||||
if statement_line_done.get(st_line_id):
|
||||
ret.append(statement_line_done.get(st_line_id))
|
||||
else:
|
||||
reconciliation_data = {
|
||||
'st_line': self.get_statement_line_for_reconciliation(cr, uid, st_line_id, context),
|
||||
'reconciliation_proposition': self.get_reconciliation_proposition(cr, uid, st_line_id, mv_line_ids_selected, context)
|
||||
}
|
||||
for mv_line in reconciliation_data['reconciliation_proposition']:
|
||||
mv_line_ids_selected.append(mv_line['id'])
|
||||
ret.append(reconciliation_data)
|
||||
|
||||
# Check if, now that 'candidate' move lines were selected, there are moves left for statement lines
|
||||
for reconciliation_data in ret:
|
||||
if not reconciliation_data['st_line']['has_no_partner']:
|
||||
if self.get_move_lines_counterparts(cr, uid, reconciliation_data['st_line']['id'], excluded_ids=mv_line_ids_selected, count=True, context=context) == 0:
|
||||
reconciliation_data['st_line']['no_match'] = True
|
||||
#for reconciliation_data in ret:
|
||||
# if not reconciliation_data['st_line']['has_no_partner']:
|
||||
# st_line = self.browse(cr, uid, reconciliation_data['st_line']['id'], context=context)
|
||||
# if not self.get_move_lines_counterparts(cr, uid, st_line, excluded_ids=mv_line_ids_selected, count=True, context=context):
|
||||
# reconciliation_data['st_line']['no_match'] = True
|
||||
return ret
|
||||
|
||||
def get_statement_line_for_reconciliation(self, cr, uid, id, context=None):
|
||||
""" Returns the data required by the bank statement reconciliation use case """
|
||||
line = self.browse(cr, uid, id, context=context)
|
||||
statement_currency = line.journal_id.currency or line.journal_id.company_id.currency_id
|
||||
amount = line.amount
|
||||
rml_parser = report_sxw.rml_parse(cr, uid, 'statement_line_widget', context=context)
|
||||
amount_str = line.amount > 0 and line.amount or -line.amount
|
||||
amount_str = rml_parser.formatLang(amount_str, currency_obj=statement_currency)
|
||||
amount_currency_str = ""
|
||||
if line.amount_currency and line.currency_id:
|
||||
amount_currency_str = rml_parser.formatLang(line.amount_currency, currency_obj=line.currency_id)
|
||||
amount_currency_str = amount_str
|
||||
amount_str = rml_parser.formatLang(line.amount_currency, currency_obj=line.currency_id)
|
||||
amount = line.amount_currency
|
||||
|
||||
dict = {
|
||||
data = {
|
||||
'id': line.id,
|
||||
'ref': line.ref,
|
||||
'note': line.note or "",
|
||||
'name': line.name,
|
||||
'date': line.date,
|
||||
'amount': line.amount,
|
||||
'amount': amount,
|
||||
'amount_str': amount_str,
|
||||
'no_match': self.get_move_lines_counterparts(cr, uid, id, count=True, context=context) == 0 and line.partner_id.id,
|
||||
'currency_id': line.currency_id.id or statement_currency.id,
|
||||
'no_match': self.get_move_lines_counterparts(cr, uid, line, count=True, context=context) == 0,
|
||||
'partner_id': line.partner_id.id,
|
||||
'statement_id': line.statement_id.id,
|
||||
'account_code': line.journal_id.default_debit_account_id.code,
|
||||
|
@ -482,93 +515,105 @@ class account_bank_statement_line(osv.osv):
|
|||
'has_no_partner': not line.partner_id.id,
|
||||
}
|
||||
if line.partner_id.id:
|
||||
if line.amount > 0:
|
||||
dict['open_balance_account_id'] = line.partner_id.property_account_receivable.id
|
||||
else:
|
||||
dict['open_balance_account_id'] = line.partner_id.property_account_payable.id
|
||||
return dict
|
||||
data['open_balance_account_id'] = line.partner_id.property_account_payable.id
|
||||
if amount > 0:
|
||||
data['open_balance_account_id'] = line.partner_id.property_account_receivable.id
|
||||
return data
|
||||
|
||||
def search_structured_com(self, cr, uid, st_line, context=None):
|
||||
if not st_line.ref:
|
||||
return
|
||||
domain = [('ref', '=', st_line.ref)]
|
||||
if st_line.partner_id:
|
||||
domain += [('partner_id', '=', st_line.partner_id.id)]
|
||||
ids = self.pool.get('account.move.line').search(cr, uid, domain, limit=1, context=context)
|
||||
return ids and ids[0] or False
|
||||
|
||||
def get_reconciliation_proposition(self, cr, uid, id, excluded_ids=[], context=None):
|
||||
""" Returns move lines that constitute the best guess to reconcile a statement line. """
|
||||
st_line = self.browse(cr, uid, id, context=context)
|
||||
company_currency = st_line.journal_id.company_id.currency_id.id
|
||||
statement_currency = st_line.journal_id.currency.id or company_currency
|
||||
|
||||
# either use the unsigned debit/credit fields or the signed amount_currency field
|
||||
sign = 1
|
||||
if statement_currency == company_currency:
|
||||
amount_field = 'credit'
|
||||
if st_line.amount > 0:
|
||||
amount_field = 'debit'
|
||||
else:
|
||||
amount_field = 'credit'
|
||||
else:
|
||||
amount_field = 'amount_currency'
|
||||
if st_line.amount < 0:
|
||||
sign = -1
|
||||
|
||||
#we don't propose anything if there is no partner detected
|
||||
if not st_line.partner_id.id:
|
||||
return []
|
||||
# look for exact match
|
||||
exact_match_id = self.get_move_lines_counterparts(cr, uid, id, excluded_ids=excluded_ids, limit=1, additional_domain=[(amount_field,'=',(sign*st_line.amount))])
|
||||
exact_match_id = self.get_move_lines_counterparts(cr, uid, st_line, excluded_ids=excluded_ids, additional_domain=[(amount_field, '=', (sign * st_line.amount))])
|
||||
if exact_match_id:
|
||||
return exact_match_id
|
||||
return exact_match_id[0]
|
||||
|
||||
# select oldest move lines
|
||||
if sign == -1:
|
||||
mv_lines = self.get_move_lines_counterparts(cr, uid, id, excluded_ids=excluded_ids, limit=50, additional_domain=[(amount_field,'<',0)])
|
||||
mv_lines = self.get_move_lines_counterparts(cr, uid, st_line, excluded_ids=excluded_ids, additional_domain=[(amount_field, '<', 0)])
|
||||
else:
|
||||
mv_lines = self.get_move_lines_counterparts(cr, uid, id, excluded_ids=excluded_ids, limit=50, additional_domain=[(amount_field,'>',0)])
|
||||
mv_lines = self.get_move_lines_counterparts(cr, uid, st_line, excluded_ids=excluded_ids, additional_domain=[(amount_field, '>', 0)])
|
||||
ret = []
|
||||
total = 0
|
||||
# get_move_lines_counterparts inverts debit and credit
|
||||
amount_field = 'debit' if amount_field == 'credit' else 'credit'
|
||||
for line in mv_lines:
|
||||
if total + line[amount_field] <= st_line.amount:
|
||||
if total + line[amount_field] <= abs(st_line.amount):
|
||||
ret.append(line)
|
||||
total += line[amount_field]
|
||||
else:
|
||||
if total >= abs(st_line.amount):
|
||||
break
|
||||
|
||||
return ret
|
||||
|
||||
def get_move_lines_counterparts(self, cr, uid, id, excluded_ids=[], str="", offset=0, limit=None, count=False, additional_domain=[], context=None):
|
||||
def get_move_lines_counterparts_id(self, cr, uid, st_line_id, excluded_ids=[], additional_domain=[], count=False, context=None):
|
||||
st_line = self.browse(cr, uid, st_line_id, context=context)
|
||||
return self.get_move_lines_counterparts(cr, uid, st_line, excluded_ids, additional_domain, count, context=context)
|
||||
|
||||
def get_move_lines_counterparts(self, cr, uid, st_line, excluded_ids=[], additional_domain=[], count=False, context=None):
|
||||
""" Find the move lines that could be used to reconcile a statement line and returns the counterpart that could be created to reconcile them
|
||||
If count is true, only returns the count.
|
||||
|
||||
:param integer id: the id of the statement line
|
||||
:param st_line: the browse record of the statement line
|
||||
:param integers list excluded_ids: ids of move lines that should not be fetched
|
||||
:param string str: string to filter lines
|
||||
:param string filter_str: string to filter lines
|
||||
:param integer offset: offset of the request
|
||||
:param integer limit: number of lines to fetch
|
||||
:param boolean count: just return the number of records
|
||||
:param tuples list domain: additional domain restrictions
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
rml_parser = report_sxw.rml_parse(cr, uid, 'statement_line_counterpart_widget', context=context)
|
||||
st_line = self.browse(cr, uid, id, context=context)
|
||||
company_currency = st_line.journal_id.company_id.currency_id
|
||||
statement_currency = st_line.journal_id.currency or company_currency
|
||||
mv_line_pool = self.pool.get('account.move.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
|
||||
domain = additional_domain + [
|
||||
('partner_id', '=', st_line.partner_id.id),
|
||||
('reconcile_id', '=', False),
|
||||
('state','=','valid'),
|
||||
'|',('account_id.type', '=', 'receivable'),
|
||||
('account_id.type', '=', 'payable'), #Let the front-end warn the user if he tries to mix payable and receivable in the same reconciliation
|
||||
]
|
||||
domain = additional_domain + [('reconcile_id', '=', False),('state', '=', 'valid')]
|
||||
if st_line.partner_id.id:
|
||||
domain += [('partner_id', '=', st_line.partner_id.id),
|
||||
'|', ('account_id.type', '=', 'receivable'),
|
||||
('account_id.type', '=', 'payable')]
|
||||
else:
|
||||
domain += [('account_id.reconcile', '=', True)]
|
||||
#domain += [('account_id.reconcile', '=', True), ('account_id.type', '=', 'other')]
|
||||
if excluded_ids:
|
||||
domain.append(('id', 'not in', excluded_ids))
|
||||
if str:
|
||||
domain += ['|', ('move_id.name', 'ilike', str), ('move_id.ref', 'ilike', str)]
|
||||
line_ids = mv_line_pool.search(cr, uid, domain, order="date_maturity asc, id asc", context=context)
|
||||
return self.make_counter_part_lines(cr, uid, st_line, line_ids, count=count, context=context)
|
||||
|
||||
def make_counter_part_lines(self, cr, uid, st_line, line_ids, count=False, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
mv_line_pool = self.pool.get('account.move.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
company_currency = st_line.journal_id.company_id.currency_id
|
||||
statement_currency = st_line.journal_id.currency or company_currency
|
||||
rml_parser = report_sxw.rml_parse(cr, uid, 'statement_line_counterpart_widget', context=context)
|
||||
#partially reconciled lines can be displayed only once
|
||||
reconcile_partial_ids = []
|
||||
ids = mv_line_pool.search(cr, uid, domain, offset=offset, limit=limit, order="date_maturity asc, id asc", context=context)
|
||||
|
||||
if count:
|
||||
nb_lines = 0
|
||||
for line in mv_line_pool.browse(cr, uid, ids, context=context):
|
||||
for line in mv_line_pool.browse(cr, uid, line_ids, context=context):
|
||||
if line.reconcile_partial_id and line.reconcile_partial_id.id in reconcile_partial_ids:
|
||||
continue
|
||||
nb_lines += 1
|
||||
|
@ -577,7 +622,7 @@ class account_bank_statement_line(osv.osv):
|
|||
return nb_lines
|
||||
else:
|
||||
ret = []
|
||||
for line in mv_line_pool.browse(cr, uid, ids, context=context):
|
||||
for line in mv_line_pool.browse(cr, uid, line_ids, context=context):
|
||||
if line.reconcile_partial_id and line.reconcile_partial_id.id in reconcile_partial_ids:
|
||||
continue
|
||||
amount_currency_str = ""
|
||||
|
@ -595,8 +640,12 @@ class account_bank_statement_line(osv.osv):
|
|||
'period_name': line.period_id.name,
|
||||
'journal_name': line.journal_id.name,
|
||||
'amount_currency_str': amount_currency_str,
|
||||
'partner_id': line.partner_id.id,
|
||||
'partner_name': line.partner_id.name,
|
||||
'has_no_partner': not bool(st_line.partner_id.id),
|
||||
}
|
||||
if statement_currency.id != company_currency.id and line.currency_id and line.currency_id.id == statement_currency.id:
|
||||
st_line_currency = st_line.currency_id or statement_currency
|
||||
if st_line.currency_id and line.currency_id and line.currency_id.id == st_line.currency_id.id:
|
||||
if line.amount_residual_currency < 0:
|
||||
ret_line['debit'] = 0
|
||||
ret_line['credit'] = -line.amount_residual_currency
|
||||
|
@ -613,21 +662,46 @@ class account_bank_statement_line(osv.osv):
|
|||
ret_line['credit'] = line.amount_residual if line.debit != 0 else 0
|
||||
ctx = context.copy()
|
||||
ctx.update({'date': st_line.date})
|
||||
ret_line['debit'] = currency_obj.compute(cr, uid, statement_currency.id, company_currency.id, ret_line['debit'], context=ctx)
|
||||
ret_line['credit'] = currency_obj.compute(cr, uid, statement_currency.id, company_currency.id, ret_line['credit'], context=ctx)
|
||||
ret_line['debit_str'] = rml_parser.formatLang(ret_line['debit'], currency_obj=statement_currency)
|
||||
ret_line['credit_str'] = rml_parser.formatLang(ret_line['credit'], currency_obj=statement_currency)
|
||||
ret_line['debit'] = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, ret_line['debit'], context=ctx)
|
||||
ret_line['credit'] = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, ret_line['credit'], context=ctx)
|
||||
ret_line['debit_str'] = rml_parser.formatLang(ret_line['debit'], currency_obj=st_line_currency)
|
||||
ret_line['credit_str'] = rml_parser.formatLang(ret_line['credit'], currency_obj=st_line_currency)
|
||||
ret.append(ret_line)
|
||||
if line.reconcile_partial_id:
|
||||
reconcile_partial_ids.append(line.reconcile_partial_id.id)
|
||||
return ret
|
||||
|
||||
def get_currency_rate_line(self, cr, uid, st_line, currency_diff, move_id, context=None):
|
||||
if currency_diff < 0:
|
||||
account_id = st_line.company_id.expense_currency_exchange_account_id.id
|
||||
if not account_id:
|
||||
raise osv.except_osv(_('Insufficient Configuration!'), _("You should configure the 'Loss Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
|
||||
else:
|
||||
account_id = st_line.company_id.income_currency_exchange_account_id.id
|
||||
if not account_id:
|
||||
raise osv.except_osv(_('Insufficient Configuration!'), _("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
|
||||
return {
|
||||
'move_id': move_id,
|
||||
'name': _('change') + ': ' + (st_line.name or '/'),
|
||||
'period_id': st_line.statement_id.period_id.id,
|
||||
'journal_id': st_line.journal_id.id,
|
||||
'partner_id': st_line.partner_id.id,
|
||||
'company_id': st_line.company_id.id,
|
||||
'statement_id': st_line.statement_id.id,
|
||||
'debit': currency_diff < 0 and -currency_diff or 0,
|
||||
'credit': currency_diff > 0 and currency_diff or 0,
|
||||
'date': st_line.date,
|
||||
'account_id': account_id
|
||||
}
|
||||
|
||||
def process_reconciliation(self, cr, uid, id, mv_line_dicts, context=None):
|
||||
""" Creates a move line for each item of mv_line_dicts and for the statement line. Reconcile a new move line with its counterpart_move_line_id if specified. Finally, mark the statement line as reconciled by putting the newly created move id in the column journal_entry_id.
|
||||
|
||||
:param int id: id of the bank statement line
|
||||
:param list of dicts mv_line_dicts: move lines to create. If counterpart_move_line_id is specified, reconcile with it
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
st_line = self.browse(cr, uid, id, context=context)
|
||||
company_currency = st_line.journal_id.company_id.currency_id
|
||||
statement_currency = st_line.journal_id.currency or company_currency
|
||||
|
@ -637,7 +711,7 @@ class account_bank_statement_line(osv.osv):
|
|||
currency_obj = self.pool.get('res.currency')
|
||||
|
||||
# Checks
|
||||
if st_line.journal_entry_id.id != False:
|
||||
if st_line.journal_entry_id.id:
|
||||
raise osv.except_osv(_('Error!'), _('The bank statement line was already reconciled.'))
|
||||
for mv_line_dict in mv_line_dicts:
|
||||
for field in ['debit', 'credit', 'amount_currency']:
|
||||
|
@ -657,37 +731,50 @@ class account_bank_statement_line(osv.osv):
|
|||
amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount, context=context)
|
||||
bank_st_move_vals = bs_obj._prepare_bank_move_line(cr, uid, st_line, move_id, amount, company_currency.id, context=context)
|
||||
aml_obj.create(cr, uid, bank_st_move_vals, context=context)
|
||||
st_line_currency_rate = bank_st_move_vals['amount_currency'] and statement_currency.id == company_currency.id and (bank_st_move_vals['amount_currency'] / st_line.amount) or False
|
||||
st_line_currency = bank_st_move_vals['currency_id']
|
||||
# Complete the dicts
|
||||
st_line_statement_id = st_line.statement_id.id
|
||||
st_line_journal_id = st_line.journal_id.id
|
||||
st_line_partner_id = st_line.partner_id.id
|
||||
st_line_company_id = st_line.company_id.id
|
||||
st_line_period_id = st_line.statement_id.period_id.id
|
||||
st_line_currency = st_line.currency_id or statement_currency
|
||||
st_line_currency_rate = st_line.currency_id and statement_currency.id == company_currency.id and (st_line.amount_currency / st_line.amount) or False
|
||||
to_create = []
|
||||
for mv_line_dict in mv_line_dicts:
|
||||
mv_line_dict['ref'] = move_name
|
||||
mv_line_dict['move_id'] = move_id
|
||||
mv_line_dict['period_id'] = st_line_period_id
|
||||
mv_line_dict['journal_id'] = st_line_journal_id
|
||||
mv_line_dict['partner_id'] = st_line_partner_id
|
||||
mv_line_dict['company_id'] = st_line_company_id
|
||||
mv_line_dict['statement_id'] = st_line_statement_id
|
||||
mv_line_dict['period_id'] = st_line.statement_id.period_id.id
|
||||
mv_line_dict['journal_id'] = st_line.journal_id.id
|
||||
mv_line_dict['company_id'] = st_line.company_id.id
|
||||
mv_line_dict['statement_id'] = st_line.statement_id.id
|
||||
if mv_line_dict.get('counterpart_move_line_id'):
|
||||
mv_line = aml_obj.browse(cr, uid, mv_line_dict['counterpart_move_line_id'], context=context)
|
||||
mv_line_dict['account_id'] = mv_line.account_id.id
|
||||
if statement_currency.id != company_currency.id:
|
||||
if st_line_currency.id != company_currency.id:
|
||||
mv_line_dict['amount_currency'] = mv_line_dict['debit'] - mv_line_dict['credit']
|
||||
mv_line_dict['currency_id'] = statement_currency.id
|
||||
mv_line_dict['debit'] = currency_obj.compute(cr, uid, statement_currency.id, company_currency.id, mv_line_dict['debit'])
|
||||
mv_line_dict['credit'] = currency_obj.compute(cr, uid, statement_currency.id, company_currency.id, mv_line_dict['credit'])
|
||||
elif st_line_currency and st_line_currency_rate:
|
||||
mv_line_dict['amount_currency'] = self.pool.get('res.currency').round(cr, uid, st_line.currency_id, (mv_line_dict['debit'] - mv_line_dict['credit']) * st_line_currency_rate)
|
||||
mv_line_dict['currency_id'] = st_line_currency
|
||||
|
||||
mv_line_dict['currency_id'] = st_line_currency.id
|
||||
if st_line.currency_id and statement_currency.id == company_currency.id and st_line_currency_rate:
|
||||
debit_at_current_rate = self.pool.get('res.currency').round(cr, uid, company_currency, mv_line_dict['debit'] / st_line_currency_rate)
|
||||
credit_at_current_rate = self.pool.get('res.currency').round(cr, uid, company_currency, mv_line_dict['credit'] / st_line_currency_rate)
|
||||
else:
|
||||
debit_at_current_rate = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, mv_line_dict['debit'], context=context)
|
||||
credit_at_current_rate = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, mv_line_dict['credit'], context=context)
|
||||
if mv_line_dict.get('counterpart_move_line_id'):
|
||||
#post an account line that use the same currency rate than the counterpart (to balance the account) and post the difference in another line
|
||||
ctx = context.copy()
|
||||
ctx['date'] = mv_line.date
|
||||
debit_at_old_rate = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, mv_line_dict['debit'], context=ctx)
|
||||
credit_at_old_rate = currency_obj.compute(cr, uid, st_line_currency.id, company_currency.id, mv_line_dict['credit'], context=ctx)
|
||||
mv_line_dict['credit'] = credit_at_old_rate
|
||||
mv_line_dict['debit'] = debit_at_old_rate
|
||||
if debit_at_old_rate - debit_at_current_rate:
|
||||
currency_diff = debit_at_current_rate - debit_at_old_rate
|
||||
to_create.append(self.get_currency_rate_line(cr, uid, st_line, currency_diff, move_id, context=context))
|
||||
if credit_at_old_rate - credit_at_current_rate:
|
||||
currency_diff = credit_at_current_rate - credit_at_old_rate
|
||||
to_create.append(self.get_currency_rate_line(cr, uid, st_line, currency_diff, move_id, context=context))
|
||||
else:
|
||||
mv_line_dict['debit'] = debit_at_current_rate
|
||||
mv_line_dict['credit'] = credit_at_current_rate
|
||||
to_create.append(mv_line_dict)
|
||||
# Create move lines
|
||||
move_line_pairs_to_reconcile = []
|
||||
for mv_line_dict in mv_line_dicts:
|
||||
for mv_line_dict in to_create:
|
||||
counterpart_move_line_id = None # NB : this attribute is irrelevant for aml_obj.create() and needs to be removed from the dict
|
||||
if mv_line_dict.get('counterpart_move_line_id'):
|
||||
counterpart_move_line_id = mv_line_dict['counterpart_move_line_id']
|
||||
|
@ -723,7 +810,7 @@ class account_bank_statement_line(osv.osv):
|
|||
'bank_account_id': fields.many2one('res.partner.bank','Bank Account'),
|
||||
'statement_id': fields.many2one('account.bank.statement', 'Statement', select=True, required=True, ondelete='cascade'),
|
||||
'journal_id': fields.related('statement_id', 'journal_id', type='many2one', relation='account.journal', string='Journal', store=True, readonly=True),
|
||||
'ref': fields.char('Reference', size=32),
|
||||
'ref': fields.char('Structured Communication'),
|
||||
'note': fields.text('Notes'),
|
||||
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of bank statement lines."),
|
||||
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
|
|
|
@ -295,7 +295,8 @@ class account_invoice(osv.osv):
|
|||
},
|
||||
multi='all'),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}, track_visibility='always'),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]},
|
||||
domain="[('type', 'in', {'out_invoice': ['sale'], 'out_refund': ['sale_refund'], 'in_refund': ['purchase_refund'], 'in_invoice': ['purchase']}.get(type, [])), ('company_id', '=', company_id)]"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'reconciled': fields.function(_reconciled, string='Paid/Reconciled', type='boolean',
|
||||
|
|
|
@ -127,8 +127,8 @@ class account_move_line(osv.osv):
|
|||
|
||||
if move_line.reconcile_id:
|
||||
continue
|
||||
if not move_line.account_id.type in ('payable', 'receivable'):
|
||||
#this function does not suport to be used on move lines not related to payable or receivable accounts
|
||||
if not move_line.account_id.reconcile:
|
||||
#this function does not suport to be used on move lines not related to a reconcilable account
|
||||
continue
|
||||
|
||||
if move_line.currency_id:
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<field name="balance_end_real" eval="3707.58"/>
|
||||
</record>
|
||||
<record id="demo_bank_statement_line_1" model="account.bank.statement.line">
|
||||
<field name="ref">001</field>
|
||||
<field name="ref"></field>
|
||||
<field name="statement_id" ref="demo_bank_statement_1"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<field name="partner_id" ref="base.res_partner_9"/>
|
||||
</record>
|
||||
<record id="demo_bank_statement_line_2" model="account.bank.statement.line">
|
||||
<field name="ref">002</field>
|
||||
<field name="ref">SAJ2014002</field>
|
||||
<field name="statement_id" ref="demo_bank_statement_1"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<field name="partner_id" ref="base.res_partner_9"/>
|
||||
</record>
|
||||
<record id="demo_bank_statement_line_3" model="account.bank.statement.line">
|
||||
<field name="ref">003</field>
|
||||
<field name="ref"></field>
|
||||
<field name="statement_id" ref="demo_bank_statement_1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<field name="date" eval="time.strftime('%Y')+'-01-01'"/>
|
||||
</record>
|
||||
<record id="demo_bank_statement_line_4" model="account.bank.statement.line">
|
||||
<field name="ref">004</field>
|
||||
<field name="ref"></field>
|
||||
<field name="statement_id" ref="demo_bank_statement_1"/>
|
||||
<field name="sequence" eval="4"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
|
|
|
@ -139,6 +139,13 @@
|
|||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="account_subscription_line_comp_rule" model="ir.rule">
|
||||
<field name="name">Account subscription line company rule</field>
|
||||
<field name="model_id" ref="model_account_subscription_line"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('subscription_id.model_id.company_id','=',False),('subscription_id.model_id.company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="account_invoice_line_comp_rule">
|
||||
<field name="name">Invoice Line company rule</field>
|
||||
<field name="model_id" ref="model_account_invoice_line"/>
|
||||
|
|
|
@ -120,8 +120,6 @@
|
|||
cursor: pointer; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_match:not(.no_partner) .toggle_match {
|
||||
visibility: hidden !important; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_partner .partner_name, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_partner .line_open_balance {
|
||||
display: none !important; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line > table > tbody > tr:nth-child(1) > td table {
|
||||
margin-bottom: 10px; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line table.details td:first-child {
|
||||
|
@ -202,10 +200,6 @@
|
|||
cursor: pointer; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view td:nth-child(6) {
|
||||
border-left: 1px solid black; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.initial_line > td:nth-child(5) {
|
||||
border-top: 1px solid black; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.initial_line > td:nth-child(6) {
|
||||
border-top: 1px solid black; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match .match_controls {
|
||||
padding: 0 0 5px 18px; }
|
||||
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match .match_controls .filter {
|
||||
|
|
|
@ -194,12 +194,6 @@ $initialLineBackground: #f0f0f0;
|
|||
}
|
||||
}
|
||||
|
||||
&.no_partner {
|
||||
.partner_name, .line_open_balance {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* gap between accounting_view and action view */
|
||||
> table > tbody > tr:nth-child(1) > td table {
|
||||
margin-bottom: 10px;
|
||||
|
@ -341,10 +335,6 @@ $initialLineBackground: #f0f0f0;
|
|||
|
||||
// accounting "T"
|
||||
td:nth-child(6) { border-left: $accountingBorder; }
|
||||
tr.initial_line > td {
|
||||
&:nth-child(5) { border-top: $accountingBorder; }
|
||||
&:nth-child(6) { border-top: $accountingBorder; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ openerp.account = function (instance) {
|
|||
// We'll need to get the code of an account selected in a many2one (whose value is the id)
|
||||
this.map_account_id_code = {};
|
||||
// The same move line cannot be selected for multiple resolutions
|
||||
this.excluded_move_lines_ids = {};
|
||||
this.excluded_move_lines_ids = [];
|
||||
// Description of the fields to initialize in the "create new line" form
|
||||
// NB : for presets to work correctly, a field id must be the same string as a preset field
|
||||
this.create_form_fields = {
|
||||
|
@ -171,7 +171,7 @@ openerp.account = function (instance) {
|
|||
deferred_promises.push(self.model_bank_statement
|
||||
.call("get_format_currency_js_function", [self.statement_id])
|
||||
.then(function(data){
|
||||
self.formatCurrency = new Function("amount", data);
|
||||
self.formatCurrency = new Function("amount, currency_id", data);
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -245,7 +245,7 @@ openerp.account = function (instance) {
|
|||
|
||||
keyboardShortcutsHandler: function(e) {
|
||||
var self = this;
|
||||
if (e.which === 13 && (e.ctrlKey || e.metaKey)) {
|
||||
if ((e.which === 13 || e.which === 10) && (e.ctrlKey || e.metaKey)) {
|
||||
$.each(self.getChildren(), function(i, o){
|
||||
if (o.is_valid && o.persistAndDestroy()) {
|
||||
self.lines_reconciled_with_ctrl_enter++;
|
||||
|
@ -253,59 +253,34 @@ openerp.account = function (instance) {
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Adds move line ids to the list of move lines not to fetch for a given partner
|
||||
// This is required because the same move line cannot be selected for multiple reconciliation
|
||||
excludeMoveLines: function(source_child, partner_id, line_ids) {
|
||||
|
||||
excludeMoveLines: function(line_ids) {
|
||||
var self = this;
|
||||
|
||||
var excluded_ids = this.excluded_move_lines_ids[partner_id];
|
||||
var excluded_move_lines_changed = false;
|
||||
_.each(line_ids, function(line_id){
|
||||
if (excluded_ids.indexOf(line_id) === -1) {
|
||||
excluded_ids.push(line_id);
|
||||
excluded_move_lines_changed = true;
|
||||
line_id = parseInt(line_id);
|
||||
if (self.excluded_move_lines_ids.indexOf(line_id) === -1) {
|
||||
self.excluded_move_lines_ids.push(line_id);
|
||||
}
|
||||
});
|
||||
if (! excluded_move_lines_changed)
|
||||
return;
|
||||
|
||||
// Function that finds if an array of line objects contains at least a line identified by its id
|
||||
var contains_lines = function(lines_array, line_ids) {
|
||||
for (var i = 0; i < lines_array.length; i++)
|
||||
for (var j = 0; j < line_ids.length; j++)
|
||||
if (lines_array[i].id === line_ids[j])
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
// Update children if needed
|
||||
//update all children view
|
||||
_.each(self.getChildren(), function(child){
|
||||
if (child.partner_id === partner_id && child !== source_child) {
|
||||
if (contains_lines(child.get("mv_lines_selected"), line_ids)) {
|
||||
child.set("mv_lines_selected", _.filter(child.get("mv_lines_selected"), function(o){ return line_ids.indexOf(o.id) === -1 }));
|
||||
} else if (contains_lines(child.mv_lines_deselected, line_ids)) {
|
||||
child.mv_lines_deselected = _.filter(child.mv_lines_deselected, function(o){ return line_ids.indexOf(o.id) === -1 });
|
||||
child.updateMatches();
|
||||
} else if (contains_lines(child.get("mv_lines"), line_ids)) {
|
||||
child.updateMatches();
|
||||
}
|
||||
}
|
||||
child.render();
|
||||
});
|
||||
},
|
||||
|
||||
unexcludeMoveLines: function(source_child, partner_id, line_ids) {
|
||||
|
||||
unexcludeMoveLines: function(line_ids) {
|
||||
var self = this;
|
||||
|
||||
var initial_excluded_lines_num = this.excluded_move_lines_ids[partner_id].length;
|
||||
this.excluded_move_lines_ids[partner_id] = _.difference(this.excluded_move_lines_ids[partner_id], line_ids);
|
||||
if (this.excluded_move_lines_ids[partner_id].length === initial_excluded_lines_num)
|
||||
return;
|
||||
|
||||
// Update children if needed
|
||||
var index = -1;
|
||||
_.each(line_ids, function(line_id){
|
||||
line_id = parseInt(line_id);
|
||||
index = self.excluded_move_lines_ids.indexOf(line_id);
|
||||
if (index > -1) {
|
||||
self.excluded_move_lines_ids.splice(index,1);
|
||||
}
|
||||
});
|
||||
//update all children view
|
||||
_.each(self.getChildren(), function(child){
|
||||
if (child.partner_id === partner_id && child !== source_child && (child.get("mode") === "match" || child.$el.hasClass("no_match")))
|
||||
child.updateMatches();
|
||||
child.render();
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -490,9 +465,7 @@ openerp.account = function (instance) {
|
|||
|
||||
// Exclude selected move lines
|
||||
var selected_line_ids = _(context.reconciliation_proposition).map(function(o){ return o.id });
|
||||
if (this.getParent().excluded_move_lines_ids[this.partner_id] === undefined)
|
||||
this.getParent().excluded_move_lines_ids[this.partner_id] = [];
|
||||
this.getParent().excludeMoveLines(this, this.partner_id, selected_line_ids);
|
||||
this.getParent().excludeMoveLines(selected_line_ids);
|
||||
} else {
|
||||
this.set("mv_lines_selected", []);
|
||||
this.st_line = undefined;
|
||||
|
@ -513,7 +486,6 @@ openerp.account = function (instance) {
|
|||
this.presets = this.getParent().presets;
|
||||
this.is_valid = true;
|
||||
this.is_consistent = true; // Used to prevent bad server requests
|
||||
this.total_move_lines_num = undefined; // Used for pagers
|
||||
this.filter = "";
|
||||
|
||||
this.set("balance", undefined); // Debit is +, credit is -
|
||||
|
@ -525,12 +497,14 @@ openerp.account = function (instance) {
|
|||
// NB : mv_lines represent the counterpart that will be created to reconcile existing move lines, so debit and credit are inverted
|
||||
this.set("mv_lines", []);
|
||||
this.on("change:mv_lines", this, this.mvLinesChanged);
|
||||
this.mv_lines_deselected = []; // deselected lines are displayed on top of the match table
|
||||
this.on("change:mv_lines_selected", this, this.mvLinesSelectedChanged);
|
||||
this.set("lines_created", []);
|
||||
this.set("line_created_being_edited", [{'id': 0}]);
|
||||
this.on("change:lines_created", this, this.createdLinesChanged);
|
||||
this.on("change:line_created_being_edited", this, this.createdLinesChanged);
|
||||
|
||||
//all lines associated to current reconciliation
|
||||
this.propositions_lines = undefined;
|
||||
},
|
||||
|
||||
start: function() {
|
||||
|
@ -553,9 +527,6 @@ openerp.account = function (instance) {
|
|||
self.st_line = data;
|
||||
self.decorateStatementLine(self.st_line);
|
||||
self.partner_id = data.partner_id;
|
||||
if (self.getParent().excluded_move_lines_ids[self.partner_id] === undefined)
|
||||
self.getParent().excluded_move_lines_ids[self.partner_id] = [];
|
||||
// load and display move lines
|
||||
$.when(self.loadReconciliationProposition()).then(function(){
|
||||
deferred_fetch_data.resolve();
|
||||
});
|
||||
|
@ -566,6 +537,15 @@ openerp.account = function (instance) {
|
|||
|
||||
// Display the widget
|
||||
return $.when(deferred_fetch_data).then(function(){
|
||||
//load all lines that can be usefull for counterparts
|
||||
var deferred_total_move_lines_num = self.model_bank_statement_line
|
||||
.call("get_move_lines_counterparts_id", [self.st_line.id, []])
|
||||
.then(function(lines){
|
||||
_(lines).each(self.decorateMoveLine.bind(self));
|
||||
self.propositions_lines = lines;
|
||||
});
|
||||
return deferred_total_move_lines_num;
|
||||
}).then(function(){
|
||||
// Render template
|
||||
var presets_array = [];
|
||||
for (var id in self.presets)
|
||||
|
@ -577,10 +557,9 @@ openerp.account = function (instance) {
|
|||
self.$(".match").slideUp(0);
|
||||
self.$(".create").slideUp(0);
|
||||
if (self.st_line.no_match) self.$el.addClass("no_match");
|
||||
if (self.context.mode !== "match") self.updateMatches();
|
||||
if (self.context.mode !== "match") self.render();
|
||||
self.bindPopoverTo(self.$(".line_info_button"));
|
||||
self.createFormWidgets();
|
||||
|
||||
// Special case hack : no identified partner
|
||||
if (self.st_line.has_no_partner) {
|
||||
self.$el.css("opacity", "0");
|
||||
|
@ -623,7 +602,7 @@ openerp.account = function (instance) {
|
|||
_.each(self.getChildren(), function(o){ o.destroy() });
|
||||
self.is_consistent = false;
|
||||
return $.when(self.$el.animate({opacity: 0}, self.animation_speed)).then(function() {
|
||||
self.getParent().unexcludeMoveLines(self, self.partner_id, _.map(self.get("mv_lines_selected"), function(o){ return o.id }));
|
||||
self.getParent().unexcludeMoveLines(_.map(self.get("mv_lines_selected"), function(o){ return o.id }));
|
||||
$.each(self.$(".bootstrap_popover"), function(){ $(this).popover('destroy') });
|
||||
self.$el.empty();
|
||||
self.$el.removeClass("no_partner");
|
||||
|
@ -637,7 +616,6 @@ openerp.account = function (instance) {
|
|||
self.set("pager_index", 0, {silent: true});
|
||||
self.set("mv_lines", [], {silent: true});
|
||||
self.set("mv_lines_selected", [], {silent: true});
|
||||
self.mv_lines_deselected = [];
|
||||
self.set("lines_created", [], {silent: true});
|
||||
self.set("line_created_being_edited", [{'id': 0}], {silent: true});
|
||||
// Rebirth
|
||||
|
@ -789,6 +767,9 @@ openerp.account = function (instance) {
|
|||
line.q_amount = (line.debit !== 0 ? "- "+line.q_debit : "") + (line.credit !== 0 ? line.q_credit : "");
|
||||
line.q_popover = QWeb.render("bank_statement_reconciliation_move_line_details", {line: line});
|
||||
line.q_label = line.name;
|
||||
if (line.has_no_partner){
|
||||
line.q_label = line.partner_name + ': ' +line.q_label;
|
||||
}
|
||||
|
||||
// WARNING : pretty much of a ugly hack
|
||||
// The value of account_move.ref is either the move's communication or it's name without the slashes
|
||||
|
@ -833,68 +814,35 @@ openerp.account = function (instance) {
|
|||
if (e.currentTarget.dataset.selected === "true") self.deselectMoveLine(e.currentTarget);
|
||||
else self.selectMoveLine(e.currentTarget);
|
||||
},
|
||||
|
||||
// Takes a move line from the match view and adds it to the mv_lines_selected array
|
||||
|
||||
selectMoveLine: function(mv_line) {
|
||||
var self = this;
|
||||
var line_id = mv_line.dataset.lineid;
|
||||
|
||||
// find the line in mv_lines or mv_lines_deselected
|
||||
var line = _.find(self.get("mv_lines"), function(o){ return o.id == line_id });
|
||||
if (! line) {
|
||||
line = _.find(self.mv_lines_deselected, function(o){ return o.id == line_id });
|
||||
self.mv_lines_deselected = _.filter(self.mv_lines_deselected, function(o) { return o.id != line_id });
|
||||
}
|
||||
// If no line found, the view is probably not up to date to the model (asynchronous fun)
|
||||
if (! line) return;
|
||||
|
||||
// Warn the user if he's selecting lines from both a payable and a receivable account
|
||||
var last_selected_line = _.last(self.get("mv_lines_selected"));
|
||||
if (last_selected_line && last_selected_line.account_type != line.account_type) {
|
||||
// TODO : web client API
|
||||
alert(_.str.sprintf(_t("You are selecting transactions from both a payable and a receivable account.\n\nIn order to proceed, you first need to deselect the %s transactions."), last_selected_line.account_type));
|
||||
return;
|
||||
}
|
||||
|
||||
var line = _.find(self.propositions_lines, function(o){ return o.id == line_id});
|
||||
$(mv_line).attr('data-selected','true');
|
||||
self.getParent().excludeMoveLines([line_id]);
|
||||
self.set("mv_lines_selected", self.get("mv_lines_selected").concat(line));
|
||||
},
|
||||
|
||||
// Removes a move line from the mv_lines_selected array
|
||||
|
||||
deselectMoveLine: function(mv_line) {
|
||||
var self = this;
|
||||
var line_id = mv_line.dataset.lineid;
|
||||
var line = _.find(self.get("mv_lines_selected"), function(o) { return o.id == line_id });
|
||||
// If no line found, the view is probably not up to date to the model (asynchronous fun)
|
||||
if (! line) return;
|
||||
|
||||
// add the line to mv_lines_deselected and remove it from mv_lines_selected
|
||||
self.mv_lines_deselected.unshift(line);
|
||||
var mv_lines_selected = _.filter(self.get("mv_lines_selected"), function(o) { return o.id != line_id });
|
||||
|
||||
// remove partial reconciliation stuff if necessary
|
||||
if (line.partial_reconcile === true) self.unpartialReconcileLine(line);
|
||||
if (line.propose_partial_reconcile === true) line.propose_partial_reconcile = false;
|
||||
|
||||
self.$el.removeClass("no_match");
|
||||
self.set("mode", "match");
|
||||
self.set("mv_lines_selected", mv_lines_selected);
|
||||
var line = _.find(self.propositions_lines, function(o){ return o.id == line_id});
|
||||
$(mv_line).attr('data-selected','false');
|
||||
self.getParent().unexcludeMoveLines([line_id]);
|
||||
self.set("mv_lines_selected",_.filter(self.get("mv_lines_selected"), function(o) { return o.id != line_id }));
|
||||
},
|
||||
|
||||
|
||||
/** Matches pagination */
|
||||
|
||||
pagerControlLeftHandler: function() {
|
||||
var self = this;
|
||||
if (self.$(".pager_control_left").hasClass("disabled")) { return; /* shouldn't happen, anyway*/ }
|
||||
if (self.total_move_lines_num < 0) { return; }
|
||||
self.set("pager_index", self.get("pager_index")-1 );
|
||||
},
|
||||
|
||||
pagerControlRightHandler: function() {
|
||||
var self = this;
|
||||
var new_index = self.get("pager_index")+1;
|
||||
if (self.$(".pager_control_right").hasClass("disabled")) { return; /* shouldn't happen, anyway*/ }
|
||||
if ((new_index * self.max_move_lines_displayed) >= self.total_move_lines_num) { return; }
|
||||
self.set("pager_index", new_index );
|
||||
},
|
||||
|
||||
|
@ -902,11 +850,9 @@ openerp.account = function (instance) {
|
|||
var self = this;
|
||||
self.set("pager_index", 0);
|
||||
self.filter = self.$(".filter").val();
|
||||
window.clearTimeout(self.apply_filter_timeout);
|
||||
self.apply_filter_timeout = window.setTimeout(self.proxy('updateMatches'), 200);
|
||||
self.render();
|
||||
},
|
||||
|
||||
|
||||
/** Creating */
|
||||
|
||||
initializeCreateForm: function() {
|
||||
|
@ -981,6 +927,7 @@ openerp.account = function (instance) {
|
|||
lineOpenBalanceClickHandler: function() {
|
||||
var self = this;
|
||||
if (self.get("mode") === "create") {
|
||||
self.addLineBeingEdited();
|
||||
self.set("mode", "match");
|
||||
} else {
|
||||
self.set("mode", "create");
|
||||
|
@ -1037,19 +984,16 @@ openerp.account = function (instance) {
|
|||
table.empty();
|
||||
var slice_start = self.get("pager_index") * self.max_move_lines_displayed;
|
||||
var slice_end = (self.get("pager_index")+1) * self.max_move_lines_displayed;
|
||||
_( _.filter(self.mv_lines_deselected, function(o){
|
||||
return o.name.indexOf(self.filter) !== -1 || o.ref.indexOf(self.filter) !== -1 })
|
||||
.slice(slice_start, slice_end)).each(function(line){
|
||||
var $line = $(QWeb.render("bank_statement_reconciliation_move_line", {line: line, selected: false}));
|
||||
self.bindPopoverTo($line.find(".line_info_button"));
|
||||
table.append($line);
|
||||
nothing_displayed = false;
|
||||
});
|
||||
|
||||
var visible = 0
|
||||
_(self.get("mv_lines")).each(function(line){
|
||||
var $line = $(QWeb.render("bank_statement_reconciliation_move_line", {line: line, selected: false}));
|
||||
self.bindPopoverTo($line.find(".line_info_button"));
|
||||
table.append($line);
|
||||
nothing_displayed = false;
|
||||
if (visible >= slice_start && visible < slice_end) {
|
||||
var $line = $(QWeb.render("bank_statement_reconciliation_move_line", {line: line, selected: false}));
|
||||
self.bindPopoverTo($line.find(".line_info_button"));
|
||||
table.append($line);
|
||||
nothing_displayed = false;
|
||||
}
|
||||
visible = visible + 1;
|
||||
});
|
||||
if (nothing_displayed)
|
||||
table.append(QWeb.render("filter_no_match", {filter_str: self.filter}));
|
||||
|
@ -1057,12 +1001,11 @@ openerp.account = function (instance) {
|
|||
|
||||
updatePagerControls: function() {
|
||||
var self = this;
|
||||
|
||||
if (self.get("pager_index") === 0)
|
||||
self.$(".pager_control_left").addClass("disabled");
|
||||
else
|
||||
self.$(".pager_control_left").removeClass("disabled");
|
||||
if (self.total_move_lines_num <= ((self.get("pager_index")+1) * self.max_move_lines_displayed))
|
||||
if (self.get('mv_lines').length <= ((self.get("pager_index")+1) * self.max_move_lines_displayed))
|
||||
self.$(".pager_control_right").addClass("disabled");
|
||||
else
|
||||
self.$(".pager_control_right").removeClass("disabled");
|
||||
|
@ -1075,7 +1018,7 @@ openerp.account = function (instance) {
|
|||
balanceChanged: function() {
|
||||
var self = this;
|
||||
var balance = self.get("balance");
|
||||
|
||||
self.$(".tbody_open_balance").empty();
|
||||
// Special case hack : no identified partner
|
||||
if (self.st_line.has_no_partner) {
|
||||
if (Math.abs(balance).toFixed(3) === "0.000") {
|
||||
|
@ -1088,19 +1031,23 @@ openerp.account = function (instance) {
|
|||
self.$(".button_ok").attr("disabled", "disabled");
|
||||
self.$(".button_ok").text("OK");
|
||||
self.is_valid = false;
|
||||
var debit = (balance > 0 ? self.formatCurrency(balance, self.st_line.currency_id) : "");
|
||||
var credit = (balance < 0 ? self.formatCurrency(-1*balance, self.st_line.currency_id) : "");
|
||||
var $line = $(QWeb.render("bank_statement_reconciliation_line_open_balance", {debit: debit, credit: credit, account_code: self.map_account_id_code[self.st_line.open_balance_account_id]}));
|
||||
$line.find('.js_open_balance')[0].innerHTML = "Choose counterpart";
|
||||
self.$(".tbody_open_balance").append($line);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
self.$(".tbody_open_balance").empty();
|
||||
if (Math.abs(balance).toFixed(3) === "0.000") {
|
||||
self.$(".button_ok").addClass("oe_highlight");
|
||||
self.$(".button_ok").text("OK");
|
||||
} else {
|
||||
self.$(".button_ok").removeClass("oe_highlight");
|
||||
self.$(".button_ok").text("Keep open");
|
||||
var debit = (balance > 0 ? self.formatCurrency(balance) : "");
|
||||
var credit = (balance < 0 ? self.formatCurrency(-1*balance) : "");
|
||||
var debit = (balance > 0 ? self.formatCurrency(balance, self.st_line.currency_id) : "");
|
||||
var credit = (balance < 0 ? self.formatCurrency(-1*balance, self.st_line.currency_id) : "");
|
||||
var $line = $(QWeb.render("bank_statement_reconciliation_line_open_balance", {debit: debit, credit: credit, account_code: self.map_account_id_code[self.st_line.open_balance_account_id]}));
|
||||
self.$(".tbody_open_balance").append($line);
|
||||
}
|
||||
|
@ -1111,21 +1058,15 @@ openerp.account = function (instance) {
|
|||
|
||||
self.$(".action_pane.active").removeClass("active");
|
||||
|
||||
// Special case hack : if no_partner, either inactive or create
|
||||
// Special case hack : if no_partner and mode == inactive
|
||||
if (self.st_line.has_no_partner) {
|
||||
if (self.get("mode") === "inactive") {
|
||||
self.$(".match").slideUp(self.animation_speed);
|
||||
self.$(".create").slideUp(self.animation_speed);
|
||||
self.$(".toggle_match").removeClass("visible_toggle");
|
||||
self.el.dataset.mode = "inactive";
|
||||
} else {
|
||||
self.initializeCreateForm();
|
||||
self.$(".match").slideUp(self.animation_speed);
|
||||
self.$(".create").slideDown(self.animation_speed);
|
||||
self.$(".toggle_match").addClass("visible_toggle");
|
||||
self.el.dataset.mode = "create";
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (self.get("mode") === "inactive") {
|
||||
|
@ -1134,7 +1075,7 @@ openerp.account = function (instance) {
|
|||
self.el.dataset.mode = "inactive";
|
||||
|
||||
} else if (self.get("mode") === "match") {
|
||||
return $.when(self.updateMatches()).then(function() {
|
||||
return $.when(self.render()).then(function() {
|
||||
if (self.$el.hasClass("no_match")) {
|
||||
self.set("mode", "inactive");
|
||||
return;
|
||||
|
@ -1154,18 +1095,14 @@ openerp.account = function (instance) {
|
|||
|
||||
pagerChanged: function() {
|
||||
var self = this;
|
||||
self.updateMatches();
|
||||
self.render();
|
||||
},
|
||||
|
||||
mvLinesChanged: function() {
|
||||
var self = this;
|
||||
// If pager_index is out of range, set it to display the last page
|
||||
if (self.get("pager_index") !== 0 && self.total_move_lines_num <= (self.get("pager_index") * self.max_move_lines_displayed)) {
|
||||
self.set("pager_index", Math.ceil(self.total_move_lines_num/self.max_move_lines_displayed)-1);
|
||||
}
|
||||
|
||||
// If there is no match to display, disable match view and pass in mode inactive
|
||||
if (self.total_move_lines_num + self.mv_lines_deselected.length === 0 && self.filter === "") {
|
||||
if (self.get("mv_lines").length === 0 && self.filter === "") {
|
||||
self.$el.addClass("no_match");
|
||||
if (self.get("mode") === "match") {
|
||||
self.set("mode", "inactive");
|
||||
|
@ -1184,13 +1121,11 @@ openerp.account = function (instance) {
|
|||
var added_lines_ids = _.map(_.difference(val.newValue, val.oldValue), function(o){ return o.id });
|
||||
var removed_lines_ids = _.map(_.difference(val.oldValue, val.newValue), function(o){ return o.id });
|
||||
|
||||
self.getParent().excludeMoveLines(self, self.partner_id, added_lines_ids);
|
||||
self.getParent().unexcludeMoveLines(self, self.partner_id, removed_lines_ids);
|
||||
self.getParent().excludeMoveLines(added_lines_ids);
|
||||
self.getParent().unexcludeMoveLines(removed_lines_ids);
|
||||
|
||||
$.when(self.updateMatches()).then(function(){
|
||||
self.updateAccountingViewMatchedLines();
|
||||
self.updateBalance();
|
||||
});
|
||||
self.updateAccountingViewMatchedLines();
|
||||
self.updateBalance();
|
||||
},
|
||||
|
||||
// Generic function for updating the line_created_being_edited
|
||||
|
@ -1198,6 +1133,8 @@ openerp.account = function (instance) {
|
|||
var self = this;
|
||||
var line_created_being_edited = self.get("line_created_being_edited");
|
||||
line_created_being_edited[0][elt.corresponding_property] = val.newValue;
|
||||
|
||||
line_created_being_edited[0].currency_id = self.st_line.currency_id;
|
||||
|
||||
// Specific cases
|
||||
if (elt === self.account_id_field)
|
||||
|
@ -1215,7 +1152,7 @@ openerp.account = function (instance) {
|
|||
var tax = data.taxes[0];
|
||||
var tax_account_id = (amount > 0 ? tax.account_collected_id : tax.account_paid_id)
|
||||
line_created_being_edited[0].amount = (data.total.toFixed(3) === amount.toFixed(3) ? amount : data.total);
|
||||
line_created_being_edited[1] = {id: line_created_being_edited[0].id, account_id: tax_account_id, account_num: self.map_account_id_code[tax_account_id], label: tax.name, amount: tax.amount, no_remove_action: true};
|
||||
line_created_being_edited[1] = {id: line_created_being_edited[0].id, account_id: tax_account_id, account_num: self.map_account_id_code[tax_account_id], label: tax.name, amount: tax.amount, no_remove_action: true, currency_id: self.st_line.currency_id};
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
@ -1228,10 +1165,9 @@ openerp.account = function (instance) {
|
|||
$.when(deferred_tax).then(function(){
|
||||
// Format amounts
|
||||
if (line_created_being_edited[0].amount)
|
||||
line_created_being_edited[0].amount_str = self.formatCurrency(Math.abs(line_created_being_edited[0].amount));
|
||||
line_created_being_edited[0].amount_str = self.formatCurrency(Math.abs(line_created_being_edited[0].amount), line_created_being_edited[0].currency_id);
|
||||
if (line_created_being_edited[1] && line_created_being_edited[1].amount)
|
||||
line_created_being_edited[1].amount_str = self.formatCurrency(Math.abs(line_created_being_edited[1].amount));
|
||||
|
||||
line_created_being_edited[1].amount_str = self.formatCurrency(Math.abs(line_created_being_edited[1].amount), line_created_being_edited[0].currency_id);
|
||||
self.set("line_created_being_edited", line_created_being_edited);
|
||||
self.createdLinesChanged(); // TODO For some reason, previous line doesn't trigger change handler
|
||||
});
|
||||
|
@ -1268,10 +1204,10 @@ openerp.account = function (instance) {
|
|||
line.initial_amount = line.debit !== 0 ? line.debit : -1 * line.credit;
|
||||
if (balance < 0) {
|
||||
line.debit -= balance;
|
||||
line.debit_str = self.formatCurrency(line.debit);
|
||||
line.debit_str = self.formatCurrency(line.debit, self.st_line.currency_id);
|
||||
} else {
|
||||
line.credit -= balance;
|
||||
line.credit_str = self.formatCurrency(line.credit);
|
||||
line.credit_str = self.formatCurrency(line.credit, self.st_line.currency_id);
|
||||
}
|
||||
line.propose_partial_reconcile = false;
|
||||
line.partial_reconcile = true;
|
||||
|
@ -1291,12 +1227,13 @@ openerp.account = function (instance) {
|
|||
},
|
||||
|
||||
unpartialReconcileLine: function(line) {
|
||||
var self = this;
|
||||
if (line.initial_amount > 0) {
|
||||
line.debit = line.initial_amount;
|
||||
line.debit_str = this.formatCurrency(line.debit);
|
||||
line.debit_str = self.formatCurrency(line.debit, self.st_line.currency_id);
|
||||
} else {
|
||||
line.credit = -1 * line.initial_amount;
|
||||
line.credit_str = this.formatCurrency(line.credit);
|
||||
line.credit_str = self.formatCurrency(line.credit, self.st_line.currency_id);
|
||||
}
|
||||
line.propose_partial_reconcile = true;
|
||||
line.partial_reconcile = false;
|
||||
|
@ -1335,48 +1272,23 @@ openerp.account = function (instance) {
|
|||
loadReconciliationProposition: function() {
|
||||
var self = this;
|
||||
return self.model_bank_statement_line
|
||||
.call("get_reconciliation_proposition", [self.st_line.id, self.getParent().excluded_move_lines_ids[self.partner_id]])
|
||||
.call("get_reconciliation_proposition", [self.st_line.id, self.getParent().excluded_move_lines_ids])
|
||||
.then(function (lines) {
|
||||
_(lines).each(self.decorateMoveLine.bind(self));
|
||||
self.set("mv_lines_selected", self.get("mv_lines_selected").concat(lines));
|
||||
});
|
||||
},
|
||||
|
||||
// Loads move lines according to the widget's state
|
||||
updateMatches: function() {
|
||||
|
||||
render: function() {
|
||||
var self = this;
|
||||
var deselected_lines_num = self.mv_lines_deselected.length;
|
||||
var move_lines = {};
|
||||
var move_lines_num = 0;
|
||||
var offset = self.get("pager_index") * self.max_move_lines_displayed - deselected_lines_num;
|
||||
if (offset < 0) offset = 0;
|
||||
var limit = (self.get("pager_index")+1) * self.max_move_lines_displayed - deselected_lines_num;
|
||||
if (limit > self.max_move_lines_displayed) limit = self.max_move_lines_displayed;
|
||||
var excluded_ids = _.collect(self.get("mv_lines_selected").concat(self.mv_lines_deselected), function(o){ return o.id });
|
||||
excluded_ids = excluded_ids.concat(self.getParent().excluded_move_lines_ids[self.partner_id]);
|
||||
|
||||
var deferred_move_lines;
|
||||
if (limit > 0) {
|
||||
// Load move lines
|
||||
deferred_move_lines = self.model_bank_statement_line
|
||||
.call("get_move_lines_counterparts", [self.st_line.id, excluded_ids, self.filter, offset, limit])
|
||||
.then(function (lines) {
|
||||
_(lines).each(self.decorateMoveLine.bind(self));
|
||||
move_lines = lines;
|
||||
});
|
||||
}
|
||||
|
||||
// Fetch the number of move lines corresponding to this statement line and this filter
|
||||
var deferred_total_move_lines_num = self.model_bank_statement_line
|
||||
.call("get_move_lines_counterparts", [self.st_line.id, excluded_ids, self.filter, offset, limit, true])
|
||||
.then(function(num){
|
||||
move_lines_num = num;
|
||||
});
|
||||
|
||||
return $.when(deferred_move_lines, deferred_total_move_lines_num).then(function(){
|
||||
self.total_move_lines_num = move_lines_num + deselected_lines_num;
|
||||
self.set("mv_lines", move_lines);
|
||||
var lines_to_show = [];
|
||||
_.each(self.propositions_lines, function(line){
|
||||
var filter = (line.q_label.toLowerCase().indexOf(self.filter.toLowerCase()) > -1 || line.account_code.toLowerCase().indexOf(self.filter.toLowerCase()) > -1);
|
||||
if (self.getParent().excluded_move_lines_ids.indexOf(line.id) === -1 && filter) {
|
||||
lines_to_show.push(line);
|
||||
}
|
||||
});
|
||||
self.set("mv_lines", lines_to_show);
|
||||
},
|
||||
|
||||
// Changes the partner_id of the statement_line in the DB and reloads the widget
|
||||
|
@ -1436,8 +1348,6 @@ openerp.account = function (instance) {
|
|||
var self = this;
|
||||
if (! self.is_consistent) return;
|
||||
|
||||
self.getParent().unexcludeMoveLines(self, self.partner_id, _.map(self.get("mv_lines_selected"), function(o){ return o.id }));
|
||||
|
||||
// Prepare data
|
||||
var mv_line_dicts = [];
|
||||
_.each(self.get("mv_lines_selected"), function(o) { mv_line_dicts.push(self.prepareSelectedMoveLineForPersisting(o)) });
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
<td><span class="glyphicon glyphicon-add-remove"></span></td>
|
||||
<td><t t-esc="line.account_code"/></td>
|
||||
<td><t t-esc="line.q_due_date"/></td>
|
||||
<td><t t-esc="line.q_label"/></td>
|
||||
<td class="js_qlabel"><t t-esc="line.q_label"/></td>
|
||||
|
||||
<td><t t-if="line.debit !== 0">
|
||||
<t t-if="line.propose_partial_reconcile" t-call="icon_do_partial_reconciliation"></t>
|
||||
|
@ -185,7 +185,7 @@
|
|||
<td><span class="toggle_create glyphicon glyphicon-play"></span></td>
|
||||
<td><t t-esc="account_code"/></td>
|
||||
<td></td>
|
||||
<td>Open balance</td>
|
||||
<td class="js_open_balance">Open balance</td>
|
||||
<td><t t-esc="debit"/></td>
|
||||
<td><t t-esc="credit"/></td>
|
||||
<td></td>
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
</tr>
|
||||
<tr t-foreach="get_lines_with_out_partner(data['form'])" t-as="not_partner">
|
||||
<td>
|
||||
<span t-esc="partner['name']"/>
|
||||
<span t-esc="not_partner['name']"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-esc="formatLang(not_partner['direction'], currency_obj=res_company.currency_id)"/>
|
||||
|
|
|
@ -36,11 +36,11 @@ class account_subscription_generate(osv.osv_memory):
|
|||
def action_generate(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
sub_line_obj = self.pool.get('account.subscription.line')
|
||||
moves_created=[]
|
||||
for data in self.read(cr, uid, ids, context=context):
|
||||
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['date'],))
|
||||
line_ids = map(lambda x: x[0], cr.fetchall())
|
||||
moves = self.pool.get('account.subscription.line').move_create(cr, uid, line_ids, context=context)
|
||||
line_ids = sub_line_obj.search(cr, uid, [('date', '<', data['date']), ('move_id', '=', False)], context=context)
|
||||
moves = sub_line_obj.move_create(cr, uid, line_ids, context=context)
|
||||
moves_created.extend(moves)
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', 'action_move_line_form')
|
||||
id = result and result[1] or False
|
||||
|
|
|
@ -22,7 +22,6 @@ from dateutil.relativedelta import relativedelta
|
|||
import datetime
|
||||
import logging
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
from openerp.osv.orm import intersect, except_orm
|
||||
|
@ -73,6 +72,7 @@ class account_analytic_invoice_line(osv.osv):
|
|||
|
||||
result = {}
|
||||
res = self.pool.get('product.product').browse(cr, uid, product, context=local_context)
|
||||
price = False
|
||||
if price_unit is not False:
|
||||
price = price_unit
|
||||
elif pricelist_id:
|
||||
|
@ -746,29 +746,32 @@ class account_analytic_account(osv.osv):
|
|||
contract_ids = ids
|
||||
else:
|
||||
contract_ids = self.search(cr, uid, [('recurring_next_date','<=', current_date), ('state','=', 'open'), ('recurring_invoices','=', True), ('type', '=', 'contract')])
|
||||
for contract in self.browse(cr, uid, contract_ids, context=context):
|
||||
try:
|
||||
invoice_values = self._prepare_invoice(cr, uid, contract, context=context)
|
||||
invoice_ids.append(self.pool['account.invoice'].create(cr, uid, invoice_values, context=context))
|
||||
next_date = datetime.datetime.strptime(contract.recurring_next_date or current_date, "%Y-%m-%d")
|
||||
interval = contract.recurring_interval
|
||||
if contract.recurring_rule_type == 'daily':
|
||||
new_date = next_date+relativedelta(days=+interval)
|
||||
elif contract.recurring_rule_type == 'weekly':
|
||||
new_date = next_date+relativedelta(weeks=+interval)
|
||||
elif contract.recurring_rule_type == 'monthly':
|
||||
new_date = next_date+relativedelta(months=+interval)
|
||||
else:
|
||||
new_date = next_date+relativedelta(years=+interval)
|
||||
self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context)
|
||||
if automatic:
|
||||
cr.commit()
|
||||
except Exception:
|
||||
if automatic:
|
||||
cr.rollback()
|
||||
_logger.error(traceback.format_exc())
|
||||
else:
|
||||
raise
|
||||
if contract_ids:
|
||||
cr.execute('SELECT company_id, array_agg(id) as ids FROM account_analytic_account WHERE id IN %s GROUP BY company_id', (tuple(contract_ids),))
|
||||
for company_id, ids in cr.fetchall():
|
||||
for contract in self.browse(cr, uid, ids, context=dict(context, company_id=company_id, force_company=company_id)):
|
||||
try:
|
||||
invoice_values = self._prepare_invoice(cr, uid, contract, context=context)
|
||||
invoice_ids.append(self.pool['account.invoice'].create(cr, uid, invoice_values, context=context))
|
||||
next_date = datetime.datetime.strptime(contract.recurring_next_date or current_date, "%Y-%m-%d")
|
||||
interval = contract.recurring_interval
|
||||
if contract.recurring_rule_type == 'daily':
|
||||
new_date = next_date+relativedelta(days=+interval)
|
||||
elif contract.recurring_rule_type == 'weekly':
|
||||
new_date = next_date+relativedelta(weeks=+interval)
|
||||
elif contract.recurring_rule_type == 'monthly':
|
||||
new_date = next_date+relativedelta(months=+interval)
|
||||
else:
|
||||
new_date = next_date+relativedelta(years=+interval)
|
||||
self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context)
|
||||
if automatic:
|
||||
cr.commit()
|
||||
except Exception:
|
||||
if automatic:
|
||||
cr.rollback()
|
||||
_logger.exception('Fail to create recurring invoice for contract %s', contract.code)
|
||||
else:
|
||||
raise
|
||||
return invoice_ids
|
||||
|
||||
class account_analytic_account_summary_user(osv.osv):
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
<page string="Bill Information">
|
||||
<field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}">
|
||||
<tree string="Expense Lines" editable="bottom">
|
||||
<field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
|
||||
<field name="account_id" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
|
||||
<field name="name"/>
|
||||
<field name="amount"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
|
|
|
@ -74,7 +74,7 @@ class OAuthLogin(Home):
|
|||
state = dict(
|
||||
d=request.session.db,
|
||||
p=provider['id'],
|
||||
r=redirect,
|
||||
r=werkzeug.url_quote_plus(redirect),
|
||||
)
|
||||
token = request.params.get('token')
|
||||
if token:
|
||||
|
@ -143,7 +143,7 @@ class OAuthController(http.Controller):
|
|||
cr.commit()
|
||||
action = state.get('a')
|
||||
menu = state.get('m')
|
||||
redirect = state.get('r')
|
||||
redirect = werkzeug.url_unquote_plus(state['r']) if state.get('r') else False
|
||||
url = '/web'
|
||||
if redirect:
|
||||
url = redirect
|
||||
|
|
|
@ -1,22 +1,53 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
|
||||
from werkzeug.wrappers import BaseResponse as Response
|
||||
|
||||
import json
|
||||
|
||||
|
||||
class website_gengo(http.Controller):
|
||||
|
||||
def get_gengo_key(self, cr):
|
||||
icp = request.registry['ir.config_parameter']
|
||||
return icp.get_param(cr, SUPERUSER_ID, request.registry['base.gengo.translations'].GENGO_KEY, default="")
|
||||
|
||||
@http.route('/website/gengo_callback', type='http', auth='none')
|
||||
def gengo_callback(self,**post):
|
||||
def gengo_callback(self, **post):
|
||||
cr, uid, context = request.cr, openerp.SUPERUSER_ID, request.context
|
||||
translation_pool = request.registry['ir.translation']
|
||||
if post and post.get('job'):
|
||||
job = json.loads(post['job'])
|
||||
if post and post.get('job') and post.get('pgk'):
|
||||
if post.get('pgk') != self.get_gengo_key(cr):
|
||||
return Response("Bad authentication - 403/412", status=412)
|
||||
job = json.loads(post['job'], 'utf-8')
|
||||
tid = job.get('custom_data', False)
|
||||
if (job.get('status') == 'approved') and tid:
|
||||
term = translation_pool.browse(cr, uid, int(tid), context=context)
|
||||
if term.job_id <> job.get('job_id'):
|
||||
raise 'Error'
|
||||
vals = {'state': 'translated', 'value': job.get('body_tgt')}
|
||||
translation_pool.write(cr, uid, [int(tid)], vals, context=context)
|
||||
if term.src != job.get('body_src'):
|
||||
return Response("Text Altered - Not saved", status=100)
|
||||
domain = [
|
||||
'|',
|
||||
('id', "=", int(tid)),
|
||||
'&', '&', '&', '&', '&',
|
||||
('state', '=', term.state),
|
||||
('gengo_translation', '=', term.gengo_translation),
|
||||
('src', "=", term.src),
|
||||
('type', "=", term.type),
|
||||
('name', "=", term.name),
|
||||
('lang', "=", term.lang),
|
||||
#('order_id', "=", term.order_id),
|
||||
]
|
||||
|
||||
all_ir_tanslations = translation_pool.search(cr, uid, domain, context=context or {})
|
||||
|
||||
if all_ir_tanslations:
|
||||
vals = {'state': 'translated', 'value': job.get('body_tgt')}
|
||||
translation_pool.write(cr, uid, all_ir_tanslations, vals, context=context)
|
||||
return Response("OK", status=200)
|
||||
else:
|
||||
return Response("No terms found", status=104)
|
||||
return Response("Not saved", status=100)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<field name="interval_number">6</field>
|
||||
<field name="interval_type">hours</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field name="doall">0</field>
|
||||
<field eval="'base.gengo.translations'" name="model"></field>
|
||||
<field eval="'_sync_response'" name="function"/>
|
||||
<field eval="'(20,)'" name="args"/>
|
||||
|
@ -20,6 +21,7 @@
|
|||
<field name="interval_number">6</field>
|
||||
<field name="interval_type">hours</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field name="doall">0</field>
|
||||
<field eval="'base.gengo.translations'" name="model"></field>
|
||||
<field eval="'_sync_request'" name="function"/>
|
||||
<field eval="'(20,)'" name="args"/>
|
||||
|
|
|
@ -56,16 +56,18 @@ LANG_CODE_MAPPING = {
|
|||
'fi_FI': ('fi', 'Finnish')
|
||||
}
|
||||
|
||||
|
||||
class ir_translation(osv.Model):
|
||||
_name = "ir.translation"
|
||||
_inherit = "ir.translation"
|
||||
|
||||
_columns = {
|
||||
'gengo_comment': fields.text("Comments & Activity Linked to Gengo"),
|
||||
'job_id': fields.char('Gengo Job ID', size=32),
|
||||
'order_id': fields.char('Gengo Order ID', size=32),
|
||||
"gengo_translation": fields.selection([('machine', 'Translation By Machine'),
|
||||
('standard', 'Standard'),
|
||||
('pro', 'Pro'),
|
||||
('ultra', 'Ultra')], "Gengo Translation Service Level", help='You can select here the service level you want for an automatic translation using Gengo.'),
|
||||
('standard', 'Standard'),
|
||||
('pro', 'Pro'),
|
||||
('ultra', 'Ultra')], "Gengo Translation Service Level", help='You can select here the service level you want for an automatic translation using Gengo.'),
|
||||
}
|
||||
|
||||
def _get_all_supported_languages(self, cr, uid, context=None):
|
||||
|
@ -83,3 +85,19 @@ class ir_translation(osv.Model):
|
|||
|
||||
def _get_gengo_corresponding_language(cr, lang):
|
||||
return lang in LANG_CODE_MAPPING and LANG_CODE_MAPPING[lang][0] or lang
|
||||
|
||||
def _get_source_query(self, cr, uid, name, types, lang, source, res_id):
|
||||
query, params = super(ir_translation, self)._get_source_query(cr, uid, name, types, lang, source, res_id)
|
||||
|
||||
query += """
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN gengo_translation=%s then 10
|
||||
WHEN gengo_translation=%s then 20
|
||||
WHEN gengo_translation=%s then 30
|
||||
WHEN gengo_translation=%s then 40
|
||||
ELSE 0
|
||||
END DESC
|
||||
"""
|
||||
params += ('machine', 'standard', 'ultra', 'pro',)
|
||||
return (query, params)
|
||||
|
|
|
@ -19,12 +19,13 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import uuid
|
||||
import logging
|
||||
import re
|
||||
import time
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
from openerp import tools
|
||||
from openerp import tools, SUPERUSER_ID
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
@ -36,7 +37,9 @@ except ImportError:
|
|||
|
||||
GENGO_DEFAULT_LIMIT = 20
|
||||
|
||||
|
||||
class base_gengo_translations(osv.osv_memory):
|
||||
GENGO_KEY = "Gengo.UUID"
|
||||
|
||||
_name = 'base.gengo.translations'
|
||||
_columns = {
|
||||
|
@ -46,9 +49,20 @@ class base_gengo_translations(osv.osv_memory):
|
|||
'lang_id': fields.many2one('res.lang', 'Language', required=True),
|
||||
'sync_limit': fields.integer("No. of terms to sync"),
|
||||
}
|
||||
_defaults = {'sync_type' : 'both',
|
||||
'sync_limit' : 20
|
||||
}
|
||||
_defaults = {
|
||||
'sync_type': 'both',
|
||||
'sync_limit': 20
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
icp = self.pool['ir.config_parameter']
|
||||
if not icp.get_param(cr, SUPERUSER_ID, self.GENGO_KEY, default=None):
|
||||
icp.set_param(cr, SUPERUSER_ID, self.GENGO_KEY, str(uuid.uuid4()))
|
||||
|
||||
def get_gengo_key(self, cr):
|
||||
icp = self.pool['ir.config_parameter']
|
||||
return icp.get_param(cr, SUPERUSER_ID, self.GENGO_KEY, default="Undefined")
|
||||
|
||||
def gengo_authentication(self, cr, uid, context=None):
|
||||
'''
|
||||
This method tries to open a connection with Gengo. For that, it uses the Public and Private
|
||||
|
@ -113,48 +127,68 @@ class base_gengo_translations(osv.osv_memory):
|
|||
_logger.warning("%s", gengo)
|
||||
else:
|
||||
offset = 0
|
||||
all_translation_ids = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('job_id', "!=", False)], context=context)
|
||||
all_translation_ids = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('order_id', "!=", False)], context=context)
|
||||
while True:
|
||||
translation_ids = all_translation_ids[offset:offset + limit]
|
||||
offset += limit
|
||||
if not translation_ids:
|
||||
break
|
||||
|
||||
terms_progress = {
|
||||
'gengo_order_ids': set(),
|
||||
'ir_translation_ids': set(),
|
||||
}
|
||||
translation_terms = translation_pool.browse(cr, uid, translation_ids, context=context)
|
||||
gengo_job_id = [term.job_id for term in translation_terms]
|
||||
if gengo_job_id:
|
||||
gengo_ids = ','.join(gengo_job_id)
|
||||
for term in translation_terms:
|
||||
terms_progress['gengo_order_ids'].add(term.order_id)
|
||||
terms_progress['ir_translation_ids'].add(tools.ustr(term.id))
|
||||
|
||||
for order_id in terms_progress['gengo_order_ids']:
|
||||
order_response = gengo.getTranslationOrderJobs(id=order_id)
|
||||
jobs_approved = order_response.get('response', []).get('order', []).get('jobs_approved', [])
|
||||
gengo_ids = ','.join(jobs_approved)
|
||||
|
||||
if gengo_ids: # Need to check, because getTranslationJobBatch don't catch this case and so call the getTranslationJobs because no ids in url
|
||||
try:
|
||||
job_response = gengo.getTranslationJobBatch(id=gengo_ids)
|
||||
except:
|
||||
continue
|
||||
if job_response['opstat'] == 'ok':
|
||||
for job in job_response['response'].get('jobs', []):
|
||||
self._update_terms_job(cr, uid, job, context=context)
|
||||
if job.get('custom_data') in terms_progress['ir_translation_ids']:
|
||||
self._update_terms_job(cr, uid, job, context=context)
|
||||
return True
|
||||
|
||||
def _update_terms_job(self, cr, uid, job, context=None):
|
||||
translation_pool = self.pool.get('ir.translation')
|
||||
tid = int(job['custom_data'])
|
||||
vals = {}
|
||||
if job.get('job_id', False):
|
||||
vals['job_id'] = job['job_id']
|
||||
if job.get('status', False) in ('queued', 'available', 'pending', 'reviewable'):
|
||||
vals['state'] = 'inprogress'
|
||||
if job.get('status', False) in ('queued','available','pending','reviewable'):
|
||||
vals['state'] = 'inprogress'
|
||||
if job.get('body_tgt', False) and job.get('status', False)=='approved':
|
||||
if job.get('body_tgt', False) and job.get('status', False) == 'approved':
|
||||
vals['value'] = job['body_tgt']
|
||||
if job.get('status', False) in ('approved', 'canceled'):
|
||||
vals['state'] = 'translated'
|
||||
if vals:
|
||||
translation_pool.write(cr, uid, [tid], vals, context=context)
|
||||
|
||||
def _update_terms(self, cr, uid, response, context=None):
|
||||
def _update_terms(self, cr, uid, response, term_ids, context=None):
|
||||
"""
|
||||
Update the terms after their translation were requested to Gengo
|
||||
"""
|
||||
for jobs in response.get('jobs', []):
|
||||
translation_pool = self.pool.get('ir.translation')
|
||||
|
||||
vals = {
|
||||
'order_id': response.get('order_id', ''),
|
||||
'state': 'inprogress'
|
||||
}
|
||||
|
||||
translation_pool.write(cr, uid, term_ids, vals, context=context)
|
||||
jobs = response.get('jobs', [])
|
||||
if jobs:
|
||||
for t_id, res in jobs.items():
|
||||
self._update_terms_job(cr, uid, res, context=context)
|
||||
|
||||
return
|
||||
|
||||
def pack_jobs_request(self, cr, uid, term_ids, context=None):
|
||||
|
@ -164,7 +198,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
'term2.id': {...}
|
||||
}
|
||||
}'''
|
||||
|
||||
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
|
||||
translation_pool = self.pool.get('ir.translation')
|
||||
jobs = {}
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
|
@ -173,7 +207,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
if re.search(r"\w", term.src or ""):
|
||||
comment = user.company_id.gengo_comment or ''
|
||||
if term.gengo_comment:
|
||||
comment+='\n' + term.gengo_comment
|
||||
comment += '\n' + term.gengo_comment
|
||||
jobs[time.strftime('%Y%m%d%H%M%S') + '-' + str(term.id)] = {
|
||||
'type': 'text',
|
||||
'slug': 'Single :: English to ' + term.lang,
|
||||
|
@ -184,10 +218,9 @@ class base_gengo_translations(osv.osv_memory):
|
|||
'lc_tgt': translation_pool._get_gengo_corresponding_language(term.lang),
|
||||
'auto_approve': auto_approve,
|
||||
'comment': comment,
|
||||
'callback_url': self.pool.get('ir.config_parameter').get_param(cr, uid,'web.base.url') + '/website/gengo_callback'
|
||||
'callback_url': "%s/website/gengo_callback?pgk=%s&db=%s" % (base_url, self.get_gengo_key(cr), cr.dbname)
|
||||
}
|
||||
return {'jobs': jobs, 'as_group': 1}
|
||||
|
||||
return {'jobs': jobs, 'as_group': 0}
|
||||
|
||||
def _send_translation_terms(self, cr, uid, term_ids, context=None):
|
||||
"""
|
||||
|
@ -200,7 +233,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
if request['jobs']:
|
||||
result = gengo.postTranslationJobs(jobs=request)
|
||||
if result['opstat'] == 'ok':
|
||||
self._update_terms(cr, uid, result['response'], context=context)
|
||||
self._update_terms(cr, uid, result['response'], term_ids, context=context)
|
||||
else:
|
||||
_logger.error(gengo)
|
||||
return True
|
||||
|
@ -218,10 +251,10 @@ class base_gengo_translations(osv.osv_memory):
|
|||
context = {}
|
||||
language_pool = self.pool.get('res.lang')
|
||||
translation_pool = self.pool.get('ir.translation')
|
||||
domain = [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('job_id', "=", False)]
|
||||
domain = [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('order_id', "=", False)]
|
||||
if context.get('gengo_language', False):
|
||||
lc = language_pool.browse(cr, uid, context['gengo_language'], context=context).code
|
||||
domain.append( ('lang', '=', lc) )
|
||||
domain.append(('lang', '=', lc))
|
||||
|
||||
all_term_ids = translation_pool.search(cr, uid, domain, context=context)
|
||||
try:
|
||||
|
|
|
@ -43,7 +43,6 @@ If you need to manage your meetings, you should install the CRM module.
|
|||
'security/ir.model.access.csv',
|
||||
'security/calendar_security.xml',
|
||||
'calendar_view.xml',
|
||||
'contacts_view.xml',
|
||||
'calendar_data.xml',
|
||||
'views/calendar.xml',
|
||||
],
|
||||
|
|
|
@ -764,7 +764,6 @@ class calendar_event(osv.Model):
|
|||
res[meeting_id][field] = meeting.start_date if meeting.allday else meeting.start_datetime
|
||||
elif field == 'stop':
|
||||
res[meeting_id][field] = meeting.stop_date if meeting.allday else meeting.stop_datetime
|
||||
|
||||
return res
|
||||
|
||||
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_calendar_contacts" model="ir.ui.view">
|
||||
<field name="name">My Coworkers</field>
|
||||
<field name="model">calendar.contacts</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="contacts" editable="bottom">
|
||||
<field name="partner_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_calendar_contacts" model="ir.actions.act_window">
|
||||
<field name="name">Calendar Contacts</field>
|
||||
<field name="res_model">calendar.contacts</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="view_calendar_contacts" />
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click on "<b>create</b>" to select colleagues you want to see meetings.
|
||||
</p><p>
|
||||
Your colleagues will appear in the right list to see them in the calendar view. You will easily manage collaboration and meeting with them.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -72,3 +72,13 @@ span.no-wrap {
|
|||
.cal_tab {
|
||||
margin: 20 0 20 0;
|
||||
}
|
||||
.openerp .oe_remove_follower {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
line-height: 20px;
|
||||
color: #D3D3D3;
|
||||
}
|
||||
.openerp .oe_add_input_box > div > input{
|
||||
width: 200px;
|
||||
}
|
|
@ -1,9 +1,136 @@
|
|||
openerp.calendar = function(instance) {
|
||||
var _t = instance.web._t;
|
||||
var _t = instance.web._t,
|
||||
_lt = instance.web._lt;
|
||||
var QWeb = instance.web.qweb;
|
||||
|
||||
instance.calendar = {};
|
||||
|
||||
function reload_favorite_list(result) {
|
||||
var self = current = result;
|
||||
if (result.view) {
|
||||
self = result.view;
|
||||
}
|
||||
new instance.web.Model("res.users").query(["partner_id"]).filter([["id", "=",self.dataset.context.uid]]).first()
|
||||
.done(
|
||||
function(result) {
|
||||
var sidebar_items = {};
|
||||
var filter_value = result.partner_id[0];
|
||||
var filter_item = {
|
||||
value: filter_value,
|
||||
label: result.partner_id[1] + _lt(" [Me]"),
|
||||
color: self.get_color(filter_value),
|
||||
avatar_model: self.avatar_model,
|
||||
is_checked: true,
|
||||
is_remove: false,
|
||||
};
|
||||
|
||||
sidebar_items[0] = filter_item ;
|
||||
filter_item = {
|
||||
value: -1,
|
||||
label: _lt("Everybody's calendars"),
|
||||
color: self.get_color(-1),
|
||||
avatar_model: self.avatar_model,
|
||||
is_checked: false
|
||||
};
|
||||
sidebar_items[-1] = filter_item ;
|
||||
//Get my coworkers/contacts
|
||||
new instance.web.Model("calendar.contacts").query(["partner_id"]).filter([["user_id", "=",self.dataset.context.uid]]).all().then(function(result) {
|
||||
_.each(result, function(item) {
|
||||
filter_value = item.partner_id[0];
|
||||
filter_item = {
|
||||
value: filter_value,
|
||||
label: item.partner_id[1],
|
||||
color: self.get_color(filter_value),
|
||||
avatar_model: self.avatar_model,
|
||||
is_checked: true
|
||||
};
|
||||
sidebar_items[filter_value] = filter_item ;
|
||||
});
|
||||
self.all_filters = sidebar_items;
|
||||
self.now_filter_ids = $.map(self.all_filters, function(o) { return o.value; });
|
||||
|
||||
self.sidebar.filter.events_loaded(self.all_filters);
|
||||
self.sidebar.filter.set_filters();
|
||||
self.sidebar.filter.set_distroy_filters();
|
||||
self.sidebar.filter.addInputBox();
|
||||
self.sidebar.filter.destroy_filter();
|
||||
}).done(function () {
|
||||
self.$calendar.fullCalendar('refetchEvents');
|
||||
if (current.ir_model_m2o) {
|
||||
current.ir_model_m2o.set_value(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
instance.web_calendar.CalendarView.include({
|
||||
extraSideBar: function(){
|
||||
this._super();
|
||||
if (this.useContacts){
|
||||
new reload_favorite_list(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
instance.web_calendar.SidebarFilter.include({
|
||||
set_distroy_filters: function() {
|
||||
var self = this;
|
||||
// When mouse-enter the favorite list it will show the 'X' for removing partner from the favorite list.
|
||||
if (self.view.useContacts){
|
||||
self.$('.oe_calendar_all_responsibles').on('mouseenter mouseleave', function(e) {
|
||||
self.$('.oe_remove_follower').toggleClass('hidden', e.type == 'mouseleave');
|
||||
});
|
||||
}
|
||||
},
|
||||
addInputBox: function() {
|
||||
var self = this;
|
||||
if (this.dfm)
|
||||
return;
|
||||
this.dfm = new instance.web.form.DefaultFieldManager(self);
|
||||
this.dfm.extend_field_desc({
|
||||
partner_id: {
|
||||
relation: "res.partner",
|
||||
},
|
||||
});
|
||||
this.ir_model_m2o = new instance.web.form.FieldMany2One(self.dfm, {
|
||||
attrs: {
|
||||
class: 'oe_add_input_box',
|
||||
name: "partner_id",
|
||||
type: "many2one",
|
||||
options: '{"no_open": True}',
|
||||
placeholder: _t("Select Favorite Calendar"),
|
||||
},
|
||||
});
|
||||
this.ir_model_m2o.insertAfter($('div.oe_calendar_filter'));
|
||||
this.ir_model_m2o.on('change:value', self, function() {
|
||||
self.add_filter();
|
||||
});
|
||||
},
|
||||
add_filter: function() {
|
||||
var self = this;
|
||||
new instance.web.Model("res.users").query(["partner_id"]).filter([["id", "=",this.view.dataset.context.uid]]).first().done(function(result){
|
||||
$.map(self.ir_model_m2o.display_value, function(element,index) {
|
||||
if (result.partner_id[0] != index){
|
||||
self.ds_message = new instance.web.DataSetSearch(self, 'calendar.contacts');
|
||||
self.ds_message.call("create", [{'partner_id': index}]);
|
||||
}
|
||||
});
|
||||
});
|
||||
new reload_favorite_list(this);
|
||||
},
|
||||
destroy_filter: function(e) {
|
||||
var self= this;
|
||||
this.$(".oe_remove_follower").on('click', function(e) {
|
||||
self.ds_message = new instance.web.DataSetSearch(self, 'calendar.contacts');
|
||||
if (! confirm(_t("Do you really want to delete this filter from favorite?"))) { return false; }
|
||||
var id = $(e.currentTarget)[0].dataset.id;
|
||||
self.ds_message.call('search', [[['partner_id', '=', parseInt(id)]]]).then(function(record){
|
||||
return self.ds_message.unlink(record);
|
||||
}).done(function() {
|
||||
new reload_favorite_list(self);
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
instance.web.WebClient = instance.web.WebClient.extend({
|
||||
|
||||
|
@ -102,7 +229,7 @@ openerp.calendar = function(instance) {
|
|||
var self = this;
|
||||
var action_url = '';
|
||||
|
||||
action_url = _.str.sprintf('/?db=%s#id=%s&view_type=form&model=calendar.event', db, meeting_id);
|
||||
action_url = _.str.sprintf('/web?db=%s#id=%s&view_type=form&model=calendar.event', db, meeting_id);
|
||||
|
||||
var reload_page = function(){
|
||||
return location.replace(action_url);
|
||||
|
|
|
@ -73,4 +73,13 @@
|
|||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-extend="CalendarView.sidebar.responsible">
|
||||
<t t-jquery="span#color_filter" t-operation="after">
|
||||
<t t-if="(filters_value.value != -1) && (filters_value.is_remove != false)">
|
||||
<span class="oe_remove_follower oe_e hidden" title="Remove this favorite from the list" t-att-data-id="filters_value.value">X</span>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
|
|
@ -935,8 +935,10 @@ class crm_lead(format_address, osv.osv):
|
|||
|
||||
def message_get_reply_to(self, cr, uid, ids, context=None):
|
||||
""" Override to get the reply_to of the parent project. """
|
||||
return [lead.section_id.message_get_reply_to()[0] if lead.section_id else False
|
||||
for lead in self.browse(cr, SUPERUSER_ID, ids, context=context)]
|
||||
leads = self.browse(cr, SUPERUSER_ID, ids, context=context)
|
||||
section_ids = set([lead.section_id.id for lead in leads if lead.section_id])
|
||||
aliases = self.pool['crm.case.section'].message_get_reply_to(cr, uid, list(section_ids), context=context)
|
||||
return dict((lead.id, aliases.get(lead.section_id and lead.section_id.id or 0, False)) for lead in leads)
|
||||
|
||||
def get_formview_id(self, cr, uid, id, context=None):
|
||||
obj = self.browse(cr, uid, id, context=context)
|
||||
|
|
|
@ -45,13 +45,10 @@ class crm_claim_stage(osv.osv):
|
|||
help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."),
|
||||
'case_default': fields.boolean('Common to All Teams',
|
||||
help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."),
|
||||
'fold': fields.boolean('Hide in Views when Empty',
|
||||
help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'sequence': lambda *args: 1,
|
||||
'fold': False,
|
||||
}
|
||||
|
||||
class crm_claim(osv.osv):
|
||||
|
@ -90,7 +87,7 @@ class crm_claim(osv.osv):
|
|||
('object_id.model', '=', 'crm.claim')]"),
|
||||
'priority': fields.selection([('0','Low'), ('1','Normal'), ('2','High')], 'Priority'),
|
||||
'type_action': fields.selection([('correction','Corrective Action'),('prevention','Preventive Action')], 'Action Type'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible', track_visibility='always'),
|
||||
'user_fault': fields.char('Trouble Responsible', size=64),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
|
||||
select=True, help="Responsible sales team."\
|
||||
|
@ -164,6 +161,13 @@ class crm_claim(osv.osv):
|
|||
# context: no_log, because subtype already handle this
|
||||
return super(crm_claim, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
claim = self.browse(cr, uid, id, context=context)
|
||||
default = dict(default or {},
|
||||
stage_id = self._get_default_stage_id(cr, uid, context=context),
|
||||
name = _('%s (copy)') % claim.name)
|
||||
return super(crm_claim, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
# -------------------------------------------------------
|
||||
# Mail gateway
|
||||
# -------------------------------------------------------
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
<field name="name">Rejected</field>
|
||||
<field name="sequence">29</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
<field name="fold" eval="True"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
<field name="name"/>
|
||||
<field name="case_default"/>
|
||||
<field name="sequence"/>
|
||||
<field name="fold"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -253,14 +253,6 @@
|
|||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem name="Documents" id="menu_document_doc" parent="knowledge.menu_document" sequence="0"/>
|
||||
<menuitem
|
||||
name="Documents"
|
||||
action="action_document_file_form"
|
||||
id="menu_document_files"
|
||||
parent="menu_document_doc"
|
||||
sequence="0"
|
||||
/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_file_directory_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
|
|
@ -237,8 +237,8 @@ class test_message_compose(TestMail):
|
|||
email_template.send_mail(cr, uid, email_template_id, self.group_pigs_id, force_send=True, context=context)
|
||||
sent_emails = self._build_email_kwargs_list
|
||||
email_to_lst = [
|
||||
['b@b.b', 'c@c.c'], ['Administrator <admin@yourcompany.example.com>'],
|
||||
['Raoul Grosbedon <raoul@raoul.fr>'], ['Bert Tartignole <bert@bert.fr>']]
|
||||
['b@b.b', 'c@c.c'], ['"Administrator" <admin@yourcompany.example.com>'],
|
||||
['"Raoul Grosbedon" <raoul@raoul.fr>'], ['"Bert Tartignole" <bert@bert.fr>']]
|
||||
self.assertEqual(len(sent_emails), 4, 'email_template: send_mail: 3 valid email recipients + email_to -> should send 4 emails')
|
||||
for email in sent_emails:
|
||||
self.assertIn(email['email_to'], email_to_lst, 'email_template: send_mail: wrong email_recipients')
|
||||
|
|
|
@ -32,7 +32,7 @@ class report_event_registration(osv.osv):
|
|||
'draft_state': fields.integer(' # No of Draft Registrations', size=20),
|
||||
'confirm_state': fields.integer(' # No of Confirmed Registrations', size=20),
|
||||
'seats_max': fields.integer('Max Seats'),
|
||||
'nbevent': fields.integer('Number Of Events'),
|
||||
'nbevent': fields.integer('Number of Registrations'),
|
||||
'event_type': fields.many2one('event.type', 'Event Type'),
|
||||
'registration_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Attended'), ('cancel', 'Cancelled')], 'Registration State', readonly=True, required=True),
|
||||
'event_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Event State', readonly=True, required=True),
|
||||
|
@ -59,7 +59,7 @@ class report_event_registration(osv.osv):
|
|||
r.name AS name_registration,
|
||||
e.company_id AS company_id,
|
||||
e.date_begin AS event_date,
|
||||
count(e.id) AS nbevent,
|
||||
count(r.id) AS nbevent,
|
||||
CASE WHEN r.state IN ('draft') THEN r.nb_register ELSE 0 END AS draft_state,
|
||||
CASE WHEN r.state IN ('open','done') THEN r.nb_register ELSE 0 END AS confirm_state,
|
||||
e.type AS event_type,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.oe_event_date{
|
||||
border-top-left-radius:3px;
|
||||
border-top-right-radius:3px;
|
||||
font-size: 48px;
|
||||
font-size: 36px;
|
||||
height: auto;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
|
|
@ -245,7 +245,8 @@ class event_ticket(osv.osv):
|
|||
]
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id=False, context=None):
|
||||
return {'value': {'price': self.pool.get("product.product").browse(cr, uid, product_id).list_price or 0}}
|
||||
price = self.pool.get("product.product").browse(cr, uid, product_id).list_price if product_id else 0
|
||||
return {'value': {'price': price}}
|
||||
|
||||
|
||||
class event_registration(osv.osv):
|
||||
|
|
|
@ -58,7 +58,7 @@ def start_end_date_for_period(period, default_start_date=False, default_end_date
|
|||
end_date = default_end_date
|
||||
|
||||
if start_date and end_date:
|
||||
return (start_date.strftime(DF), end_date.strftime(DF))
|
||||
return (datetime.strftime(start_date, DF), datetime.strftime(end_date, DF))
|
||||
else:
|
||||
return (start_date, end_date)
|
||||
|
||||
|
|
|
@ -699,7 +699,7 @@ class google_calendar(osv.AbstractModel):
|
|||
for att in att_obj.browse(cr, uid, my_att_ids, context=context):
|
||||
event = att.event_id
|
||||
|
||||
base_event_id = att.google_internal_event_id.split('_')[0]
|
||||
base_event_id = att.google_internal_event_id.rsplit('_', 1)[0]
|
||||
|
||||
if base_event_id not in event_to_synchronize:
|
||||
event_to_synchronize[base_event_id] = {}
|
||||
|
@ -721,7 +721,7 @@ class google_calendar(osv.AbstractModel):
|
|||
|
||||
for event in all_event_from_google.values():
|
||||
event_id = event.get('id')
|
||||
base_event_id = event_id.split('_')[0]
|
||||
base_event_id = event_id.rsplit('_', 1)[0]
|
||||
|
||||
if base_event_id not in event_to_synchronize:
|
||||
event_to_synchronize[base_event_id] = {}
|
||||
|
@ -786,7 +786,7 @@ class google_calendar(osv.AbstractModel):
|
|||
if actSrc == 'OE':
|
||||
self.delete_an_event(cr, uid, current_event[0], context=context)
|
||||
elif actSrc == 'GG':
|
||||
new_google_event_id = event.GG.event['id'].split('_')[1]
|
||||
new_google_event_id = event.GG.event['id'].rsplit('_', 1)[1]
|
||||
if 'T' in new_google_event_id:
|
||||
new_google_event_id = new_google_event_id.replace('T', '')[:-1]
|
||||
else:
|
||||
|
@ -795,7 +795,8 @@ class google_calendar(osv.AbstractModel):
|
|||
if event.GG.status:
|
||||
parent_event = {}
|
||||
if not event_to_synchronize[base_event][0][1].OE.event_id:
|
||||
event_to_synchronize[base_event][0][1].OE.event_id = att_obj.search_read(cr, uid, [('google_internal_event_id', '=', event.GG.event['id'].split('_')[0])], ['event_id'], context=context_novirtual)[0].get('event_id')[0]
|
||||
main_ev = att_obj.search_read(cr, uid, [('google_internal_event_id', '=', event.GG.event['id'].rsplit('_', 1)[0])], fields=['event_id'], context=context_novirtual)
|
||||
event_to_synchronize[base_event][0][1].OE.event_id = main_ev[0].get('event_id')[0]
|
||||
|
||||
parent_event['id'] = "%s-%s" % (event_to_synchronize[base_event][0][1].OE.event_id, new_google_event_id)
|
||||
res = self.update_from_google(cr, uid, parent_event, event.GG.event, "copy", context)
|
||||
|
|
|
@ -225,7 +225,7 @@ class hr_employee(osv.osv):
|
|||
"resized as a 128x128px image, with aspect ratio preserved. "\
|
||||
"Use this field in form views or some kanban views."),
|
||||
'image_small': fields.function(_get_image, fnct_inv=_set_image,
|
||||
string="Smal-sized photo", type="binary", multi="_get_image",
|
||||
string="Small-sized photo", type="binary", multi="_get_image",
|
||||
store = {
|
||||
'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
},
|
||||
|
|
|
@ -40,7 +40,9 @@
|
|||
<page string="Public Information">
|
||||
<group>
|
||||
<group string="Contact Information">
|
||||
<field name="address_id" on_change="onchange_address_id(address_id)" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>
|
||||
<field name="address_id" on_change="onchange_address_id(address_id)"
|
||||
context="{'show_address': 1, 'default_customer': False}"
|
||||
options='{"always_reload": True, "highlight_first_line": True}'/>
|
||||
<field name="mobile_phone"/>
|
||||
<field name="work_location"/>
|
||||
</group>
|
||||
|
@ -68,7 +70,9 @@
|
|||
<field name="otherid" groups="base.group_hr_user"/>
|
||||
</group>
|
||||
<group string="Contact Information">
|
||||
<field name="address_home_id" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>
|
||||
<field name="address_home_id"
|
||||
context="{'show_address': 1, 'default_customer': False}"
|
||||
options='{"always_reload": True, "highlight_first_line": True}'/>
|
||||
</group>
|
||||
<group string="Status">
|
||||
<field name="gender"/>
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
<record model="ir.actions.act_window" id="hr_applicant_resumes">
|
||||
<field name="name">Resumes and Letters</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="document.view_document_file_tree"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_id" ref="mail.view_document_file_kanban"/>
|
||||
<field name="domain">[('res_model','=','hr.applicant')]</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
|
|
|
@ -99,7 +99,7 @@ class hr_holidays_status(osv.osv):
|
|||
for record in self.browse(cr, uid, ids, context=context):
|
||||
name = record.name
|
||||
if not record.limit:
|
||||
name = name + (' (%d/%d)' % (record.leaves_taken or 0.0, record.max_leaves or 0.0))
|
||||
name = name + (' (%g/%g)' % (record.leaves_taken or 0.0, record.max_leaves or 0.0))
|
||||
res.append((record.id, name))
|
||||
return res
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
##############################################################################
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
@ -357,6 +359,13 @@ class hr_applicant(osv.Model):
|
|||
action['domain'] = str(['&', ('res_model', '=', self._name), ('res_id', 'in', ids)])
|
||||
return action
|
||||
|
||||
def message_get_reply_to(self, cr, uid, ids, context=None):
|
||||
""" Override to get the reply_to of the parent project. """
|
||||
applicants = self.browse(cr, SUPERUSER_ID, ids, context=context)
|
||||
job_ids = set([applicant.job_id.id for applicant in applicants if applicant.job_id])
|
||||
aliases = self.pool['project.project'].message_get_reply_to(cr, uid, list(job_ids), context=context)
|
||||
return dict((applicant.id, aliases.get(applicant.job_id and applicant.job_id.id or 0, False)) for applicant in applicants)
|
||||
|
||||
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
|
||||
recipients = super(hr_applicant, self).message_get_suggested_recipients(cr, uid, ids, context=context)
|
||||
for applicant in self.browse(cr, uid, ids, context=context):
|
||||
|
|
|
@ -225,7 +225,7 @@ class partner_vat_intra(osv.osv_memory):
|
|||
data_head = """<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<ns2:IntraConsignment xmlns="http://www.minfin.fgov.be/InputCommon" xmlns:ns2="http://www.minfin.fgov.be/IntraConsignment" IntraListingsNbr="1">
|
||||
<ns2:Representative>
|
||||
<RepresentativeID identificationType="NVAT" issuedBy="%(issued_by)s">%(company_vat)s</RepresentativeID>
|
||||
<RepresentativeID identificationType="NVAT" issuedBy="%(issued_by)s">%(vatnum)s</RepresentativeID>
|
||||
<Name>%(company_name)s</Name>
|
||||
<Street>%(street)s</Street>
|
||||
<PostCode>%(post_code)s</PostCode>
|
||||
|
|
|
@ -59,25 +59,7 @@ A removal of one object in the CODA processing results in the removal of the
|
|||
associated objects. The removal of a CODA File containing multiple Bank
|
||||
Statements will also remove those associated statements.
|
||||
|
||||
The following reconciliation logic has been implemented in the CODA processing:
|
||||
-------------------------------------------------------------------------------
|
||||
1) The Company's Bank Account Number of the CODA statement is compared against
|
||||
the Bank Account Number field of the Company's CODA Bank Account
|
||||
configuration records (whereby bank accounts defined in type='info'
|
||||
configuration records are ignored). If this is the case an 'internal transfer'
|
||||
transaction is generated using the 'Internal Transfer Account' field of the
|
||||
CODA File Import wizard.
|
||||
2) As a second step the 'Structured Communication' field of the CODA transaction
|
||||
line is matched against the reference field of in- and outgoing invoices
|
||||
(supported : Belgian Structured Communication Type).
|
||||
3) When the previous step doesn't find a match, the transaction counterparty is
|
||||
located via the Bank Account Number configured on the OpenERP Customer and
|
||||
Supplier records.
|
||||
4) In case the previous steps are not successful, the transaction is generated
|
||||
by using the 'Default Account for Unrecognized Movement' field of the CODA
|
||||
File Import wizard in order to allow further manual processing.
|
||||
|
||||
In stead of a manual adjustment of the generated Bank Statements, you can also
|
||||
Instead of a manual adjustment of the generated Bank Statements, you can also
|
||||
re-import the CODA after updating the OpenERP database with the information that
|
||||
was missing to allow automatic reconciliation.
|
||||
|
||||
|
|
|
@ -28,46 +28,4 @@ class account_bank_statement(osv.osv):
|
|||
}
|
||||
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
_inherit = 'account.bank.statement.line'
|
||||
_columns = {
|
||||
'coda_account_number': fields.char('Account Number', help="The Counter Party Account Number")
|
||||
}
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
"""
|
||||
This function creates a Bank Account Number if, for a bank statement line,
|
||||
the partner_id field and the coda_account_number field are set,
|
||||
and the account number does not exist in the database
|
||||
"""
|
||||
if 'partner_id' in data and data['partner_id'] and 'coda_account_number' in data and data['coda_account_number']:
|
||||
acc_number_ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', data['coda_account_number'])])
|
||||
if len(acc_number_ids) == 0:
|
||||
try:
|
||||
type_model, type_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'bank_normal')
|
||||
type_id = self.pool.get('res.partner.bank.type').browse(cr, uid, type_id, context=context)
|
||||
self.pool.get('res.partner.bank').create(cr, uid, {'acc_number': data['coda_account_number'], 'partner_id': data['partner_id'], 'state': type_id.code}, context=context)
|
||||
except ValueError:
|
||||
pass
|
||||
return super(account_bank_statement_line, self).create(cr, uid, data, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
super(account_bank_statement_line, self).write(cr, uid, ids, vals, context)
|
||||
"""
|
||||
Same as create function above, but for write function
|
||||
"""
|
||||
if 'partner_id' in vals:
|
||||
for line in self.pool.get('account.bank.statement.line').browse(cr, uid, ids, context=context):
|
||||
if line.coda_account_number:
|
||||
acc_number_ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', line.coda_account_number)])
|
||||
if len(acc_number_ids) == 0:
|
||||
try:
|
||||
type_model, type_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'bank_normal')
|
||||
type_id = self.pool.get('res.partner.bank.type').browse(cr, uid, type_id, context=context)
|
||||
self.pool.get('res.partner.bank').create(cr, uid, {'acc_number': line.coda_account_number, 'partner_id': vals['partner_id'], 'state': type_id.code}, context=context)
|
||||
except ValueError:
|
||||
pass
|
||||
return True
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -32,5 +32,27 @@
|
|||
<field eval="'2011-01-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!-- invoice with BBA -->
|
||||
<record id="coda_demo_invoice_1" model="account.invoice">
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="journal_id" ref="account.sales_journal"/>
|
||||
<field name="period_id" ref="period_1_2011"/>
|
||||
<field name="state">draft</field>
|
||||
<field name="type">out_invoice</field>
|
||||
<field name="account_id" ref="account.a_recv"/>
|
||||
<field name="partner_id" ref="base.res_partner_9"/>
|
||||
<field name="reference_type">bba</field>
|
||||
<field name="reference">+++240/2838/42818+++</field>
|
||||
</record>
|
||||
<record id="invoice_1_line_1" model="account.invoice.line">
|
||||
<field name="name">Otpez Laptop without OS</field>
|
||||
<field name="invoice_id" ref="coda_demo_invoice_1"/>
|
||||
<field name="price_unit">608.89</field>
|
||||
<field name="quantity">10</field>
|
||||
<field name="account_id" ref="account.a_sale"/>
|
||||
</record>
|
||||
<workflow action="invoice_open" model="account.invoice" ref="coda_demo_invoice_1"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
2200010000 GKCCBEBB 1 0
|
||||
2300010000BE41063012345610 PARTNER 1 0 1
|
||||
3100010001OL44483FW SCTOFBIONLO001010001001PARTNER 1 0 0
|
||||
2100020000OL4414AC8BOVSOVSOVERS00000000030444501101110015000002010237 11011113501 0
|
||||
2100020000OL4414AC8BOVSOVSOVERS0000000003044450110111001500001101240283842818 11011113501 0
|
||||
2200020000 BBRUBEBB 1 0
|
||||
2300020000BE61310126985517 PARTNER 2 0 1
|
||||
3100020001OL4414AC8BOVSOVSOVERS001500001001PARTNER 2 1 0
|
||||
|
|
|
@ -291,79 +291,38 @@ class account_coda_import(osv.osv_memory):
|
|||
if 'counterpartyAddress' in line and line['counterpartyAddress'] != '':
|
||||
note.append(_('Counter Party Address') + ': ' + line['counterpartyAddress'])
|
||||
line['name'] = "\n".join(filter(None, [line['counterpartyName'], line['communication']]))
|
||||
partner = None
|
||||
partner_id = None
|
||||
invoice = False
|
||||
structured_com = ""
|
||||
bank_account_id = False
|
||||
if line['communication_struct'] and 'communication_type' in line and line['communication_type'] == '101':
|
||||
ids = self.pool.get('account.invoice').search(cr, uid, [('reference', '=', line['communication']), ('reference_type', '=', 'bba')])
|
||||
|
||||
# Gère les communications structurées
|
||||
# TODO : à faire primer sur resolution_proposition : si la communication indique une facture, on la sélectionne
|
||||
|
||||
# if ids:
|
||||
# invoice = self.pool.get('account.invoice').browse(cr, uid, ids[0])
|
||||
# partner = invoice.partner_id
|
||||
# partner_id = partner.id
|
||||
# if invoice.type in ['in_invoice', 'in_refund'] and line['debit'] == '1':
|
||||
# line['transaction_type'] = 'supplier'
|
||||
# elif invoice.type in ['out_invoice', 'out_refund'] and line['debit'] == '0':
|
||||
# line['transaction_type'] = 'customer'
|
||||
# line['account'] = invoice.account_id.id
|
||||
# line['reconcile'] = False
|
||||
# if invoice.type in ['in_invoice', 'out_invoice']:
|
||||
# iml_ids = self.pool.get('account.move.line').search(cr, uid, [('move_id', '=', invoice.move_id.id), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
|
||||
# if iml_ids:
|
||||
# line['reconcile'] = iml_ids[0]
|
||||
# if line['reconcile']:
|
||||
# voucher_vals = {
|
||||
# 'type': line['transaction_type'] == 'supplier' and 'payment' or 'receipt',
|
||||
# 'name': line['name'],
|
||||
# 'partner_id': partner_id,
|
||||
# 'journal_id': statement['journal_id'].id,
|
||||
# 'account_id': statement['journal_id'].default_credit_account_id.id,
|
||||
# 'company_id': statement['journal_id'].company_id.id,
|
||||
# 'currency_id': statement['journal_id'].company_id.currency_id.id,
|
||||
# 'date': line['entryDate'],
|
||||
# 'amount': abs(line['amount']),
|
||||
# 'period_id': statement['period_id'],
|
||||
# 'invoice_id': invoice.id,
|
||||
# }
|
||||
# context['invoice_id'] = invoice.id
|
||||
# voucher_vals.update(self.pool.get('account.voucher').onchange_partner_id(cr, uid, [],
|
||||
# partner_id=partner_id,
|
||||
# journal_id=statement['journal_id'].id,
|
||||
# amount=abs(line['amount']),
|
||||
# currency_id=statement['journal_id'].company_id.currency_id.id,
|
||||
# ttype=line['transaction_type'] == 'supplier' and 'payment' or 'receipt',
|
||||
# date=line['transactionDate'],
|
||||
# context=context
|
||||
# )['value'])
|
||||
# line_drs = []
|
||||
# for line_dr in voucher_vals['line_dr_ids']:
|
||||
# line_drs.append((0, 0, line_dr))
|
||||
# voucher_vals['line_dr_ids'] = line_drs
|
||||
# line_crs = []
|
||||
# for line_cr in voucher_vals['line_cr_ids']:
|
||||
# line_crs.append((0, 0, line_cr))
|
||||
# voucher_vals['line_cr_ids'] = line_crs
|
||||
# line['voucher_id'] = self.pool.get('account.voucher').create(cr, uid, voucher_vals, context=context)
|
||||
structured_com = line['communication']
|
||||
if 'counterpartyNumber' in line and line['counterpartyNumber']:
|
||||
ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', str(line['counterpartyNumber']))])
|
||||
if ids and len(ids) > 0:
|
||||
partner = self.pool.get('res.partner.bank').browse(cr, uid, ids[0], context=context).partner_id
|
||||
partner_id = partner.id
|
||||
if ids:
|
||||
bank_account_id = ids[0]
|
||||
partner_id = self.pool.get('res.partner.bank').browse(cr, uid, bank_account_id, context=context).partner_id.id
|
||||
else:
|
||||
#create the bank account, not linked to any partner. The reconciliation will link the partner manually
|
||||
#chosen at the bank statement final confirmation time.
|
||||
try:
|
||||
type_model, type_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'bank_normal')
|
||||
type_id = self.pool.get('res.partner.bank.type').browse(cr, uid, type_id, context=context)
|
||||
bank_code = type_id.code
|
||||
except ValueError:
|
||||
bank_code = 'bank'
|
||||
bank_account_id = self.pool.get('res.partner.bank').create(cr, uid, {'acc_number': str(line['counterpartyNumber']), 'state': bank_code}, context=context)
|
||||
if 'communication' in line and line['communication'] != '':
|
||||
note.append(_('Communication') + ': ' + line['communication'])
|
||||
data = {
|
||||
'name': line['name'],
|
||||
'note': "\n".join(note),
|
||||
'note': "\n".join(note),
|
||||
'date': line['entryDate'],
|
||||
'amount': line['amount'],
|
||||
'partner_id': partner_id,
|
||||
'statement_id': statement['id'],
|
||||
'ref': line['ref'],
|
||||
'ref': structured_com,
|
||||
'sequence': line['sequence'],
|
||||
'coda_account_number': line['counterpartyNumber'],
|
||||
'bank_account_id': bank_account_id,
|
||||
}
|
||||
self.pool.get('account.bank.statement.line').create(cr, uid, data, context=context)
|
||||
if statement['coda_note'] != '':
|
||||
|
|
|
@ -141,7 +141,7 @@ class account_invoice(osv.osv):
|
|||
elif algorithm == 'random':
|
||||
if not self.check_bbacomm(reference):
|
||||
base = random.randint(1, 9999999999)
|
||||
bbacomm = str(base).rjust(7, '0')
|
||||
bbacomm = str(base).rjust(10, '0')
|
||||
base = int(bbacomm)
|
||||
mod = base % 97 or 97
|
||||
mod = str(mod).rjust(2, '0')
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
<field name="property_account_payable" ref="211"/>
|
||||
<field name="property_account_expense_categ" ref="61_01"/>
|
||||
<field name="property_account_income_categ" ref="411_01"/>
|
||||
<field name="currency_id" ref="base.AUD"/>
|
||||
<field name="currency_id" ref="base.CLP"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -279,25 +279,25 @@
|
|||
|
||||
<!-- ADQUISICIONES INTRACOMUNITARIAS DE BIENES CORRIENTES-->
|
||||
<record id="iva_ded_30" model="account.tax.code.template">
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y servicios corrientes</field>
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y serv. corrientes</field>
|
||||
<field name="code">[30]</field>
|
||||
<field name="parent_id" ref="iva_ded_base_total"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_30_4" model="account.tax.code.template">
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y servicios corrientes (4%)</field>
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y serv. corr. (4%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_30"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_30_10" model="account.tax.code.template">
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y servicios corrientes (10%)</field>
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y serv. corr. (10%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_30"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_30_21" model="account.tax.code.template">
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y servicios corrientes (21%)</field>
|
||||
<field name="name">Base adquisiciones intracomunitarias bienes y serv. corr. (21%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_30"/>
|
||||
<field name="sign">1.0</field>
|
||||
|
@ -427,19 +427,19 @@
|
|||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_27_4" model="account.tax.code.template">
|
||||
<field name="name">Cuotas devengadas importaciones bienes y servicios corrientes (4%)</field>
|
||||
<field name="name">Cuotas devengadas importaciones bienes y serv. corr. (4%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_27"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_27_10" model="account.tax.code.template">
|
||||
<field name="name">Cuotas devengadas importaciones bienes y servicios corrientes (10%)</field>
|
||||
<field name="name">Cuotas devengadas importaciones bienes y serv. corr. (10%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_27"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_27_21" model="account.tax.code.template">
|
||||
<field name="name">Cuotas devengadas importaciones bienes y servicios corrientes (21%)</field>
|
||||
<field name="name">Cuotas devengadas importaciones bienes y serv. corr. (21%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_27"/>
|
||||
<field name="sign">1.0</field>
|
||||
|
@ -478,19 +478,19 @@
|
|||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_31_4" model="account.tax.code.template">
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y servicios corrientes (4%)</field>
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y serv. corr. (4%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_31"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_31_10" model="account.tax.code.template">
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y servicios corrientes (10%)</field>
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y serv. corr. (10%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_31"/>
|
||||
<field name="sign">1.0</field>
|
||||
</record>
|
||||
<record id="iva_ded_31_21" model="account.tax.code.template">
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y servicios corrientes (21%)</field>
|
||||
<field name="name">En adquisiciones intracomunitarias bienes y serv. corr. (21%)</field>
|
||||
<field name="code">--</field>
|
||||
<field name="parent_id" ref="iva_ded_31"/>
|
||||
<field name="sign">1.0</field>
|
||||
|
@ -772,4 +772,4 @@
|
|||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id"
|
||||
"l10n_et","Ethiopia Tax and Account Chart Template","l10n_et0","tc_01","l10n_et2110","l10n_et2211","l10n_et3002","l10n_et2301","l10n_et1100"
|
||||
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id","currency_id:id"
|
||||
"l10n_et","Ethiopia Tax and Account Chart Template","l10n_et0","tc_01","l10n_et2110","l10n_et2211","l10n_et3002","l10n_et2301","l10n_et1100","base.ETB"
|
||||
|
|
|
|
@ -5,21 +5,6 @@
|
|||
<field name="state">open</field>
|
||||
</record>
|
||||
|
||||
<!-- Moneda Quetzal -->
|
||||
|
||||
<record id="GTQ" model="res.currency">
|
||||
<field name="name">GTQ</field>
|
||||
<field name="symbol">Q</field>
|
||||
<field name="rounding">0.01</field>
|
||||
<field name="accuracy">4</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="rateGTQ" model="res.currency.rate">
|
||||
<field name="rate">11.2020</field>
|
||||
<field name="currency_id" ref="GTQ"/>
|
||||
<field eval="time.strftime('%Y-01-01')" name="name"/>
|
||||
</record>
|
||||
|
||||
<!-- Plantilla de cuentas -->
|
||||
|
||||
<record id="cuentas_plantilla" model="account.chart.template">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<record id="impuestos_plantilla_isv_por_cobrar" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="cuentas_plantilla"/>
|
||||
<field name="name">ISV por Cobrar</field>
|
||||
<field name="amount" eval="0.12"/>
|
||||
<field name="amount" eval="0.15"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_collected_id" ref="cta110301"/>
|
||||
<field name="account_paid_id" ref="cta110301"/>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<record id="impuestos_plantilla_isv_por_pagar" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="cuentas_plantilla"/>
|
||||
<field name="name">ISV por Pagar</field>
|
||||
<field name="amount" eval="0.12"/>
|
||||
<field name="amount" eval="0.15"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="account_collected_id" ref="cta210201"/>
|
||||
<field name="account_paid_id" ref="cta210201"/>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (C) 2014 InnOpen Group Kft (<http://www.innopen.eu>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (C) 2014 InnOpen Group Kft (<http://www.innopen.eu>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Hungarian - Accounting',
|
||||
'version': '1.0',
|
||||
'category': 'Localization/Account Charts',
|
||||
'description': """
|
||||
|
||||
Base module for Hungarian localization
|
||||
==========================================
|
||||
|
||||
This module consists :
|
||||
|
||||
- Generic Hungarian chart of accounts
|
||||
- Hungarian taxes
|
||||
- Hungarian Bank information
|
||||
|
||||
""",
|
||||
'author': 'InnOpen Group Kft',
|
||||
'website': 'http://www.innopen.eu',
|
||||
'license': 'AGPL-3',
|
||||
'depends': ['account','account_chart'],
|
||||
'data': [
|
||||
'data/account.account.template.csv',
|
||||
'data/account.tax.code.template.csv',
|
||||
'data/account.chart.template.csv',
|
||||
'data/account.tax.template.csv',
|
||||
'data/account.fiscal.position.template.csv',
|
||||
'data/account.fiscal.position.tax.template.csv',
|
||||
'data/res.bank.csv',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'application':True,
|
||||
}
|
|
@ -0,0 +1,277 @@
|
|||
"id","code","name","parent_id/id","user_type/id","type","reconcile"
|
||||
"chart_hu_0",0,"Magyar főkönyvi kivonat",,"account.data_account_type_view","view","FALSE"
|
||||
"chart_hu_1_4","1-4","Mérleg számlák","chart_hu_0","account.data_account_type_view","view","FALSE"
|
||||
"chart_hu_1",1,"BEFEKTETETT ESZKÖZÖK","chart_hu_1_4","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_11",11,"IMMATERIÁLIS JAVAK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_111",111,"Alapítás-átszervezés aktívált értéke","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_112",112,"Kísérleti fejlesztés aktívált értéke","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_113",113,"Vagyoni értékû jogok","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_114",114,"Szellemi termékek","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_115",115,"Üzleti vagy cégérték","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_117",117,"Immateriális javak értékhelyesbítése","chart_hu_11","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_12",12,"INGATLANOK, KAPCS. VAGYONI ÉRT. JOGOK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_121",121,"Földterület","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_122",122,"Telek, telkesítés","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_123",123,"Épületek,épületrészek,tulajdoni hányadok","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_124",124,"Egyéb építmények","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_125",125,"Üzemkörön kivüli ingatlanok, épületek","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_126",126,"Ingatlanhoz kapcs. vagyoni ért. jogok","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_127",127,"Ingatlanok értékhelyesbítése","chart_hu_12","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_13",13,"MÜSZAKI BERENDEZÉSEK, GÉPEK, JÁRMÜVEK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_131",131,"Termelõ gépek, berendezések, gyártóeszk.","chart_hu_13","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_132",132,"Termelésben résztvevõ jármûvek","chart_hu_13","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_137",137,"Müszaki gépek,felsz,járm. értékhelyesb.","chart_hu_13","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_14",14,"EGYÉB BERENDEZÉSEK, FELSZ., JÁRMÜVEK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_141",141,"Üzemi berendezések, gépek,felszerelések","chart_hu_14","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_142",142,"Egyéb jármûvek","chart_hu_14","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_143",143,"Irodai, igazgatási berendezések","chart_hu_14","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_144",144,"Üzemkörön kivüli berendezések, felsz.","chart_hu_14","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_147",147,"Egyéb gépek,felsz,járm. értékhelyesbítés","chart_hu_14","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_15",15,"TENYÉSZÁLLATOK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_151",151,"Tenyészállatok","chart_hu_15","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_16",16,"BERUHÁZÁSOK, FELúJÍTÁSOK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_161",161,"Befejezetlen beruházások","chart_hu_16","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_162",162,"Felújítások","chart_hu_16","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_168",168,"Beruházások terven felüli értékcsökk.","chart_hu_16","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_17",17,"BEFEKTETETT Pü.I ESZKÖZÖK RÉSZESEDÉSEK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_171",171,"Tartós részesedés kapcs. vállalkozásban","chart_hu_17","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_172",172,"Egyéb tartós részesedés","chart_hu_17","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_177",177,"Részesedések értékhelyesbítése","chart_hu_17","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_179",179,"Részesedések értékvesztése, visszaírása","chart_hu_17","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_18",18,"HITELVISZONYT MEGTESTESÍTÖ ÉRTÉKPAPÍROK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_181",181,"Államkötvények","chart_hu_18","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_182",182,"Kapcsolt vállalkozások értékpapírjai","chart_hu_18","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_183",183,"Egyéb vállalkozások értékpapírjai","chart_hu_18","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_184",184,"Tartós diszkont értékpapírok","chart_hu_18","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_189",189,"Értékpapírok értékvesztése, visszaírása","chart_hu_18","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_19",19,"TARTÓSAN ADOTT KÖLCSÖNÖK","chart_hu_1","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_191",191,"Tartósan adott kölcsönök kapcs. váll.","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_192",192,"Tartósan adott kölcsön egyéb rész.váll.","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_193",193,"Egyéb tartósan adott kölcsönök","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_195",195,"Tartós bankbetétek kapcs. váll.-ban","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_196",196,"Tartós bankbetétek egyéb rész. váll.-ban","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_197",197,"Egyéb tartós bankbetétek","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_198",198,"Pénzügyi lízing miatti tartós követelés","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_199",199,"Tartósan adott kölcsönök értékvesztése","chart_hu_19","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_2",2,"KÉSZLETEK","chart_hu_1_4","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_21",21,"ANYAGOK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_211",211,"Nyers- és alapanyagok","chart_hu_21","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_22",22,"ANYAGOK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_221",221,"Segédanyagok","chart_hu_22","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_23",23,"BEFEJEZETLEN TERMELÉS ÉS FÉLKÉSZTERMÉKEK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_231",231,"Befejezetlen termelés","chart_hu_23","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_25",25,"KÉSZTERMÉKEK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_251",251,"Késztermékek","chart_hu_25","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_26",26,"ÁRUK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_261",261,"Áruk beszerzési áron","chart_hu_26","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_27",27,"KÖZVETÍTETT SZOLGÁLTATÁSOK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_271",271,"Közvetített szolgáltatások","chart_hu_27","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_28",28,"BETÉTDÍJAS GÖNGYÖLEGEK","chart_hu_2","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_281",281,"Betétdíjas göngyölegek","chart_hu_28","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_3",3,"KÖVETELÉSEK,PÉNZÜGYI ESZK,AKTÍV IDÖB.ELH","chart_hu_1_4","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_31",31,"KÖVETELÉSEK ÁRUSZÁLL.- SZOLGÁLTATÁSBÓL","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_311",311,"Belföldi követelések","chart_hu_31","account.data_account_type_receivable","receivable","TRUE"
|
||||
"chart_hu_316",316,"Külföldi követelések","chart_hu_31","account.data_account_type_receivable","receivable","TRUE"
|
||||
"chart_hu_35",35,"ADOTT ELÖLEGEK","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_351",351,"Adott elõlegek","chart_hu_35","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_36",36,"EGYÉB KÖVETELÉSEK","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_361",361,"Munkavállalókkal szembeni követelés","chart_hu_36","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_368",368,"Különféle egyéb követelések","chart_hu_36","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_37",37,"ÉRTÉKPAPÍROK","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_371",371,"Részesedés kapcsolt vállalkozásban","chart_hu_37","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_372",372,"Egyéb részesedés","chart_hu_37","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_373",373,"Saját részvények, saját üzletrészek","chart_hu_37","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_374",374,"Forgatási célú hitelv. m. értékpapírok","chart_hu_37","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_38",38,"PÉNZESZKÖZÖK","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_381",381,"Pénztárak","chart_hu_38","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_3811",3811,"Pénztár","chart_hu_381","account.data_account_type_cash","Liquidity","FALSE"
|
||||
"chart_hu_382",382,"Valuta pénztár","chart_hu_38","account.data_account_type_cash","other","FALSE"
|
||||
"chart_hu_384",384,"Elszámolási betétszámla","chart_hu_38","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_3841",3841,"Bankszámla","chart_hu_384","account.data_account_type_bank","Liquidity","FALSE"
|
||||
"chart_hu_385",385,"Elkülönített betétszámlák","chart_hu_38","account.data_account_type_bank","other","FALSE"
|
||||
"chart_hu_386",386,"Deviza betétszámla","chart_hu_38","account.data_account_type_bank","other","FALSE"
|
||||
"chart_hu_387",387,"Pénzhelyettesítõ eszk. (utalvány, jegy)","chart_hu_38","account.data_account_type_bank","other","FALSE"
|
||||
"chart_hu_389",389,"Átvezetési számla","chart_hu_38","account.data_account_type_bank","other","FALSE"
|
||||
"chart_hu_39",39,"AKTÍV IDÖBELI ELHATÁROLÁS","chart_hu_3","account.account_type_asset_view1","view","FALSE"
|
||||
"chart_hu_391",391,"Aktív idõbeli elhatárolása","chart_hu_39","account.data_account_type_asset","other","FALSE"
|
||||
"chart_hu_4",4,"FORRÁSOK (PASSZÍVÁK)","chart_hu_1_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_41",41,"SAJÁT TÖKE","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_411",411,"Jegyzett tõke","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_412",412,"Tõketartalék","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_413",413,"Eredménytartalék","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_414",414,"Lekötött tartalék","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_417",417,"Értékelési tartalék","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_419",419,"Mérleg szerinti eredmény","chart_hu_41","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_42",42,"CÉLTARTALÉKOK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_421",421,"Céltartalék várható kötelezettségre","chart_hu_42","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_43",43,"HÁTRASOROLT KÖTELEZETTSÉGEK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_431",431,"Hátrasorolt kötelezettség","chart_hu_43","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_44",44,"HOSSZÚ LEJÁRATÚ KÖTELEZETTSÉGEK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_441",441,"Hosszú lejáratra kapott kölcsönök","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_442",442,"Átváltoztatható kötvények","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_443",443,"Tartozások kötvénykibocsátásból","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_444",444,"Beruházási és fejlesztési hitelek","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_445",445,"Egyéb hosszú lejáratú hitelek","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_446",446,"Tartós köt. kapcs. vállalkozással sz.","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_447",447,"Tartós köt. egyéb rész. váll. szemben","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_448",448,"Pénzügyi lízinggel kapcsolatos kötelez.","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_449",449,"Egyéb hosszú lej. kötelezettségek","chart_hu_44","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_45",45,"RÖVID LEJÁRATú KÖTELEZETTSÉGEK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_451",451,"Rövid lejáratú kölcsönök","chart_hu_45","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_452",452,"Rövid lejáratú hitelek","chart_hu_45","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_453",453,"Vevõktõl kapott elõlegek","chart_hu_45","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_454",454,"Szállítók","chart_hu_45","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_4541",4541,"Belföldi szállítók","chart_hu_454","account.data_account_type_payable","payable","TRUE"
|
||||
"chart_hu_4542",4542,"Külföldi szállítók","chart_hu_454","account.data_account_type_payable","payable","TRUE"
|
||||
"chart_hu_46",46,"EGYÉB RÖVID LEJÁRATú KÖTELEZETTSÉGEK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_461",461,"Társasági adó és osztalékadó elszámolás","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_462",462,"Személyi jövedelemadó elszámolása","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_463",463,"Költségvetési befizetési kötelezettségek","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_464",464,"Költségvetési befizetési köt.teljesítése","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_465",465,"Vám- és Pénzügyõrség elszámolási számla","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_466",466,"Elõzetesen felszámított ált.forgalmi adó","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_467",467,"Fizetendõ általános forgalmi adó","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_468",468,"Áfa pénzügyi elszámolási számla","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_469",469,"Önkormányzati adók elszámolási számla","chart_hu_46","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_47",47,"RÖVID LEJÁRATú KÖTELEZETTSÉGEK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_471",471,"Jövedelem elszámolási számla","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_472",472,"Fel nem vett járandóságok","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_473",473,"Társadalombiztosítási kötelezettség","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_474",474,"Elkülönített alapokkal kapcs. fiz. köt","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_475",475,"Magánnyugdíjpénztárak befiz. kötelezetts","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_476",476,"Egyéb rövid lej.kötelezettség munkaváll.","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_477",477,"Egyéb rövid lejáratú kötelezettség","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_478",478,"Magánszemélytõl levont 4% különadó","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_479",479,"Egyéb befizetési kötelezettségek","chart_hu_47","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_48",48,"PASSZÍV IDÖBELI ELHATÁROLÁS","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_481",481,"Bevételek passzív idõbeli elhatárolása","chart_hu_48","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_482",482,"Költségek,ráford. passzív idõbeli elhat.","chart_hu_48","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_483",483,"Halasztott bevételek","chart_hu_48","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_49",49,"ÉVI MÉRLEG SZÁMLÁK","chart_hu_4","account.account_type_liability_view1","view","FALSE"
|
||||
"chart_hu_491",491,"Nyitómérleg számla","chart_hu_49","account.data_account_type_liability","other","FALSE"
|
||||
"chart_hu_5_9","5-9","Eredmény számlák","chart_hu_0","account.data_account_type_view","view","FALSE"
|
||||
"chart_hu_5",5,"KÖLTSÉGNEMEK","chart_hu_5_9","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_51",51,"ANYAGKÖLTSÉG","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_511",511,"Vásárolt anyagok költségei","chart_hu_51","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_512",512,"Egy éven belül elhaszn. anyagi eszközök","chart_hu_51","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_513",513,"Egyéb anyagköltség","chart_hu_51","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_519",519,"Anyagköltség megtérülés","chart_hu_51","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_52",52,"IGÉNYBE VETT SZOLGÁLTATÁSOK KÖLTSÉGEI","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_521",521,"Szállítási, rakodási költség","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_522",522,"Bérleti díjak","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_523",523,"Javítási, karbantartási költségek","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_524",524,"Hirdetés, reklám-propaganda költség","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_525",525,"Oktatási, továbbképzési költségek","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_526",526,"Utazási- és kiküldetési költségek","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_527",527,"Postai, távközlési költségek","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_528",528,"Szakkönyv, folyóirat, napilap beszerzés","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_529",529,"Egyéb igénybevett szolgáltatások ktg-ei","chart_hu_52","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_53",53,"EGYÉB SZOLGÁLTATÁSOK KÖLTSÉGEI","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_531",531,"Hatósági igazgatási díjak (illetékek)","chart_hu_53","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_532",532,"Pénzügyi szolg-i díjak, bankköltségek","chart_hu_53","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_533",533,"Biztosítási díjak","chart_hu_53","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_54",54,"BÉRKÖLTSÉG","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_541",541,"Munkavállalók munkabér költsége","chart_hu_54","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_542",542,"Megbízási díjak bérköltség terhére","chart_hu_54","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_543",543,"Tagok személyes közr. ellenértéke","chart_hu_54","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_544",544,"Egyszerûsített fogl. bérköltsége","chart_hu_54","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_55",55,"SZEMÉLYI JELLEGû EGYÉB KIFIZETÉSEK","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_551",551,"Személyi jellegû kifizetések","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_552",552,"Jóléti és kulturális költségek","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_553",553,"Természetbeni juttatások","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_554",554,"Egyéb személyi jellegû kifizetések","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_555",555,"Magánnyugdíjpénztári tagdíjak, hozzájár.","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_556",556,"Foglalkoztatót terhelõ táppénz hjárulás","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_557",557,"Kifizetõt terhelõ személyi jövedelemadó","chart_hu_55","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_56",56,"BÉRJÁRULÉKOK","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_561",561,"Társadalombiztosítási járulék","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_562",562,"Egészségügyi hozzájárulás","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_563",563,"Munkaadói járulék","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_564",564,"Szakképzési hozzájárulás","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_565",565,"Rehabilitációs hozzájárulás","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_566",566,"Egyszerûsített közteherviselési hjár","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_567",567,"Egyszerûsített fogl. közteher","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_568",568,"Közteherjegy","chart_hu_56","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_57",57,"ÉRTÉKCSÖKKENÉSI LEÍRÁS","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_571",571,"Terv szerinti értékcsökkenés lineáris","chart_hu_57","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_572",572,"Terv szerinti egyösszegû (kisértékûek)","chart_hu_57","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_58",58,"AKTÍVÁLT SAJÁT TELJESÍTMÉNYEK ÉRTÉKE","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_581",581,"Saját term. készletek állományváltozása","chart_hu_58","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_582",582,"Saját elõállítási eszközök aktivált ért.","chart_hu_58","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_59",59,"KÖLTSÉGNEM ÁTVEZETÉSI SZÁMLA","chart_hu_5","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_591",591,"Anyagköltség átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_592",592,"Igénybevett szolg. átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_593",593,"Egyéb szolgáltatások átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_594",594,"Bérköltség átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_595",595,"Személyi jell. kif. átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_596",596,"Bérjárulékok átvezetési szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_597",597,"Értékcsökkenési leírás átvez. szla","chart_hu_59","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_8",8,"AZ ÉRTÉKESÍTÉS ÖNKÖLTS. ÉS RÁFORDÍTÁSOK","chart_hu_5_9","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_81",81,"ANYAGJELLEGÛ RÁFORDÍTÁSOK","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_811",811,"Anyagköltség","chart_hu_81","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_812",812,"Igénybevett szolgáltatások értéke","chart_hu_81","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_813",813,"Egyéb szolgáltatások értéke","chart_hu_81","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_814",814,"Eladott áruk beszerzési értéke","chart_hu_81","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_815",815,"Eladott (közvetített) szolg. értéke","chart_hu_81","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_82",82,"SZEMÉLYI JELLEGû RÁFORDÍTÁSOK","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_821",821,"Bérköltség","chart_hu_82","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_822",822,"Személyi jellegü egyéb kifizetések","chart_hu_82","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_823",823,"Bérjárulékok","chart_hu_82","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_83",83,"ÉRTÉKCSÖKKENÉSI LEÍRÁS","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_86",86,"EGYÉB RÁFORDÍTÁSOK","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_861",861,"Értékesített eszk.imm.javak nytsz értéke","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_862",862,"Ért.átruházott követelések könyvsz. ért.","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_863",863,"Az üzleti évhez kapcs. ráfordítások","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_864",864,"Utólag adott pü. rendezett engedmény","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_865",865,"Céltartalék képzése","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_866",866,"Elszámolt értékvesztés, tervenf. értékcs","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_867",867,"Adók, illetékek, hozzájárulások","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_869",869,"Különféle egyéb ráfordítások","chart_hu_86","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_87",87,"PÉNZÜGYI MÜVELETEK RÁFORDÍTÁSAI","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_871",871,"Befektetett püi. eszk. árf.vesztesége","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_872",872,"Fizetendõ kamatok, kamatjell. ráford.","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_874",874,"Részesedések,é.papírok,bankb. értékveszt","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_875",875,"Forgóeszk. értékpapír árf.vesztesége","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_876",876,"Átváltási, értékelési árfolyamveszteség","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_877",877,"Egyéb árfolyamveszteségek, opciós díjak","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_878",878,"Vásárolt köv. kapcs. ráfordítások","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_879",879,"Egyéb pénzügyi ráfordítások","chart_hu_87","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_88",88,"RENDKIVÜLI RÁFORDÍTÁSOK","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_881",881,"Társaságban bevitt eszk. nytsz. értéke","chart_hu_88","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_887",887,"Saját üzletrész nyilvántartási értéke","chart_hu_88","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_888",888,"Tartozásátv. szerz. szerinti összege","chart_hu_88","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_889",889,"Egyéb vagyoncsökk. rendkívüli ráfordítás","chart_hu_88","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_89",89,"NYERESÉGET TERHELÖ ADÓK","chart_hu_8","account.data_account_type_expense","view","FALSE"
|
||||
"chart_hu_891",891,"Társasági adó","chart_hu_89","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_892",892,"Társas vállalkozás különadója","chart_hu_89","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_895",895,"Egyszerüsített vállalkozói adó","chart_hu_89","account.data_account_type_expense","other","FALSE"
|
||||
"chart_hu_9",9,"AZ ÉRTÉKESÍTÉS ÁRBEVÉTELE, BEVÉTELEK","chart_hu_5_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_91",91,"BELFÖLDI ÉRKÉKESÍTÉS ÁRBEVÉTELE","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_911",911,"Belföldi értékesítés árbevétele","chart_hu_91","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_92",92,"BELFÖLDI ÉRTÉKESÍTÉS ÁRBEVÉTELE","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_921",921,"Belföldi értékesítés árbevétele","chart_hu_92","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_93",93,"EXPORT ÉRTÉKESÍTÉS ÁRBEVÉTELE","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_931",931,"Export értékesítés árbev. EU tagországba","chart_hu_93","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_932",932,"Export értékesítés árbev.nem EU tagorsz.","chart_hu_93","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_96",96,"EGYÉB BEVÉTELEK","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_961",961,"Ért.immat. javak, tárgyi eszk.bevétele","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_962",962,"Ért,átruházott követelések elism.mértéke","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_963",963,"Az üzleti évhez kapcs. egyéb bevételek","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_964",964,"Utólag kapott pü. rendezett engedmény","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_965",965,"Céltartalék felhasználása","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_966",966,"Értékvesztések visszaírása, tervenf.écs.","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_967",967,"Visszafiz. köt. nélkül kapott támogatás","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_968",968,"Biztosító által visszaig. kártérítés ö.","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_969",969,"Különféle egyéb bevételek","chart_hu_96","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_97",97,"PÉNZÜGYI MÜVELETEK BEVÉTELEI","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_971",971,"Kapott (járó) osztalék, részesedés","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_972",972,"Részesedések ért. árfolyamnyeresége","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_973",973,"Befekt. püi.eszk. kamatai, árf.nyeres.","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_974",974,"Egyéb kapott kamatok,kamatjell.bevételek","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_975",975,"Forgóeszk. értékpapír árfolyamnyeresége","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_976",976,"Átváltási, átértékeléskori árf.nyereség","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_977",977,"Egyéb árfolyamnyereségek, opciós bev.","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_978",978,"Vás. követelésekkel kapcs. bevételek","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_979",979,"Egyéb pénzügyi mûveletek bevételei","chart_hu_97","account.data_account_type_income","other","FALSE"
|
||||
"chart_hu_98",98,"RENDKIVÜLI BEVÉTELEK","chart_hu_9","account.data_account_type_income","view","FALSE"
|
||||
"chart_hu_981",981,"Rendkívüli bevételek","chart_hu_98","account.data_account_type_income","other","FALSE"
|
|
|
@ -0,0 +1,2 @@
|
|||
"id","name","code_digits","account_root_id/id","tax_code_root_id/id","bank_account_view_id/id","property_account_receivable/id","property_account_payable/id","property_account_expense_categ/id","property_account_income_categ/id","property_account_expense/id","property_account_income/id","tax_code_root_id/id"
|
||||
"hungarian_chart_template","Magyar főkönyvi kivonat",4,"chart_hu_0","tax_code_hu_1000","chart_hu_384","chart_hu_311","chart_hu_4541","chart_hu_81","chart_hu_911","chart_hu_81","chart_hu_911","tax_code_hu_vat"
|
|
|
@ -0,0 +1,43 @@
|
|||
"id","display_detail","style_overwrite","account_type_ids/id","account_ids/id","parent_id/id","sign","name","account_report_id/id","sequence","type"
|
||||
"l10n_hu.account_financial_report_pl_hu","Display children flat","Main Title 1 (bold, underlined)",,,,"Reverse balance sign","Eredménykimutatás – HU",,30,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_G","Display children flat","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_pl_hu","Reverse balance sign","Mérleg szerinti eredmény",,10,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_F","Display children flat","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_pl_hu_G","Reverse balance sign","Adózott eredmény",,12,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_XIII","Display children with hierarchy","Normal Text","account_type_pl_hu_XIII",,"l10n_hu.account_financial_report_pl_hu_G","Reverse balance sign","Osztalék",,11,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_E","Display children flat","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_pl_hu_F","Reverse balance sign","Adózás előtti eredmény",,14,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_XII","Display children with hierarchy","Normal Text","account_type_pl_hu_XII",,"l10n_hu.account_financial_report_pl_hu_F","Reverse balance sign","Adófizetési kötelezettség",,13,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_D","Display children flat","Title 2 (bold)",,,"l10n_hu.account_financial_report_pl_hu_E","Reverse balance sign","Rendkívüli eredmény",,15,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_X","Display children with hierarchy","Normal Text","account_type_pl_hu_X",,"l10n_hu.account_financial_report_pl_hu_D","Reverse balance sign","Rendkívüli bevételek",,17,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_XI","Display children with hierarchy","Normal Text","account_type_pl_hu_XI",,"l10n_hu.account_financial_report_pl_hu_D","Reverse balance sign","Rendkivüli ráfordítások",,16,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_C","Display children flat","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_pl_hu_E","Reverse balance sign","Szokásos vállalkozási eredmény",,18,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_A","Display children flat","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_pl_hu_C","Reverse balance sign","Üzemi (üzleti) tevékenység eredménye",,22,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_B","Display children flat","Title 2 (bold)",,,"l10n_hu.account_financial_report_pl_hu_C","Reverse balance sign","Pénzügyi műveletek eredménye",,19,"View"
|
||||
"l10n_hu.account_financial_report_pl_hu_VIII","Display children with hierarchy","Normal Text","account_type_pl_hu_VIII",,"l10n_hu.account_financial_report_pl_hu_B","Reverse balance sign","Pénzügyi műveletek bevételei",,21,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_IX","Display children with hierarchy","Normal Text","account_type_pl_hu_IX",,"l10n_hu.account_financial_report_pl_hu_B","Reverse balance sign","Pénzügyi műveletek ráfordításai ",,20,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_I","Display children with hierarchy","Normal Text","account_type_pl_hu_I",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Értékesítés nettó árbevétele ",,1,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_II","Display children with hierarchy","Normal Text","account_type_pl_hu_II",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Aktivált saját teljesítmények értéke ",,2,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_III","Display children with hierarchy","Normal Text","account_type_pl_hu_III",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Egyéb bevételek",,3,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_IV","Display children with hierarchy","Normal Text","account_type_pl_hu_IV",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Anyagjellegű ráfordítások ",,4,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_V","Display children with hierarchy","Normal Text","account_type_pl_hu_V",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Személyi jellegű ráfordítások ",,5,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_VI","Display children with hierarchy","Normal Text","account_type_pl_hu_VI",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Értékcsökkenési leírás",,6,"Account Type"
|
||||
"l10n_hu.account_financial_report_pl_hu_VII","Display children with hierarchy","Normal Text","account_type_pl_hu_VII",,"l10n_hu.account_financial_report_pl_hu_A","Reverse balance sign","Egyéb ráfordítások",,7,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu","Display children flat",,,,,"Preserve balance sign","Mérleg – HU",,30,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_AC","Display children with hierarchy","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_bs_hu","Preserve balance sign","Eszközök Összesen",,100,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_DG","Display children with hierarchy","Main Title 1 (bold, underlined)",,,"l10n_hu.account_financial_report_bs_hu","Reverse balance sign","Források Összesen",,200,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_A","Display children flat","Title 2 (bold)","account_type_bs_hu_A",,"l10n_hu.account_financial_report_bs_hu_AC","Preserve balance sign","Befektetett Eszközök",,110,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_AI","Display children flat","Normal Text","account_type_bs_hu_AI",,"l10n_hu.account_financial_report_bs_hu_A","Preserve balance sign","Immateriális Javak",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_AII","Display children flat","Normal Text","account_type_bs_hu_AII",,"l10n_hu.account_financial_report_bs_hu_A","Preserve balance sign","Tárgyi Eszközök",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_AIII","Display children flat","Normal Text","account_type_bs_hu_AIII",,"l10n_hu.account_financial_report_bs_hu_A","Preserve balance sign","Befektetett Pénzügyi Eszközök",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_B","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_B",,"l10n_hu.account_financial_report_bs_hu_AC","Preserve balance sign","Forgóeszközök",,120,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_BI","Display children flat","Normal Text","account_type_bs_hu_BI",,"l10n_hu.account_financial_report_bs_hu_B","Preserve balance sign","Készletek",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_BII","Display children flat","Normal Text","account_type_bs_hu_BII",,"l10n_hu.account_financial_report_bs_hu_B","Preserve balance sign","Követelések",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_BIII","Display children flat","Normal Text","account_type_bs_hu_BIII",,"l10n_hu.account_financial_report_bs_hu_B","Preserve balance sign","Értékpapírok",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_BIV","Display children flat","Normal Text","account_type_bs_hu_BIV",,"l10n_hu.account_financial_report_bs_hu_B","Preserve balance sign","Pénzeszközök",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_C","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_C",,"l10n_hu.account_financial_report_bs_hu_AC","Preserve balance sign","Aktív Időbeli Elhatárolások",,130,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_pl","Display children flat","Title 2 (bold)",,,"l10n_hu.account_financial_report_bs_hu_DG","Reverse balance sign","Számított eredmény","l10n_hu.account_financial_report_pl_hu",201,"Report Value"
|
||||
"l10n_hu.account_financial_report_bs_hu_D","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_D",,"l10n_hu.account_financial_report_bs_hu_DG","Reverse balance sign","Saját Tőke",,210,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_E","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_E",,"l10n_hu.account_financial_report_bs_hu_DG","Reverse balance sign","Céltartalékok",,220,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_F","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_F",,"l10n_hu.account_financial_report_bs_hu_DG","Reverse balance sign","Kötelezettségek",,230,"View"
|
||||
"l10n_hu.account_financial_report_bs_hu_FI","Display children with hierarchy","Normal Text","account_type_bs_hu_FI",,"l10n_hu.account_financial_report_bs_hu_F","Reverse balance sign","Hátrasorolt Kötelezettségek",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_FII","Display children with hierarchy","Normal Text","account_type_bs_hu_FII",,"l10n_hu.account_financial_report_bs_hu_F","Reverse balance sign","Hosszú Lejáratú Kötelezettségek",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_FIII","Display children with hierarchy","Normal Text","account_type_bs_hu_FIII",,"l10n_hu.account_financial_report_bs_hu_F","Reverse balance sign","Rövid Lejáratú Kötelezettségek",,10,"Account Type"
|
||||
"l10n_hu.account_financial_report_bs_hu_G","Display children with hierarchy","Title 2 (bold)","account_type_bs_hu_G",,"l10n_hu.account_financial_report_bs_hu_DG","Reverse balance sign","Passzív Időbeli Elhatárolások",,240,"Account Type"
|
|
|
@ -0,0 +1,23 @@
|
|||
"id","tax_src_id/id","tax_dest_id/id","position_id/id"
|
||||
"fiscal_position_hu_exempt_tax_F27","F27","FA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_exempt_tax_F18","F18","FA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_exempt_tax_F5","F5","FA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_exempt_tax_V27","V27","VA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_exempt_tax_V18","V18","VA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_exempt_tax_V5","V5","VA","fiscal_position_hu_exempt"
|
||||
"fiscal_position_hu_eu_tax_F27","F27","FEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_F18","F18","FEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_F5","F5","FEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_FA","FA","FEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_V27","V27","VEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_V18","V18","VEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_V5","V5","VEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_tax_VA","VA","VEU","fiscal_position_hu_eu"
|
||||
"fiscal_position_hu_eu_out_tax_F27","F27","FEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_F18","F18","FEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_F5","F5","FEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_FA","FA","FEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_V27","V27","VEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_V18","V18","VEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_V5","V5","VEUO","fiscal_position_hu_eu_out"
|
||||
"fiscal_position_hu_eu_out_tax_VA","VA","VEUO","fiscal_position_hu_eu_out"
|
|
|
@ -0,0 +1,4 @@
|
|||
"id","chart_template_id/id","name"
|
||||
"fiscal_position_hu_exempt","hungarian_chart_template","Alanyi adómentes"
|
||||
"fiscal_position_hu_eu","hungarian_chart_template","EU partner"
|
||||
"fiscal_position_hu_eu_out","hungarian_chart_template","EU-n kívüli partner"
|
|
|
@ -0,0 +1,26 @@
|
|||
"id","name","code","parent_id:id","notprintable","sign"
|
||||
"tax_code_hu_vat","Általános Forgalmi Adó","ÁFA",,,"1.0"
|
||||
"tax_code_hu_vat_base","ÁFA alap","ÁFA – alap","tax_code_hu_vat",,"1.0"
|
||||
"tax_code_hu_vat_position","ÁFA fizetndő / visszaigényelhető","ÁFA – fiz/vissz","tax_code_hu_vat",,"1.0"
|
||||
"tax_code_hu_1021","Adóalap - Fizetendő ÁFA 18%","06","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1011","Adóalap - Fizetendő ÁFA 27%","07","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1031","Adóalap - Fizetendő ÁFA 5%","05","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1041","Adóalap - Fizetendő ÁFA alanyi adómentes","04","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1051","Adóalap - Fizetendő ÁFA EU","02","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1061","Adóalap - Fizetendő ÁFA tárgyi adómentes","04","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1071","Adóalap - Fizetendő ÁFA Export","01","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1081","Adóalap – Fordított ÁFA","29","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1221","Adóalap - Visszaigényelhető ÁFA 18%","65","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1211","Adóalap - Visszaigényelhető ÁFA 27%","66","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1231","Adóalap - Visszaigényelhető ÁFA 5%","64","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1240","Adóalap - Visszaigényelhető ÁFA alanyi adómentes","63","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1260","Adóalap - Visszaigényelhető ÁFA tárgyi adómentes","63","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1250","Adóalap - Visszaigényelhető ÁFA EU","11","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1270","Adóalap – Import ÁFA","23","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1280","Adóalap – Fordított ÁFA","23","tax_code_hu_vat_base","FALSE","1.0"
|
||||
"tax_code_hu_1020","Fizetendő ÁFA 18%","06","tax_code_hu_vat_position","FALSE","1.0"
|
||||
"tax_code_hu_1010","Fizetendő ÁFA 27%","07","tax_code_hu_vat_position","FALSE","1.0"
|
||||
"tax_code_hu_1030","Fizetendő ÁFA 5%","05","tax_code_hu_vat_position","FALSE","1.0"
|
||||
"tax_code_hu_1220","Visszaigényelhető ÁFA 18%","65","tax_code_hu_vat_position","FALSE","-1.0"
|
||||
"tax_code_hu_1210","Visszaigényelhető ÁFA 27%","66","tax_code_hu_vat_position","FALSE","-1.0"
|
||||
"tax_code_hu_1230","Visszaigényelhető ÁFA 5%","64","tax_code_hu_vat_position","FALSE","-1.0"
|
|
|
@ -0,0 +1,17 @@
|
|||
"id","description","chart_template_id/id","type_tax_use","name","type","amount","account_collected_id/id","account_paid_id/id","base_code_id/id","tax_code_id/id","ref_base_code_id/id","ref_tax_code_id/id","tax_sign","base_sign","ref_base_sign","ref_tax_sign","parent_id:id","sequence","price_include"
|
||||
"F27","27%","hungarian_chart_template","sale","Fizetendő - 27%","percent",0.27,"chart_hu_467","chart_hu_467","tax_code_hu_1011","tax_code_hu_1010","tax_code_hu_1011","tax_code_hu_1010",1,1,-1,-1,,1,"False"
|
||||
"F18","18%","hungarian_chart_template","sale","Fizetendő – 18%","percent",0.18,"chart_hu_467","chart_hu_467","tax_code_hu_1021","tax_code_hu_1020","tax_code_hu_1021","tax_code_hu_1020",1,1,-1,-1,,2,"False"
|
||||
"F5","5%","hungarian_chart_template","sale","Fizetendő – 5%","percent",0.05,"chart_hu_467","chart_hu_467","tax_code_hu_1031","tax_code_hu_1030","tax_code_hu_1031","tax_code_hu_1030",1,1,-1,-1,,2,"False"
|
||||
"FA","AAM","hungarian_chart_template","sale","Fizetendő – Alanyi Adómentes","percent",0,"chart_hu_467","chart_hu_467","tax_code_hu_1041",,"tax_code_hu_1041",,1,1,-1,-1,,2,"False"
|
||||
"FT","TAM","hungarian_chart_template","sale","Fizetendő – Tárgyi Adómentes","percent",0,"chart_hu_467","chart_hu_467","tax_code_hu_1061",,"tax_code_hu_1061",,1,1,-1,-1,,2,"False"
|
||||
"FF","FORD","hungarian_chart_template","sale","Fizetendő – Fordított ÁFA","percent",0,"chart_hu_467","chart_hu_467","tax_code_hu_1081",,"tax_code_hu_1081",,1,1,-1,-1,,2,"False"
|
||||
"FEUO","Export","hungarian_chart_template","sale","Fizetendő – Export","percent",0,"chart_hu_467","chart_hu_467","tax_code_hu_1071",,"tax_code_hu_1071",,1,1,-1,-1,,2,"False"
|
||||
"FEU","EU","hungarian_chart_template","sale","Fizetendő – EU","percent",0,"chart_hu_467","chart_hu_467","tax_code_hu_1051",,"tax_code_hu_1051",,1,1,-1,-1,,2,"False"
|
||||
"V18","18%","hungarian_chart_template","purchase","Visszaigényelhető – 18%","percent",0.18,"chart_hu_466","chart_hu_466","tax_code_hu_1221","tax_code_hu_1220","tax_code_hu_1221","tax_code_hu_1220",1,1,-1,-1,,2,"False"
|
||||
"V27","27%","hungarian_chart_template","purchase","Visszaigényelhető – 27%","percent",0.27,"chart_hu_466","chart_hu_466","tax_code_hu_1211","tax_code_hu_1210","tax_code_hu_1211","tax_code_hu_1210",1,1,-1,-1,,1,"False"
|
||||
"V5","5%","hungarian_chart_template","purchase","Visszaigényelhető – 5%","percent",0.05,"chart_hu_466","chart_hu_466","tax_code_hu_1231","tax_code_hu_1230","tax_code_hu_1231","tax_code_hu_1230",1,1,-1,-1,,2,"False"
|
||||
"VA","AAM","hungarian_chart_template","purchase","Visszaigényelhető – Alanyi Adómentes","percent",0,"chart_hu_466","chart_hu_466","tax_code_hu_1240",,"tax_code_hu_1240",,1,1,-1,-1,,2,"False"
|
||||
"VT","TAM","hungarian_chart_template","purchase","Visszaigényelhető – Tárgyi Adómentes","percent",0,"chart_hu_466","chart_hu_466","tax_code_hu_1260",,"tax_code_hu_1260",,1,1,-1,-1,,2,"False"
|
||||
"VEU","EU","hungarian_chart_template","purchase","Visszaigényelhető – EU","percent",0,"chart_hu_466","chart_hu_466","tax_code_hu_1250",,"tax_code_hu_1250",,1,1,-1,-1,,2,"False"
|
||||
"VEUO","Import","hungarian_chart_template","purchase","Visszaigényelhető – Import","percent",0,"chart_hu_466","chart_hu_466","tax_code_hu_1270",,"tax_code_hu_1270",,1,1,-1,-1,,2,"False"
|
||||
"VF","FORD","hungarian_chart_template","purchase","Visszaigényelhető – Fordított ÁFA","percent",0,"chart_hu_466","chart_hu_466","tax_code_hu_1280",,"tax_code_hu_1280",,1,1,-1,-1,,2,"False"
|
|
|
@ -0,0 +1,22 @@
|
|||
"id","name","bic","country/id","zip","city","street","email","phone","fax"
|
||||
"BKCHHUHBXXX","Bank of China (Hungária) Hitelintézet Rt.","BKCHHUHBXXX","base.hu",1051,"Budapest","József Nádor tér 7.","service_hu@bank-of-china.com","+3614299200","+3614299201"
|
||||
"BNPAHUHX","BNP Paribas Hungária Bank Rt.","BNPAHUHX","base.hu",1051,"Budapest","Széchenyi István tér 7-8.",,"+3613746300",
|
||||
"BUDAHUHB","Budapest Hitel- és Fejlesztési Bank Rt.","BUDAHUHB","base.hu",1138,"Budapest","Váci út 188."," info@budapestbank.hu","+3614506060","+3614506062"
|
||||
"CIBHHUHB","CIB Közép-Európai Nemzetközi Bank Zrt.","CIBHHUHB","base.hu",1027,"Budapest","Medve utca 4-14.","cib@cib.hu","+3614231000",
|
||||
"CITIHUHX","Citibank Rt.","CITIHUHX","base.hu",1051,"Budapest","Szabadság tér 7.",,"+3613745000","+3613745100"
|
||||
"COBAHUHX","Commerzbank Zártkörűen Működő Rt.","COBAHUHX","base.hu",1054,"Budapest","Széchenyi rakpart 8.","info.budapest@commerzbank.com","+3613748100","+3612694574"
|
||||
"DEUTHU2B","Deutsche Bank Zártkörűen Működő Rt.","DEUTHU2B","base.hu",1054,"Budapest","Hold utca 27.","db.hungary@db.com","+3613013700","+3612693239"
|
||||
"GIBAHUHB","ERSTE Bank Hungary Zrt.","GIBAHUHB","base.hu",1138,"Budapest","Népfürdő u. 24-26.","erste@erstebank.hu","+3640222221","+3612194766"
|
||||
"FHKBHUHB","FHB Kereskedelmi Bank Zrt.","FHKBHUHB","base.hu",1082,"Budapest","Üllői út 48."," info@fhb.hu","+3614529100","+3614529200"
|
||||
"GNBAHUHB","Gránit Bank Zrt.","GNBAHUHB","base.hu",1095,"Budapest","Lechner Ödön fasor 8.","info@granitbank.hu","+3640100777","+3612355906"
|
||||
"INCNHUHB","IC Bank Rt.","INCNHUHB","base.hu",1088,"Budapest","Rákóczi út 1-3."," level@bancopopolare.hu ","+3640200515","+3612666815"
|
||||
"INGBHUHB","ING Bank N.V. Magyarországi Fióktelepe","INGBHUHB","base.hu",1068,"Budapest","Dózsa György út 84.","communications.hu@ingbank.com","+362680140","+362680159"
|
||||
"OKHBHUHB","K&H Bank Zrt.","OKHBHUHB","base.hu",1095,"Budapest","Lechner Ödön fasor 9."," bank@kh.hu ","+3613289000","+3613289696"
|
||||
"HBWEHUHB","MagNet Magyar Közösségi Bank Zrt.","HBWEHUHB","base.hu",1062,"Budapest","Andrássy utca 98.","info@magnetbank.hu","+3614288888","+3614288889"
|
||||
"MANEHUHB","Magyar Nemzeti Bank","MANEHUHB","base.hu",1054,"Budapest","Szabadság tér 8-9.","info@mnb.hu","+3614282600","+3614298000"
|
||||
"MKKBHUHB","MKB Bank Zrt.","MKKBHUHB","base.hu",1056,"Budapest","Váci utca 38.","telebankar@mkb.hu","+3613278600","+3613278700"
|
||||
"OTPVHUHB","OTP Bank Nyrt.","OTPVHUHB","base.hu",1051,"Budapest","Nádor utca 16.",,"+3614735000","+3614735955"
|
||||
"UBRTHUHB","RAIFFEISEN Bank Zrt.","UBRTHUHB","base.hu",1054,"Budapest","Akadémia utca 6.",,"+3640484848",
|
||||
"MAVOHUHB","Sberbank Magyarország Zrt.","MAVOHUHB","base.hu",1088,"Budapest","Rákóczi út 7.","info@sberbank.hu","+3614114200","+3613286660"
|
||||
"TAKBHUHB","TakarékBank Zrt.","TAKBHUHB","base.hu",1122,"Budapest","Pethényi köz 10.","info@tbank.hu","+3612023777",
|
||||
"BACXHUHB","UniCredit Bank Hungary Zrt.","BACXHUHB","base.hu",1054,"Budapest","Szabadság tér 5-6.","info@unicreditgroup.hu","+3613011271","+3613534959"
|
|
|
@ -3202,8 +3202,8 @@
|
|||
<field name="property_account_payable" ref="chart221000000"/>
|
||||
<field name="property_account_expense_categ" ref="chart330020000"/>
|
||||
<field name="property_account_income_categ" ref="chart773010000"/>
|
||||
<field name="currency_id" ref="base.PLZ"/>
|
||||
<field name="currency_id" ref="base.PLN"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
|
@ -4587,7 +4587,7 @@
|
|||
<field name="property_account_payable" ref="ro_pcg_pay"/> <!-- 4011 -->
|
||||
<field name="property_account_expense_categ" ref="ro_pcg_expense"/> <!-- 607 -->
|
||||
<field name="property_account_income_categ" ref="ro_pcg_sale"/> <!-- 707 -->
|
||||
<field name="currency_id" ref="base.ROL"/>
|
||||
<field name="currency_id" ref="base.RON"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
"id","name","account_root_id/id","tax_code_root_id/id","bank_account_view_id/id","property_account_receivable/id","property_account_payable/id","property_account_expense_categ/id","property_account_income_categ/id"
|
||||
"gd_chart","Kontni načrt za gospodarske družbe","gd_acc","gd_taxc","gd_acc_110","gd_acc_120000","gd_acc_220000","gd_acc_702000","gd_acc_762000"
|
||||
"id","name","account_root_id/id","tax_code_root_id/id","bank_account_view_id/id","property_account_receivable/id","property_account_payable/id","property_account_expense_categ/id","property_account_income_categ/id","currency_id/id"
|
||||
"gd_chart","Kontni načrt za gospodarske družbe","gd_acc","gd_taxc","gd_acc_110","gd_acc_120000","gd_acc_220000","gd_acc_702000","gd_acc_762000","base.EUR"
|
||||
|
||||
|
|
|
|
@ -1806,28 +1806,7 @@
|
|||
<field name="user_type" ref="l10n_syscohada.account_type_special" />
|
||||
<field name="parent_id" ref="pcg_classe_9" />
|
||||
</record>
|
||||
<!--
|
||||
#
|
||||
# SYSCOHADA : Définition de la devise de référence
|
||||
# Auteur : BAAMTU Sénégal
|
||||
# Version du fichier : 1.0
|
||||
# Date : 02/2010
|
||||
#
|
||||
#
|
||||
-->
|
||||
|
||||
<record id="base.XOF" model="res.currency">
|
||||
<field name="name">XOF</field>
|
||||
<field name="symbol">CFA</field>
|
||||
<field name="rounding">1</field>
|
||||
<field name="accuracy">4</field>
|
||||
</record>
|
||||
<record id="base.rateXOF" model="res.currency.rate">
|
||||
<field name="rate">655.957</field>
|
||||
<field name="currency_id" ref="base.XOF"/>
|
||||
<field eval="time.strftime('%Y-01-01')" name="name"/>
|
||||
</record>
|
||||
<!--
|
||||
<!--
|
||||
#
|
||||
# SYSCOHADA : Définition des taux de TVA SYSCOHADA
|
||||
# Auteur : BAAMTU Sénégal
|
||||
|
|
|
@ -32,7 +32,7 @@ This is the latest UK OpenERP localisation necessary to run OpenERP accounting f
|
|||
- a few other adaptations""",
|
||||
'author': 'SmartMode LTD',
|
||||
'website': 'http://www.smartmode.co.uk',
|
||||
'depends': ['base_iban', 'base_vat', 'account_chart'],
|
||||
'depends': ['base_iban', 'base_vat', 'account_chart', 'account_anglo_saxon'],
|
||||
'data': [
|
||||
'data/account.account.type.csv',
|
||||
'data/account.account.template.csv',
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id"
|
||||
"l10n_uk","UK Tax and Account Chart Template (by SmartMode)","UK0","0","1200","1100","2100","5000","4000"
|
||||
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id","currency_id:id"
|
||||
"l10n_uk","UK Tax and Account Chart Template (by SmartMode)","UK0","0","1200","1100","2100","5000","4000","base.GBP"
|
||||
|
|
|
|
@ -28,7 +28,7 @@ United States - Chart of accounts.
|
|||
==================================
|
||||
""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['account_chart'],
|
||||
'depends': ['account_chart', 'account_anglo_saxon'],
|
||||
'data': [
|
||||
'l10n_us_account_type.xml',
|
||||
'account_chart_template.xml',
|
||||
|
|
|
@ -1895,7 +1895,7 @@
|
|||
<field name="property_account_payable" ref="uy_code_21100"/>
|
||||
<field name="property_account_income_categ" ref="uy_code_4100"/>
|
||||
<field name="property_account_expense_categ" ref="uy_code_5100"/>
|
||||
<field name="currency_id" ref="base.UYP"/>
|
||||
<field name="currency_id" ref="base.UYU"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -3315,7 +3315,7 @@
|
|||
<field name="property_account_payable" ref="account_activa_account_2122001"/>
|
||||
<field name="property_account_expense_categ" ref="account_activa_account_7151001"/>
|
||||
<field name="property_account_income_categ" ref="account_activa_account_5111001"/>
|
||||
<field name="currency_id" ref="base.VUB"/>
|
||||
<field name="currency_id" ref="base.VEF"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -175,8 +175,13 @@ class mail_notification(osv.Model):
|
|||
# compute email references
|
||||
references = message.parent_id.message_id if message.parent_id else False
|
||||
|
||||
# custom values
|
||||
custom_values = dict()
|
||||
if message.model and message.res_id and self.pool.get(message.model) and hasattr(self.pool[message.model], 'message_get_email_values'):
|
||||
custom_values = self.pool[message.model].message_get_email_values(cr, uid, message.res_id, message, context=context)
|
||||
|
||||
# create email values
|
||||
max_recipients = 100
|
||||
max_recipients = 50
|
||||
chunks = [email_pids[x:x + max_recipients] for x in xrange(0, len(email_pids), max_recipients)]
|
||||
email_ids = []
|
||||
for chunk in chunks:
|
||||
|
@ -187,8 +192,9 @@ class mail_notification(osv.Model):
|
|||
'recipient_ids': [(4, id) for id in chunk],
|
||||
'references': references,
|
||||
}
|
||||
mail_values.update(custom_values)
|
||||
email_ids.append(self.pool.get('mail.mail').create(cr, uid, mail_values, context=context))
|
||||
if force_send and len(chunks) < 6: # for more than 500 followers, use the queue system
|
||||
if force_send and len(chunks) < 2: # for more than 50 followers, use the queue system
|
||||
self.pool.get('mail.mail').send(cr, uid, email_ids, context=context)
|
||||
return True
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import openerp
|
|||
import openerp.tools as tools
|
||||
from openerp.osv import osv
|
||||
from openerp.osv import fields
|
||||
from openerp.tools.safe_eval import safe_eval as eval
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
|
||||
|
@ -211,3 +212,17 @@ class mail_group(osv.Model):
|
|||
return []
|
||||
else:
|
||||
return super(mail_group, self).get_suggested_thread(cr, uid, removed_suggested_threads, context)
|
||||
|
||||
def message_get_email_values(self, cr, uid, id, notif_mail=None, context=None):
|
||||
res = super(mail_group, self).message_get_email_values(cr, uid, id, notif_mail=notif_mail, context=context)
|
||||
group = self.browse(cr, uid, id, context=context)
|
||||
try:
|
||||
headers = eval(res.get('headers', '{}'))
|
||||
except Exception:
|
||||
headers = {}
|
||||
headers['Precedence'] = 'list'
|
||||
if group.alias_domain and group.alias_name:
|
||||
headers['List-Id'] = '%s.%s' % (group.alias_name, group.alias_domain)
|
||||
headers['List-Post'] = '<mailto:%s@%s>' % (group.alias_name, group.alias_domain)
|
||||
res['headers'] = '%s' % headers
|
||||
return res
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
import base64
|
||||
import logging
|
||||
import re
|
||||
from urllib import urlencode
|
||||
from urlparse import urljoin
|
||||
|
||||
from openerp import tools
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.safe_eval import safe_eval as eval
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
@ -59,6 +59,7 @@ class mail_mail(osv.Model):
|
|||
'recipient_ids': fields.many2many('res.partner', string='To (Partners)'),
|
||||
'email_cc': fields.char('Cc', help='Carbon copy message recipients'),
|
||||
'body_html': fields.text('Rich-text Contents', help="Rich-text/HTML message"),
|
||||
'headers': fields.text('Headers'),
|
||||
# Auto-detected based on create() - if 'mail_message_id' was passed then this mail is a notification
|
||||
# and during unlink() we will not cascade delete the parent and its attachments
|
||||
'notification': fields.boolean('Is Notification',
|
||||
|
@ -67,6 +68,7 @@ class mail_mail(osv.Model):
|
|||
|
||||
_defaults = {
|
||||
'state': 'outgoing',
|
||||
'headers': '{}',
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
|
@ -186,11 +188,8 @@ class mail_mail(osv.Model):
|
|||
- if 'partner' and mail is a notification on a document: followers (Followers of 'Doc' <email>)
|
||||
- elif 'partner', no notificatoin or no doc: recipient specific (Partner Name <email>)
|
||||
- else fallback on mail.email_to splitting """
|
||||
if partner and mail.notification and mail.record_name:
|
||||
sanitized_record_name = re.sub(r'[^\w+.]+', '-', mail.record_name)
|
||||
email_to = [_('"Followers of %s" <%s>') % (sanitized_record_name, partner.email)]
|
||||
elif partner:
|
||||
email_to = ['%s <%s>' % (partner.name, partner.email)]
|
||||
if partner:
|
||||
email_to = ['"%s" <%s>' % (partner.name, partner.email)]
|
||||
else:
|
||||
email_to = tools.email_split(mail.email_to)
|
||||
return email_to
|
||||
|
@ -204,12 +203,13 @@ class mail_mail(osv.Model):
|
|||
"""
|
||||
body = self.send_get_mail_body(cr, uid, mail, partner=partner, context=context)
|
||||
body_alternative = tools.html2plaintext(body)
|
||||
return {
|
||||
res = {
|
||||
'body': body,
|
||||
'body_alternative': body_alternative,
|
||||
'subject': self.send_get_mail_subject(cr, uid, mail, partner=partner, context=context),
|
||||
'email_to': self.send_get_mail_to(cr, uid, mail, partner=partner, context=context),
|
||||
}
|
||||
return res
|
||||
|
||||
def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None):
|
||||
""" Sends the selected emails immediately, ignoring their current
|
||||
|
@ -264,6 +264,11 @@ class mail_mail(osv.Model):
|
|||
headers['Return-Path'] = '%s-%d-%s-%d@%s' % (bounce_alias, mail.id, mail.model, mail.res_id, catchall_domain)
|
||||
else:
|
||||
headers['Return-Path'] = '%s-%d@%s' % (bounce_alias, mail.id, catchall_domain)
|
||||
if mail.headers:
|
||||
try:
|
||||
headers.update(eval(mail.headers))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# build an RFC2822 email.message.Message object and send it without queuing
|
||||
res = None
|
||||
|
|
|
@ -34,26 +34,19 @@
|
|||
</page>
|
||||
<page string="Advanced" groups="base.group_no_one">
|
||||
<group>
|
||||
<div>
|
||||
<group string="Status">
|
||||
<field name="auto_delete"/>
|
||||
<field name="notification"/>
|
||||
<field name="type"/>
|
||||
<field name="mail_server_id"/>
|
||||
<field name="model"/>
|
||||
<field name="res_id"/>
|
||||
</group>
|
||||
</div>
|
||||
<div>
|
||||
<group string="Headers">
|
||||
<field name="message_id"/>
|
||||
<field name="references"/>
|
||||
</group>
|
||||
<group string="Recipients">
|
||||
<field name="partner_ids" widget="many2many_tags"/>
|
||||
<field name="notified_partner_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</div>
|
||||
<group string="Status">
|
||||
<field name="auto_delete"/>
|
||||
<field name="notification"/>
|
||||
<field name="type"/>
|
||||
<field name="mail_server_id"/>
|
||||
<field name="model"/>
|
||||
<field name="res_id"/>
|
||||
</group>
|
||||
<group string="Headers">
|
||||
<field name="message_id"/>
|
||||
<field name="references"/>
|
||||
<field name="headers"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
##############################################################################
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
||||
from openerp import tools
|
||||
|
||||
|
@ -131,6 +130,8 @@ class mail_message(osv.Model):
|
|||
help="Email address of the sender. This field is set when no matching partner is found for incoming emails."),
|
||||
'reply_to': fields.char('Reply-To',
|
||||
help='Reply email address. Setting the reply_to bypasses the automatic thread creation.'),
|
||||
'same_thread': fields.boolean('Same thread',
|
||||
help='Redirect answers to the same discussion thread.'),
|
||||
'author_id': fields.many2one('res.partner', 'Author', select=1,
|
||||
ondelete='set null',
|
||||
help="Author of the message. If not set, email_from may hold an email address that did not match any partner."),
|
||||
|
@ -188,6 +189,7 @@ class mail_message(osv.Model):
|
|||
'author_id': lambda self, cr, uid, ctx=None: self._get_default_author(cr, uid, ctx),
|
||||
'body': '',
|
||||
'email_from': lambda self, cr, uid, ctx=None: self._get_default_from(cr, uid, ctx),
|
||||
'same_thread': True,
|
||||
}
|
||||
|
||||
#------------------------------------------------------
|
||||
|
@ -766,42 +768,12 @@ class mail_message(osv.Model):
|
|||
""" Return a specific reply_to: alias of the document through message_get_reply_to
|
||||
or take the email_from
|
||||
"""
|
||||
email_reply_to = None
|
||||
|
||||
ir_config_parameter = self.pool.get("ir.config_parameter")
|
||||
catchall_domain = ir_config_parameter.get_param(cr, uid, "mail.catchall.domain", context=context)
|
||||
|
||||
# model, res_id, email_from: comes from values OR related message
|
||||
model, res_id, email_from = values.get('model'), values.get('res_id'), values.get('email_from')
|
||||
|
||||
# if model and res_id: try to use ``message_get_reply_to`` that returns the document alias
|
||||
if not email_reply_to and model and res_id and catchall_domain and hasattr(self.pool[model], 'message_get_reply_to'):
|
||||
email_reply_to = self.pool[model].message_get_reply_to(cr, uid, [res_id], context=context)[0]
|
||||
# no alias reply_to -> catchall alias
|
||||
if not email_reply_to and catchall_domain:
|
||||
catchall_alias = ir_config_parameter.get_param(cr, uid, "mail.catchall.alias", context=context)
|
||||
if catchall_alias:
|
||||
email_reply_to = '%s@%s' % (catchall_alias, catchall_domain)
|
||||
# still no reply_to -> reply_to will be the email_from
|
||||
if not email_reply_to and email_from:
|
||||
email_reply_to = email_from
|
||||
|
||||
# format 'Document name <email_address>'
|
||||
if email_reply_to and model and res_id:
|
||||
emails = tools.email_split(email_reply_to)
|
||||
if emails:
|
||||
email_reply_to = emails[0]
|
||||
document_name = self.pool[model].name_get(cr, SUPERUSER_ID, [res_id], context=context)[0]
|
||||
if document_name:
|
||||
# sanitize document name
|
||||
sanitized_doc_name = re.sub(r'[^\w+.]+', '-', document_name[1])
|
||||
# generate reply to
|
||||
email_reply_to = _('"Followers of %s" <%s>') % (sanitized_doc_name, email_reply_to)
|
||||
|
||||
return email_reply_to
|
||||
ctx = dict(context, thread_model=model)
|
||||
return self.pool['mail.thread'].message_get_reply_to(cr, uid, [res_id], default=email_from, context=ctx)[res_id]
|
||||
|
||||
def _get_message_id(self, cr, uid, values, context=None):
|
||||
if values.get('reply_to'):
|
||||
if values.get('same_thread', True) is False:
|
||||
message_id = tools.generate_tracking_message_id('reply_to')
|
||||
elif values.get('res_id') and values.get('model'):
|
||||
message_id = tools.generate_tracking_message_id('%(res_id)s-%(model)s' % values)
|
||||
|
|
|
@ -100,13 +100,21 @@
|
|||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div t-attf-class="oe_attachment" t-if="record.file_type_icon.value != 'webimage'">
|
||||
<img t-att-src="'/mail/static/src/img/mimetypes/' + record.file_type_icon.value + '.png'"></img>
|
||||
<div class='oe_name'><t t-raw='record.name.value' />bb</div>
|
||||
</div>
|
||||
<div t-attf-class="oe_attachment oe_preview" t-if="record.file_type_icon.value == 'webimage'">
|
||||
<img t-att-src="kanban_image('ir.attachment', 'datas', record.id.value)" class="oe_kanban_image"/>
|
||||
<div class='oe_name'><t t-raw='record.name.value' />aa</div>
|
||||
<div class="oe_kanban_vignette">
|
||||
<div class="oe_attachment">
|
||||
<div t-if="record.file_type_icon.value != 'webimage'">
|
||||
<img t-att-src="'/mail/static/src/img/mimetypes/' + record.file_type_icon.value + '.png'"></img>
|
||||
</div>
|
||||
<div t-if="record.file_type_icon.value == 'webimage' and !record.url.value">
|
||||
<img t-att-src="kanban_image('ir.attachment', 'datas', record.id.value)"/>
|
||||
</div>
|
||||
<div t-if="record.file_type_icon.value and record.url.value">
|
||||
<img t-att-src="record.url.value"/>
|
||||
</div>
|
||||
<div class="oe_name">
|
||||
<field name="name"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
|
|
@ -31,9 +31,11 @@ except ImportError:
|
|||
from lxml import etree
|
||||
import logging
|
||||
import pytz
|
||||
import re
|
||||
import socket
|
||||
import time
|
||||
import xmlrpclib
|
||||
import re
|
||||
from email.message import Message
|
||||
from urllib import urlencode
|
||||
|
||||
|
@ -48,6 +50,8 @@ from openerp.tools.translate import _
|
|||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
mail_header_msgid_re = re.compile('<[^<>]+>')
|
||||
|
||||
def decode_header(message, header, separator=' '):
|
||||
return separator.join(map(decode, filter(None, message.get_all(header, []))))
|
||||
|
||||
|
@ -685,14 +689,56 @@ class mail_thread(osv.AbstractModel):
|
|||
res[record.id] = {'partner_ids': list(recipient_ids), 'email_to': email_to, 'email_cc': email_cc}
|
||||
return res
|
||||
|
||||
def message_get_reply_to(self, cr, uid, ids, context=None):
|
||||
def message_get_reply_to(self, cr, uid, ids, default=None, context=None):
|
||||
""" Returns the preferred reply-to email address that is basically
|
||||
the alias of the document, if it exists. """
|
||||
if not self._inherits.get('mail.alias'):
|
||||
return [False for id in ids]
|
||||
return ["%s@%s" % (record.alias_name, record.alias_domain)
|
||||
if record.alias_domain and record.alias_name else False
|
||||
for record in self.browse(cr, SUPERUSER_ID, ids, context=context)]
|
||||
if context is None:
|
||||
context = {}
|
||||
model_name = context.get('thread_model') or self._name
|
||||
alias_domain = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.domain", context=context)
|
||||
res = dict.fromkeys(ids, False)
|
||||
|
||||
# alias domain: check for aliases and catchall
|
||||
aliases = {}
|
||||
doc_names = {}
|
||||
if alias_domain:
|
||||
if model_name and model_name != 'mail.thread':
|
||||
alias_ids = self.pool['mail.alias'].search(
|
||||
cr, SUPERUSER_ID, [
|
||||
('alias_parent_model_id.model', '=', model_name),
|
||||
('alias_parent_thread_id', 'in', ids),
|
||||
('alias_name', '!=', False)
|
||||
], context=context)
|
||||
aliases.update(
|
||||
dict((alias.alias_parent_thread_id, '%s@%s' % (alias.alias_name, alias_domain))
|
||||
for alias in self.pool['mail.alias'].browse(cr, SUPERUSER_ID, alias_ids, context=context)))
|
||||
doc_names.update(
|
||||
dict((ng_res[0], ng_res[1])
|
||||
for ng_res in self.pool[model_name].name_get(cr, SUPERUSER_ID, aliases.keys(), context=context)))
|
||||
# left ids: use catchall
|
||||
left_ids = set(ids).difference(set(aliases.keys()))
|
||||
if left_ids:
|
||||
catchall_alias = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.alias", context=context)
|
||||
if catchall_alias:
|
||||
aliases.update(dict((res_id, '%s@%s' % (catchall_alias, alias_domain)) for res_id in left_ids))
|
||||
# compute name of reply-to
|
||||
company_name = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context).company_id.name
|
||||
res.update(
|
||||
dict((res_id, '"%(company_name)s%(document_name)s" <%(email)s>' %
|
||||
{'company_name': company_name,
|
||||
'document_name': doc_names.get(res_id) and ' ' + re.sub(r'[^\w+.]+', '-', doc_names[res_id]) or '',
|
||||
'email': aliases[res_id]
|
||||
} or False) for res_id in aliases.keys()))
|
||||
left_ids = set(ids).difference(set(aliases.keys()))
|
||||
if left_ids and default:
|
||||
res.update(dict((res_id, default) for res_id in left_ids))
|
||||
return res
|
||||
|
||||
def message_get_email_values(self, cr, uid, id, notif_mail=None, context=None):
|
||||
""" Get specific notification email values to store on the notification
|
||||
mail_mail. Void method, inherit it to add custom values. """
|
||||
res = dict()
|
||||
return res
|
||||
|
||||
#------------------------------------------------------
|
||||
# Mail gateway
|
||||
|
@ -1301,13 +1347,13 @@ class mail_thread(osv.AbstractModel):
|
|||
msg_dict['date'] = stored_date.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
||||
if message.get('In-Reply-To'):
|
||||
parent_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', '=', decode(message['In-Reply-To']))])
|
||||
parent_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', '=', decode(message['In-Reply-To'].strip()))])
|
||||
if parent_ids:
|
||||
msg_dict['parent_id'] = parent_ids[0]
|
||||
|
||||
if message.get('References') and 'parent_id' not in msg_dict:
|
||||
parent_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', 'in',
|
||||
[x.strip() for x in decode(message['References']).split()])])
|
||||
msg_list = mail_header_msgid_re.findall(decode(message['References']))
|
||||
parent_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', 'in', [x.strip() for x in msg_list])])
|
||||
if parent_ids:
|
||||
msg_dict['parent_id'] = parent_ids[0]
|
||||
|
||||
|
|
|
@ -449,8 +449,8 @@ class test_mail(TestMail):
|
|||
'message_post: mail.mail notifications should have been auto-deleted!')
|
||||
|
||||
# Test: notifications emails: to a and b, c is email only, r is author
|
||||
# test_emailto = ['Administrator <a@a>', 'Bert Tartopoils <b@b>']
|
||||
test_emailto = ['"Followers of -Pigs-" <a@a>', '"Followers of -Pigs-" <b@b>']
|
||||
test_emailto = ['"Administrator" <a@a>', '"Bert Tartopoils" <b@b>']
|
||||
# test_emailto = ['"Followers of -Pigs-" <a@a>', '"Followers of -Pigs-" <b@b>']
|
||||
self.assertEqual(len(sent_emails), 2,
|
||||
'message_post: notification emails wrong number of send emails')
|
||||
self.assertEqual(set([m['email_to'][0] for m in sent_emails]), set(test_emailto),
|
||||
|
@ -462,7 +462,7 @@ class test_mail(TestMail):
|
|||
'message_post: notification email sent to more than one email address instead of a precise partner')
|
||||
self.assertIn(sent_email['email_to'][0], test_emailto,
|
||||
'message_post: notification email email_to incorrect')
|
||||
self.assertEqual(sent_email['reply_to'], '"Followers of -Pigs-" <group+pigs@schlouby.fr>',
|
||||
self.assertEqual(sent_email['reply_to'], '"YourCompany -Pigs-" <group+pigs@schlouby.fr>',
|
||||
'message_post: notification email reply_to incorrect')
|
||||
self.assertEqual(_subject, sent_email['subject'],
|
||||
'message_post: notification email subject incorrect')
|
||||
|
@ -523,8 +523,8 @@ class test_mail(TestMail):
|
|||
self.assertFalse(self.mail_mail.search(cr, uid, [('mail_message_id', '=', msg2_id)]), 'mail.mail notifications should have been auto-deleted!')
|
||||
|
||||
# Test: emails send by server (to a, b, c, d)
|
||||
# test_emailto = [u'Administrator <a@a>', u'Bert Tartopoils <b@b>', u'Carine Poilvache <c@c>', u'D\xe9d\xe9 Grosbedon <d@d>']
|
||||
test_emailto = [u'"Followers of Pigs" <a@a>', u'"Followers of Pigs" <b@b>', u'"Followers of Pigs" <c@c>', u'"Followers of Pigs" <d@d>']
|
||||
test_emailto = [u'"Administrator" <a@a>', u'"Bert Tartopoils" <b@b>', u'"Carine Poilvache" <c@c>', u'"D\xe9d\xe9 Grosbedon" <d@d>']
|
||||
# test_emailto = [u'"Followers of Pigs" <a@a>', u'"Followers of Pigs" <b@b>', u'"Followers of Pigs" <c@c>', u'"Followers of Pigs" <d@d>']
|
||||
# self.assertEqual(len(sent_emails), 3, 'sent_email number of sent emails incorrect')
|
||||
for sent_email in sent_emails:
|
||||
self.assertEqual(sent_email['email_from'], 'Raoul Grosbedon <r@r>',
|
||||
|
|
|
@ -81,8 +81,7 @@ class TestMailMessage(TestMail):
|
|||
alias_domain = 'schlouby.fr'
|
||||
raoul_from = 'Raoul Grosbedon <raoul@raoul.fr>'
|
||||
raoul_from_alias = 'Raoul Grosbedon <raoul@schlouby.fr>'
|
||||
raoul_reply = '"Followers of Pigs" <raoul@raoul.fr>'
|
||||
raoul_reply_alias = '"Followers of Pigs" <group+pigs@schlouby.fr>'
|
||||
raoul_reply_alias = '"YourCompany Pigs" <group+pigs@schlouby.fr>'
|
||||
|
||||
# --------------------------------------------------
|
||||
# Case1: without alias_domain
|
||||
|
@ -91,7 +90,7 @@ class TestMailMessage(TestMail):
|
|||
self.registry('ir.config_parameter').unlink(cr, uid, param_ids)
|
||||
|
||||
# Do: free message; specified values > default values
|
||||
msg_id = self.mail_message.create(cr, user_raoul_id, {'reply_to': reply_to1, 'email_from': email_from1})
|
||||
msg_id = self.mail_message.create(cr, user_raoul_id, {'same_thread': False, 'reply_to': reply_to1, 'email_from': email_from1})
|
||||
msg = self.mail_message.browse(cr, user_raoul_id, msg_id)
|
||||
# Test: message content
|
||||
self.assertIn('reply_to', msg.message_id,
|
||||
|
@ -118,7 +117,7 @@ class TestMailMessage(TestMail):
|
|||
'mail_message: message_id should contain model')
|
||||
self.assertIn('%s' % self.group_pigs_id, msg.message_id,
|
||||
'mail_message: message_id should contain res_id')
|
||||
self.assertEqual(msg.reply_to, raoul_reply,
|
||||
self.assertEqual(msg.reply_to, raoul_from,
|
||||
'mail_message: incorrect reply_to: should be Raoul')
|
||||
self.assertEqual(msg.email_from, raoul_from,
|
||||
'mail_message: incorrect email_from: should be Raoul')
|
||||
|
@ -152,7 +151,7 @@ class TestMailMessage(TestMail):
|
|||
msg_id = self.mail_message.create(cr, user_raoul_id, {})
|
||||
msg = self.mail_message.browse(cr, user_raoul_id, msg_id)
|
||||
# Test: generated reply_to
|
||||
self.assertEqual(msg.reply_to, 'gateway@schlouby.fr',
|
||||
self.assertEqual(msg.reply_to, '"YourCompany" <gateway@schlouby.fr>',
|
||||
'mail_mail: reply_to should equal the catchall email alias')
|
||||
|
||||
# Do: create a mail_mail
|
||||
|
|
|
@ -121,16 +121,12 @@ class mail_compose_message(osv.TransientModel):
|
|||
# mass mode options
|
||||
'notify': fields.boolean('Notify followers',
|
||||
help='Notify followers of the document (mass post only)'),
|
||||
'same_thread': fields.boolean('Replies in the document',
|
||||
help='Replies to the messages will go into the selected document (mass mail only)'),
|
||||
}
|
||||
#TODO change same_thread to False in trunk (Require view update)
|
||||
_defaults = {
|
||||
'composition_mode': 'comment',
|
||||
'body': lambda self, cr, uid, ctx={}: '',
|
||||
'subject': lambda self, cr, uid, ctx={}: False,
|
||||
'partner_ids': lambda self, cr, uid, ctx={}: [],
|
||||
'same_thread': True,
|
||||
}
|
||||
|
||||
def check_access_rule(self, cr, uid, ids, operation, context=None):
|
||||
|
@ -251,6 +247,10 @@ class mail_compose_message(osv.TransientModel):
|
|||
# render all template-based value at once
|
||||
if mass_mail_mode and wizard.model:
|
||||
rendered_values = self.render_message_batch(cr, uid, wizard, res_ids, context=context)
|
||||
# compute alias-based reply-to in batch
|
||||
reply_to_value = dict.fromkeys(res_ids, None)
|
||||
if mass_mail_mode and wizard.same_thread:
|
||||
reply_to_value = self.pool['mail.thread'].message_get_reply_to(cr, uid, res_ids, default=wizard.email_from, context=dict(context, thread_model=wizard.model))
|
||||
|
||||
for res_id in res_ids:
|
||||
# static wizard (mail.message) values
|
||||
|
@ -267,10 +267,7 @@ class mail_compose_message(osv.TransientModel):
|
|||
# mass mailing: rendering override wizard static values
|
||||
if mass_mail_mode and wizard.model:
|
||||
# always keep a copy, reset record name (avoid browsing records)
|
||||
mail_values.update(notification=True, record_name=False)
|
||||
if hasattr(self.pool[wizard.model], 'message_new'):
|
||||
mail_values['model'] = wizard.model
|
||||
mail_values['res_id'] = res_id
|
||||
mail_values.update(notification=True, model=wizard.model, res_id=res_id, record_name=False)
|
||||
# auto deletion of mail_mail
|
||||
if 'mail_auto_delete' in context:
|
||||
mail_values['auto_delete'] = context.get('mail_auto_delete')
|
||||
|
@ -280,7 +277,9 @@ class mail_compose_message(osv.TransientModel):
|
|||
mail_values.update(email_dict)
|
||||
if wizard.same_thread:
|
||||
mail_values.pop('reply_to')
|
||||
elif not mail_values.get('reply_to'):
|
||||
if reply_to_value.get(res_id):
|
||||
mail_values['reply_to'] = reply_to_value[res_id]
|
||||
if not wizard.same_thread and not mail_values.get('reply_to'):
|
||||
mail_values['reply_to'] = mail_values['email_from']
|
||||
# mail_mail values: body -> body_html, partner_ids -> recipient_ids
|
||||
mail_values['body_html'] = mail_values.get('body', '')
|
||||
|
|
|
@ -84,7 +84,8 @@ class MailMail(osv.Model):
|
|||
def send_get_email_dict(self, cr, uid, mail, partner=None, context=None):
|
||||
res = super(MailMail, self).send_get_email_dict(cr, uid, mail, partner, context=context)
|
||||
if mail.mailing_id and res.get('body') and res.get('email_to'):
|
||||
email_to = tools.email_split(res.get('email_to')[0])
|
||||
emails = tools.email_split(res.get('email_to')[0])
|
||||
email_to = emails and emails[0] or False
|
||||
unsubscribe_url = self._get_unsubscribe_url(cr, uid, mail, email_to, context=context)
|
||||
if unsubscribe_url:
|
||||
res['body'] = tools.append_content_to_html(res['body'], unsubscribe_url, plaintext=False, container_tag='p')
|
||||
|
|
|
@ -591,6 +591,7 @@
|
|||
<field name="mail_mail_id"/>
|
||||
<field name="message_id"/>
|
||||
<field name="sent"/>
|
||||
<field name="exception"/>
|
||||
<field name="opened"/>
|
||||
<field name="replied"/>
|
||||
<field name="bounced"/>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_issues,project_issue,project_issue.model_project_issue,base.group_portal,1,0,0,0
|
||||
access_case_section,crm_case_section,crm.model_crm_case_section,base.group_portal,1,0,0,0
|
||||
access_case_section,crm_case_section,sales_team.model_crm_case_section,base.group_portal,1,0,0,0
|
||||
access_issues_public,project_issue,project_issue.model_project_issue,base.group_public,1,0,0,0
|
|
|
@ -678,6 +678,17 @@ class product_template(osv.osv):
|
|||
if not context or "create_product_product" not in context:
|
||||
self.create_variant_ids(cr, uid, [product_template_id], context=context)
|
||||
self._set_standard_price(cr, uid, product_template_id, vals.get('standard_price', 0.0), context=context)
|
||||
|
||||
# TODO: this is needed to set given values to first variant after creation
|
||||
# these fields should be moved to product as lead to confusion
|
||||
related_vals = {}
|
||||
if vals.get('ean13'):
|
||||
related_vals['ean13'] = vals['ean13']
|
||||
if vals.get('default_code'):
|
||||
related_vals['default_code'] = vals['default_code']
|
||||
if related_vals:
|
||||
self.write(cr, uid, product_template_id, related_vals, context=context)
|
||||
|
||||
return product_template_id
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
|
|
|
@ -27,7 +27,7 @@ class account_invoice(osv.Model):
|
|||
template_values = Composer.onchange_template_id(
|
||||
cr, uid, composer_id, line.product_id.email_template_id.id, 'comment', 'account.invoice', invoice.id
|
||||
)['value']
|
||||
template_values['attachment_ids'] = [(4, id) for id in template_values.get('attachment_ids', '[]')]
|
||||
template_values['attachment_ids'] = [(4, id) for id in template_values.get('attachment_ids', [])]
|
||||
Composer.write(cr, uid, [composer_id], template_values, context=context)
|
||||
Composer.send_mail(cr, uid, [composer_id], context=context)
|
||||
return True
|
||||
|
|
|
@ -1099,8 +1099,10 @@ class task(osv.osv):
|
|||
|
||||
def message_get_reply_to(self, cr, uid, ids, context=None):
|
||||
""" Override to get the reply_to of the parent project. """
|
||||
return [task.project_id.message_get_reply_to()[0] if task.project_id else False
|
||||
for task in self.browse(cr, uid, ids, context=context)]
|
||||
tasks = self.browse(cr, SUPERUSER_ID, ids, context=context)
|
||||
project_ids = set([task.project_id.id for task in tasks if task.project_id])
|
||||
aliases = self.pool['project.project'].message_get_reply_to(cr, uid, list(project_ids), context=context)
|
||||
return dict((task.id, aliases.get(task.project_id and task.project_id.id or 0, False)) for task in tasks)
|
||||
|
||||
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
||||
""" Override to updates the document according to the email. """
|
||||
|
|
|
@ -50,8 +50,8 @@
|
|||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="alias_model">project.task</field>
|
||||
<field name="message_follower_ids" eval="[(6, 0, [
|
||||
ref('base.user_root'),
|
||||
ref('base.user_demo')])]"/>
|
||||
ref('base.partner_root'),
|
||||
ref('base.partner_demo')])]"/>
|
||||
</record>
|
||||
|
||||
<!-- We assign after so that default values applies -->
|
||||
|
|
|
@ -37,7 +37,7 @@ It allows the manager to quickly check the issues, assign them and decide on the
|
|||
'website': 'http://www.openerp.com',
|
||||
'images': ['images/issue_analysis.jpeg','images/project_issue.jpeg'],
|
||||
'depends': [
|
||||
'crm',
|
||||
'sales_team',
|
||||
'project',
|
||||
],
|
||||
'data': [
|
||||
|
|
|
@ -23,7 +23,6 @@ from datetime import datetime
|
|||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp import tools
|
||||
from openerp.addons.crm import crm
|
||||
from openerp.osv import fields, osv, orm
|
||||
from openerp.tools import html2plaintext
|
||||
from openerp.tools.translate import _
|
||||
|
@ -259,7 +258,7 @@ class project_issue(osv.Model):
|
|||
'date_closed': fields.datetime('Closed', readonly=True,select=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'date_last_stage_update': fields.datetime('Last Stage Update', select=True),
|
||||
'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel."),
|
||||
'channel': fields.char('Channel', help="Communication channel."),
|
||||
'categ_ids': fields.many2many('project.category', string='Tags'),
|
||||
'priority': fields.selection([('0','Low'), ('1','Normal'), ('2','High')], 'Priority', select=True),
|
||||
'version_id': fields.many2one('project.issue.version', 'Version'),
|
||||
|
@ -414,8 +413,10 @@ class project_issue(osv.Model):
|
|||
|
||||
def message_get_reply_to(self, cr, uid, ids, context=None):
|
||||
""" Override to get the reply_to of the parent project. """
|
||||
return [issue.project_id.message_get_reply_to()[0] if issue.project_id else False
|
||||
for issue in self.browse(cr, uid, ids, context=context)]
|
||||
issues = self.browse(cr, SUPERUSER_ID, ids, context=context)
|
||||
project_ids = set([issue.project_id.id for issue in issues if issue.project_id])
|
||||
aliases = self.pool['project.project'].message_get_reply_to(cr, uid, list(project_ids), context=context)
|
||||
return dict((issue.id, aliases.get(issue.project_id and issue.project_id.id or 0, False)) for issue in issues)
|
||||
|
||||
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
|
||||
recipients = super(project_issue, self).message_get_suggested_recipients(cr, uid, ids, context=context)
|
||||
|
|
|
@ -52,7 +52,7 @@ class project_issue_report(osv.osv):
|
|||
'version_id': fields.many2one('project.issue.version', 'Version'),
|
||||
'user_id' : fields.many2one('res.users', 'Assigned to',readonly=True),
|
||||
'partner_id': fields.many2one('res.partner','Contact'),
|
||||
'channel_id': fields.many2one('crm.case.channel', 'Channel',readonly=True),
|
||||
'channel': fields.char('Channel', readonly=True, help="Communication Channel."),
|
||||
'task_id': fields.many2one('project.task', 'Task'),
|
||||
'email': fields.integer('# Emails', size=128, readonly=True),
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class project_issue_report(osv.osv):
|
|||
c.version_id as version_id,
|
||||
1 as nbr,
|
||||
c.partner_id,
|
||||
c.channel_id,
|
||||
c.channel,
|
||||
c.task_id,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
c.day_open as delay_open,
|
||||
|
|
|
@ -5,6 +5,6 @@ access_project_issue_version_project,project_issue_version manager,model_project
|
|||
access_project_issue_version_project_user,project_issue_version user,model_project_issue_version,project.group_project_user,1,0,0,0
|
||||
access_resource_calendar_project_manager,resource.calendar.project.manager,resource.model_resource_calendar,project.group_project_manager,1,1,1,1
|
||||
access_project_issue_report_user,project.issue.report user,model_project_issue_report,project.group_project_user,1,0,0,0
|
||||
access_crm_case_section,crm.case.section,crm.model_crm_case_section,project.group_project_user,1,0,0,0
|
||||
access_crm_case_section,crm.case.section,sales_team.model_crm_case_section,project.group_project_user,1,0,0,0
|
||||
access_project_issue_salesman,project.issue,model_project_issue,base.group_sale_salesman,1,0,0,0
|
||||
access_project_issue_manager,project.issue,model_project_issue,base.group_sale_manager,1,0,0,0
|
||||
|
|
|
|
@ -91,6 +91,8 @@ class purchase_requisition(osv.osv):
|
|||
for purchase_order in tender.purchase_ids:
|
||||
purchase_order_obj.action_cancel(cr, uid, [purchase_order.id], context=context)
|
||||
purchase_order_obj.message_post(cr, uid, [purchase_order.id], body=_('Cancelled by the tender associated to this quotation.'), context=context)
|
||||
procurement_ids = self.pool['procurement.order'].search(cr, uid, [('requisition_id', 'in', ids)], context=context)
|
||||
self.pool['procurement.order'].action_done(cr, uid, procurement_ids)
|
||||
return self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
||||
def tender_in_progress(self, cr, uid, ids, context=None):
|
||||
|
@ -108,6 +110,8 @@ class purchase_requisition(osv.osv):
|
|||
return True
|
||||
|
||||
def tender_done(self, cr, uid, ids, context=None):
|
||||
procurement_ids = self.pool['procurement.order'].search(cr, uid, [('requisition_id', 'in', ids)], context=context)
|
||||
self.pool['procurement.order'].action_done(cr, uid, procurement_ids)
|
||||
return self.write(cr, uid, ids, {'state': 'done'}, context=context)
|
||||
|
||||
def open_product_line(self, cr, uid, ids, context=None):
|
||||
|
@ -352,6 +356,10 @@ class purchase_order(osv.osv):
|
|||
proc_obj.write(cr, uid, proc_ids, {'purchase_id': po.id})
|
||||
self.signal_purchase_cancel(cr, uid, [order.id])
|
||||
po.requisition_id.tender_done(context=context)
|
||||
if po.requisition_id and all(purchase_id.state in ['draft', 'cancel'] for purchase_id in po.requisition_id.purchase_ids if purchase_id.id != po.id):
|
||||
procurement_ids = self.pool['procurement.order'].search(cr, uid, [('requisition_id', '=', po.requisition_id.id)], context=context)
|
||||
for procurement in proc_obj.browse(cr, uid, procurement_ids, context=context):
|
||||
procurement.move_id.write({'location_id': procurement.move_id.location_dest_id.id})
|
||||
return res
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<tr t-foreach="o.invoice_line" t-as="l">
|
||||
<td><span t-field="l.name"/></td>
|
||||
<td class="text-right"><span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/></td>
|
||||
<td class="text-right"><span t-esc="l.product_id.intrastat_id"/></td>
|
||||
<td class="text-right"><span t-esc="l.product_id.intrastat_id.name"/></td>
|
||||
<td class="text-right"><span t-esc="l.product_id.weight"/></td>
|
||||
<td class="text-right"><span t-field="l.quantity"/></td>
|
||||
<td groups="product.group_uom"><span t-field="l.uos_id"/></td>
|
||||
|
|
|
@ -128,13 +128,12 @@ class sale_order(osv.osv):
|
|||
sale_clause = ''
|
||||
no_invoiced = False
|
||||
for arg in args:
|
||||
if arg[1] == '=':
|
||||
if arg[2]:
|
||||
clause += 'AND inv.state = \'paid\''
|
||||
else:
|
||||
clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id '
|
||||
sale_clause = ', sale_order AS sale '
|
||||
no_invoiced = True
|
||||
if (arg[1] == '=' and arg[2]) or (arg[1] == '!=' and not arg[2]):
|
||||
clause += 'AND inv.state = \'paid\''
|
||||
else:
|
||||
clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id '
|
||||
sale_clause = ', sale_order AS sale '
|
||||
no_invoiced = True
|
||||
|
||||
cursor.execute('SELECT rel.order_id ' \
|
||||
'FROM sale_order_invoice_rel AS rel, account_invoice AS inv '+ sale_clause + \
|
||||
|
|
|
@ -324,11 +324,6 @@ class product_template(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
'valuation':fields.selection([('manual_periodic', 'Periodical (manual)'),
|
||||
('real_time','Real Time (automated)'),], 'Inventory Valuation',
|
||||
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \
|
||||
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
|
||||
, required=True),
|
||||
'type': fields.selection([('product', 'Stockable Product'), ('consu', 'Consumable'), ('service', 'Service')], 'Product Type', required=True, help="Consumable: Will not imply stock management for this product. \nStockable product: Will imply stock management for this product."),
|
||||
'property_stock_procurement': fields.property(
|
||||
type='many2one',
|
||||
|
@ -376,7 +371,6 @@ class product_template(osv.osv):
|
|||
|
||||
_defaults = {
|
||||
'sale_delay': 7,
|
||||
'valuation': 'manual_periodic',
|
||||
}
|
||||
|
||||
def action_view_routes(self, cr, uid, ids, context=None):
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue