merge upstream
This commit is contained in:
commit
34815021b8
|
@ -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):
|
||||
|
||||
|
@ -444,35 +456,40 @@ class account_bank_statement_line(osv.osv):
|
|||
}
|
||||
for mv_line in reconciliation_data['reconciliation_proposition']:
|
||||
mv_line_ids_selected.append(mv_line['id'])
|
||||
ret.append(reconciliation_data);
|
||||
|
||||
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 +499,116 @@ 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
|
||||
|
||||
# look for structured communication
|
||||
exact_match_id = self.search_structured_com(cr, uid, st_line, context=context)
|
||||
if exact_match_id:
|
||||
return self.make_counter_part_lines(cr, uid, st_line, [exact_match_id], count=False, context=context)
|
||||
#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, limit=1, additional_domain=[(amount_field, '=', (sign * st_line.amount))])
|
||||
if exact_match_id:
|
||||
return exact_match_id
|
||||
|
||||
# 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, limit=50, 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, limit=50, 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=[], filter_str="", offset=0, limit=None, count=False, additional_domain=[], 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, filter_str, offset, limit, count, additional_domain, context=context)
|
||||
|
||||
def get_move_lines_counterparts(self, cr, uid, st_line, excluded_ids=[], filter_str="", offset=0, limit=None, count=False, additional_domain=[], 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
|
||||
('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)]
|
||||
if filter_str:
|
||||
if not st_line.partner_id:
|
||||
domain += [ '|', ('partner_id.name', 'ilike', filter_str)]
|
||||
domain += ['|', ('move_id.name', 'ilike', filter_str), ('move_id.ref', 'ilike', filter_str)]
|
||||
line_ids = mv_line_pool.search(cr, uid, domain, offset=offset, limit=limit, 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 +617,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 +635,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 +657,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 +706,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 +726,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 +805,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),
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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++;
|
||||
|
@ -789,6 +789,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
|
||||
|
@ -981,6 +984,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");
|
||||
|
@ -1038,7 +1042,8 @@ openerp.account = function (instance) {
|
|||
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 })
|
||||
return o.q_label.indexOf(self.filter) !== -1 || (o.ref && 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"));
|
||||
|
@ -1057,7 +1062,6 @@ openerp.account = function (instance) {
|
|||
|
||||
updatePagerControls: function() {
|
||||
var self = this;
|
||||
|
||||
if (self.get("pager_index") === 0)
|
||||
self.$(".pager_control_left").addClass("disabled");
|
||||
else
|
||||
|
@ -1075,7 +1079,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 +1092,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 +1119,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") {
|
||||
|
@ -1198,6 +1200,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 +1219,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 +1232,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 +1271,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 +1294,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;
|
||||
|
@ -1359,16 +1363,15 @@ openerp.account = function (instance) {
|
|||
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])
|
||||
.call("get_move_lines_counterparts_id", [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])
|
||||
.call("get_move_lines_counterparts_id", [self.st_line.id, excluded_ids, self.filter, 0, undefined, true])
|
||||
.then(function(num){
|
||||
move_lines_num = num;
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
|
|
|
@ -762,7 +762,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({
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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'] != '':
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
|
|
@ -175,6 +175,11 @@ 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 = 50
|
||||
chunks = [email_pids[x:x + max_recipients] for x in xrange(0, len(email_pids), max_recipients)]
|
||||
|
@ -187,6 +192,7 @@ 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) < 2: # for more than 50 followers, use the queue system
|
||||
self.pool.get('mail.mail').send(cr, uid, email_ids, context=context)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
@ -215,12 +216,13 @@ class mail_group(osv.Model):
|
|||
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)
|
||||
res.update({
|
||||
'headers': {
|
||||
'Precedence': 'list',
|
||||
}
|
||||
})
|
||||
if group.alias_domain:
|
||||
res['headers']['List-Id'] = '%s.%s' % (group.alias_name, group.alias_domain)
|
||||
res['headers']['List-Post'] = '<mailto:%s@%s>' % (group.alias_name, group.alias_domain)
|
||||
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
|
||||
|
@ -210,8 +209,6 @@ class mail_mail(osv.Model):
|
|||
'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),
|
||||
}
|
||||
if mail.model and mail.res_id and self.pool.get(mail.model) and hasattr(self.pool[mail.model], 'message_get_email_values'):
|
||||
res.update(self.pool[mail.model].message_get_email_values(cr, uid, mail.res_id, mail, context=context))
|
||||
return res
|
||||
|
||||
def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None):
|
||||
|
@ -267,13 +264,15 @@ 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
|
||||
for email in email_list:
|
||||
email_headers = dict(headers)
|
||||
if email.get('headers'):
|
||||
email_headers.update(email['headers'])
|
||||
msg = ir_mail_server.build_email(
|
||||
email_from=mail.email_from,
|
||||
email_to=email.get('email_to'),
|
||||
|
@ -288,7 +287,7 @@ class mail_mail(osv.Model):
|
|||
object_id=mail.res_id and ('%s-%s' % (mail.res_id, mail.model)),
|
||||
subtype='html',
|
||||
subtype_alternative='plain',
|
||||
headers=email_headers)
|
||||
headers=headers)
|
||||
res = ir_mail_server.send_email(cr, uid, msg,
|
||||
mail_server_id=mail.mail_server_id.id,
|
||||
context=context)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -31,6 +31,7 @@ except ImportError:
|
|||
from lxml import etree
|
||||
import logging
|
||||
import pytz
|
||||
import re
|
||||
import socket
|
||||
import time
|
||||
import xmlrpclib
|
||||
|
@ -688,22 +689,54 @@ 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):
|
||||
""" Temporary method to create custom notification email values for a given
|
||||
model and document. This should be better to have a headers field on
|
||||
the mail.mail model, computed when creating the notification email, but
|
||||
this cannot be done in a stable version.
|
||||
|
||||
TDE FIXME: rethink this ulgy thing. """
|
||||
""" Get specific notification email values to store on the notification
|
||||
mail_mail. Void method, inherit it to add custom values. """
|
||||
res = dict()
|
||||
return res
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -277,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', '')
|
||||
|
|
|
@ -746,7 +746,7 @@
|
|||
<field name="move_lines2" nolabel="1" options="{'reload_on_button': true}">
|
||||
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in ('confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
|
||||
<field name="product_id" readonly="1"/>
|
||||
<field name="restrict_lot_id" context="{'product_id': product_id}" groups="stock.group_tracking_lot"/>
|
||||
<field name="restrict_lot_id" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
|
||||
<field name="product_qty" readonly="1"/>
|
||||
<field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
|
||||
<field name="state" invisible="1"/>
|
||||
|
@ -774,7 +774,7 @@
|
|||
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in('confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
|
||||
<field name="product_id" readonly="1"/>
|
||||
<field name="product_qty" readonly="1"/>
|
||||
<field name="restrict_lot_id" groups="stock.group_tracking_lot"/>
|
||||
<field name="restrict_lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
|
||||
<field name="location_dest_id" readonly="1" string="Destination Loc." widget="selection" groups="stock.group_locations"/>
|
||||
<field name="scrapped" invisible="1"/>
|
||||
|
|
|
@ -18,16 +18,16 @@
|
|||
<field name="lot_id" domain="[('product_id', '=', product_id)]"
|
||||
context="{'default_product_id':product_id}"
|
||||
attrs="{'required': [('track_production', '=', True), ('mode', '=', 'consume_produce')]}"
|
||||
groups="stock.group_tracking_lot"/>
|
||||
groups="stock.group_production_lot"/>
|
||||
</group>
|
||||
<group string="To Consume">
|
||||
<field name="consume_lines">
|
||||
<field name="consume_lines" nolabel="1">
|
||||
<tree string="Consume Lines" editable="top">
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="lot_id" domain="[('product_id', '=', product_id)]"
|
||||
context="{'default_product_id':product_id}"
|
||||
groups="stock.group_tracking_lot"/>
|
||||
groups="stock.group_production_lot"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<field name="product_qty" class="oe_inline"/>
|
||||
<field name="product_uom" class="oe_inline" readonly="1" groups="product.group_uom"/>
|
||||
</div>
|
||||
<field name="restrict_lot_id" domain="[('product_id','=',product_id)]" groups="stock.group_tracking_lot"
|
||||
<field name="restrict_lot_id" domain="[('product_id','=',product_id)]" groups="stock.group_production_lot"
|
||||
context="{'default_product_id': product_id}"/>
|
||||
<field name="location_id" groups="stock.group_locations"/>
|
||||
</group>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<h2>
|
||||
<span t-if="o.state != 'draft'">Repair Order N°:</span>
|
||||
<span t-if="o.state == 'draft'">Repair Quotation N°:</span>
|
||||
<span t-if="o.state == 'draft'">Repair Quotation N°:</span>
|
||||
<span t-field="o.name"/>
|
||||
</h2>
|
||||
|
||||
|
@ -41,7 +41,9 @@
|
|||
</div>
|
||||
<div class="col-xs-3" groups="stock.group_production_lot">
|
||||
<strong>Lot Number</strong>
|
||||
<span t-field="o.prodlot_id.name"/>
|
||||
<t t-if="o.lot_id">
|
||||
<span t-field="o.lot_id.name"/>
|
||||
</t>
|
||||
</div>
|
||||
<div t-if="o.guarantee_limit" class="col-xs-3">
|
||||
<strong>Guarantee Limit:</strong>
|
||||
|
|
|
@ -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
|
|
|
@ -64,7 +64,7 @@ class procurement_group(osv.osv):
|
|||
}
|
||||
_defaults = {
|
||||
'name': lambda self, cr, uid, c: self.pool.get('ir.sequence').get(cr, uid, 'procurement.group') or '',
|
||||
'move_type': lambda self, cr, uid, c: 'one'
|
||||
'move_type': lambda self, cr, uid, c: 'direct'
|
||||
}
|
||||
|
||||
class procurement_rule(osv.osv):
|
||||
|
@ -267,7 +267,7 @@ class procurement_order(osv.osv):
|
|||
#
|
||||
# Scheduler
|
||||
#
|
||||
def run_scheduler(self, cr, uid, use_new_cursor=False, context=None):
|
||||
def run_scheduler(self, cr, uid, use_new_cursor=False, company_id = False, context=None):
|
||||
'''
|
||||
Call the scheduler to check the procurement order. This is intented to be done for all existing companies at
|
||||
the same time, so we're running all the methods as SUPERUSER to avoid intercompany and access rights issues.
|
||||
|
@ -288,8 +288,11 @@ class procurement_order(osv.osv):
|
|||
cr = openerp.registry(cr.dbname).cursor()
|
||||
|
||||
# Run confirmed procurements
|
||||
dom = [('state', '=', 'confirmed')]
|
||||
if company_id:
|
||||
dom += [('company_id', '=', company_id)]
|
||||
while True:
|
||||
ids = self.search(cr, SUPERUSER_ID, [('state', '=', 'confirmed')], context=context)
|
||||
ids = self.search(cr, SUPERUSER_ID, dom, context=context)
|
||||
if not ids:
|
||||
break
|
||||
self.run(cr, SUPERUSER_ID, ids, context=context)
|
||||
|
@ -298,8 +301,11 @@ class procurement_order(osv.osv):
|
|||
|
||||
# Check if running procurements are done
|
||||
offset = 0
|
||||
dom = [('state', '=', 'running')]
|
||||
if company_id:
|
||||
dom += [('company_id', '=', company_id)]
|
||||
while True:
|
||||
ids = self.search(cr, SUPERUSER_ID, [('state', '=', 'running')], offset=offset, context=context)
|
||||
ids = self.search(cr, SUPERUSER_ID, dom, offset=offset, context=context)
|
||||
if not ids:
|
||||
break
|
||||
done = self.check(cr, SUPERUSER_ID, ids, context=context)
|
||||
|
|
|
@ -37,8 +37,12 @@ class procurement_compute_all(osv.osv_memory):
|
|||
"""
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
#As this function is in a new thread, i need to open a new cursor, because the old one may be closed
|
||||
|
||||
new_cr = self.pool.cursor()
|
||||
proc_obj.run_scheduler(new_cr, uid, use_new_cursor=new_cr.dbname, context=context)
|
||||
user = self.pool.get('res.users').browse(new_cr, uid, uid, context=context)
|
||||
comps = [x.id for x in user.company_ids]
|
||||
for comp in comps:
|
||||
proc_obj.run_scheduler(new_cr, uid, use_new_cursor=new_cr.dbname, company_id = comp, context=context)
|
||||
#close the new cursor
|
||||
new_cr.close()
|
||||
return {}
|
||||
|
|
|
@ -92,7 +92,7 @@ class stock_quant(osv.osv):
|
|||
|
||||
def apply_removal_strategy(self, cr, uid, location, product, qty, domain, removal_strategy, context=None):
|
||||
if removal_strategy == 'fefo':
|
||||
order = 'removal_date, id'
|
||||
order = 'removal_date, in_date, id'
|
||||
return self._quants_get_order(cr, uid, location, product, qty, domain, order, context=context)
|
||||
return super(stock_quant, self).apply_removal_strategy(cr, uid, location, product, qty, domain, removal_strategy, context=context)
|
||||
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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
|
||||
|
|
|
|
@ -700,6 +700,7 @@ class purchase_order(osv.osv):
|
|||
'origin': order.name,
|
||||
'route_ids': order.picking_type_id.warehouse_id and [(6, 0, [x.id for x in order.picking_type_id.warehouse_id.route_ids])] or [],
|
||||
'warehouse_id':order.picking_type_id.warehouse_id.id,
|
||||
'invoice_state': order.invoice_method == 'picking' and '2binvoiced' or 'none'
|
||||
}
|
||||
|
||||
diff_quantity = order_line.product_qty
|
||||
|
@ -709,9 +710,10 @@ class purchase_order(osv.osv):
|
|||
tmp.update({
|
||||
'product_uom_qty': min(procurement_qty, diff_quantity),
|
||||
'product_uos_qty': min(procurement_qty, diff_quantity),
|
||||
'move_dest_id': procurement.move_dest_id.id, # blabla
|
||||
'group_id': procurement.group_id.id or group_id, # blabla to check ca devrait etre bon et groupé dans le meme picking qd meme
|
||||
'move_dest_id': procurement.move_dest_id.id, #move destination is same as procurement destination
|
||||
'group_id': procurement.group_id.id or group_id, #move group is same as group of procurements if it exists, otherwise take another group
|
||||
'procurement_id': procurement.id,
|
||||
'invoice_state': procurement.rule_id.invoice_state or (procurement.location_id and procurement.location_id.usage == 'customer' and procurement.invoice_state) or (order.invoice_method == 'picking' and '2binvoiced') or 'none', #dropship case takes from sale
|
||||
})
|
||||
diff_quantity -= min(procurement_qty, diff_quantity)
|
||||
res.append(tmp)
|
||||
|
@ -1299,6 +1301,7 @@ class procurement_order(osv.osv):
|
|||
res[procurement.id] = False
|
||||
else:
|
||||
schedule_date = self._get_purchase_schedule_date(cr, uid, procurement, company, context=context)
|
||||
purchase_date = self._get_purchase_order_date(cr, uid, procurement, company, schedule_date, context=context)
|
||||
line_vals = self._get_po_line_values_from_proc(cr, uid, procurement, partner, company, schedule_date, context=context)
|
||||
#look for any other draft PO for the same supplier, to attach the new line on instead of creating a new draft one
|
||||
available_draft_po_ids = po_obj.search(cr, uid, [
|
||||
|
@ -1306,6 +1309,10 @@ class procurement_order(osv.osv):
|
|||
('location_id', '=', procurement.location_id.id), ('company_id', '=', procurement.company_id.id), ('dest_address_id', '=', procurement.partner_dest_id.id)], context=context)
|
||||
if available_draft_po_ids:
|
||||
po_id = available_draft_po_ids[0]
|
||||
po_rec = po_obj.browse(cr, uid, po_id, context=context)
|
||||
#if the product has to be ordered earlier those in the existing PO, we replace the purchase date on the order to avoid ordering it too late
|
||||
if datetime.strptime(po_rec.date_order, DEFAULT_SERVER_DATE_FORMAT) > purchase_date:
|
||||
po_obj.write(cr, uid, [po_id], {'date_order': purchase_date}, context=context)
|
||||
#look for any other PO line in the selected PO with same product and UoM to sum quantities instead of creating a new po line
|
||||
available_po_line_ids = po_line_obj.search(cr, uid, [('order_id', '=', po_id), ('product_id', '=', line_vals['product_id']), ('product_uom', '=', line_vals['product_uom'])], context=context)
|
||||
if available_po_line_ids:
|
||||
|
@ -1318,7 +1325,6 @@ class procurement_order(osv.osv):
|
|||
po_line_id = po_line_obj.create(cr, SUPERUSER_ID, line_vals, context=context)
|
||||
linked_po_ids.append(procurement.id)
|
||||
else:
|
||||
purchase_date = self._get_purchase_order_date(cr, uid, procurement, company, schedule_date, context=context)
|
||||
name = seq_obj.get(cr, uid, 'purchase.order') or _('PO: %s') % procurement.name
|
||||
po_vals = {
|
||||
'name': name,
|
||||
|
@ -1363,6 +1369,13 @@ class product_template(osv.Model):
|
|||
_name = 'product.template'
|
||||
_inherit = 'product.template'
|
||||
|
||||
def _get_buy_route(self, cr, uid, context=None):
|
||||
|
||||
buy_route = self.pool.get('ir.model.data').xmlid_to_res_id(cr, uid, 'purchase.route_warehouse0_buy')
|
||||
if buy_route:
|
||||
return [buy_route]
|
||||
return []
|
||||
|
||||
def _purchase_count(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = dict.fromkeys(ids, 0)
|
||||
for template in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -1374,6 +1387,7 @@ class product_template(osv.Model):
|
|||
}
|
||||
_defaults = {
|
||||
'purchase_ok': 1,
|
||||
'route_ids': _get_buy_route,
|
||||
}
|
||||
|
||||
class product_product(osv.Model):
|
||||
|
@ -1451,15 +1465,9 @@ class account_invoice_line(osv.Model):
|
|||
readonly=True),
|
||||
}
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit = "product.product"
|
||||
class product_template(osv.osv):
|
||||
_inherit = "product.template"
|
||||
|
||||
def _get_buy_route(self, cr, uid, context=None):
|
||||
buy_route = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'purchase', 'route_warehouse0_buy')[1]
|
||||
return [buy_route]
|
||||
|
||||
_defaults = {
|
||||
'route_ids': _get_buy_route,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -55,6 +55,33 @@ class stock_move(osv.osv):
|
|||
})
|
||||
return super(stock_move, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
def _create_invoice_line_from_vals(self, cr, uid, move, invoice_line_vals, context=None):
|
||||
invoice_line_id = super(stock_move, self)._create_invoice_line_from_vals(cr, uid, move, invoice_line_vals, context=context)
|
||||
if move.purchase_line_id:
|
||||
purchase_line = move.purchase_line_id
|
||||
self.pool.get('purchase.order.line').write(cr, uid, [purchase_line.id], {
|
||||
'invoice_lines': [(4, invoice_line_id)]
|
||||
}, context=context)
|
||||
self.pool.get('purchase.order').write(cr, uid, [purchase_line.order_id.id], {
|
||||
'invoice_ids': [(4, invoice_line_vals['invoice_id'])],
|
||||
})
|
||||
return invoice_line_id
|
||||
|
||||
def _get_master_data(self, cr, uid, move, company, context=None):
|
||||
if move.purchase_line_id:
|
||||
purchase_order = move.purchase_line_id.order_id
|
||||
return purchase_order.partner_id, purchase_order.create_uid.id, purchase_order.pricelist_id.currency_id.id
|
||||
return super(stock_move, self)._get_master_data(cr, uid, move, company, context=context)
|
||||
|
||||
def _get_invoice_line_vals(self, cr, uid, move, partner, inv_type, context=None):
|
||||
res = super(stock_move, self)._get_invoice_line_vals(cr, uid, move, partner, inv_type, context=context)
|
||||
if move.purchase_line_id:
|
||||
purchase_line = move.purchase_line_id
|
||||
res['invoice_line_tax_id'] = [(6, 0, [x.id for x in purchase_line.taxes_id])]
|
||||
res['price_unit'] = purchase_line.price_unit
|
||||
return res
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
|
|
|
@ -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 + \
|
||||
|
|
|
@ -388,7 +388,7 @@ class stock_move(osv.osv):
|
|||
return super(stock_move, self).action_cancel(cr, uid, ids, context=context)
|
||||
|
||||
def _create_invoice_line_from_vals(self, cr, uid, move, invoice_line_vals, context=None):
|
||||
invoice_line_id = self.pool.get('account.invoice.line').create(cr, uid, invoice_line_vals, context=context)
|
||||
invoice_line_id = super(stock_move, self)._create_invoice_line_from_vals(cr, uid, move, invoice_line_vals, context=context)
|
||||
if move.procurement_id and move.procurement_id.sale_line_id:
|
||||
sale_line = move.procurement_id.sale_line_id
|
||||
self.pool.get('sale.order.line').write(cr, uid, [sale_line.id], {
|
||||
|
|
|
@ -261,7 +261,7 @@ class procurement_order(osv.osv):
|
|||
result['domain'] = "[('group_id','in',[" + ','.join(map(str, list(group_ids))) + "])]"
|
||||
return result
|
||||
|
||||
def run_scheduler(self, cr, uid, use_new_cursor=False, context=None):
|
||||
def run_scheduler(self, cr, uid, use_new_cursor=False, company_id=False, context=None):
|
||||
'''
|
||||
Call the scheduler in order to check the running procurements (super method), to check the minimum stock rules
|
||||
and the availability of moves. This function is intended to be run for all the companies at the same time, so
|
||||
|
@ -286,8 +286,7 @@ class procurement_order(osv.osv):
|
|||
move_obj = self.pool.get('stock.move')
|
||||
|
||||
#Minimum stock rules
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
|
||||
self._procure_orderpoint_confirm(cr, SUPERUSER_ID, use_new_cursor=False, company_id=company.id, context=context)
|
||||
self._procure_orderpoint_confirm(cr, SUPERUSER_ID, use_new_cursor=False, company_id=company_id, context=context)
|
||||
|
||||
#Search all confirmed stock_moves and try to assign them
|
||||
confirmed_ids = move_obj.search(cr, uid, [('state', '=', 'confirmed')], limit=None, order='priority desc, date_expected asc', context=context)
|
||||
|
@ -331,7 +330,7 @@ class procurement_order(osv.osv):
|
|||
[order_point.product_id.id],
|
||||
context={'location': order_point.location_id.id})[order_point.product_id.id]['virtual_available']
|
||||
|
||||
def _procure_orderpoint_confirm(self, cr, uid, use_new_cursor=False, company_id=False, context=None):
|
||||
def _procure_orderpoint_confirm(self, cr, uid, use_new_cursor=False, company_id = False, context=None):
|
||||
'''
|
||||
Create procurement based on Orderpoint
|
||||
|
||||
|
@ -341,14 +340,15 @@ class procurement_order(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
if use_new_cursor:
|
||||
cr = openerp.registry(cr.dbname).db.cursor()
|
||||
cr = openerp.registry(cr.dbname).cursor()
|
||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
offset = 0
|
||||
ids = [1]
|
||||
dom = company_id and [('company_id', '=', company_id)] or []
|
||||
while ids:
|
||||
ids = orderpoint_obj.search(cr, uid, [('company_id', '=', company_id)], offset=offset, limit=100)
|
||||
ids = orderpoint_obj.search(cr, uid, dom, offset=offset, limit=100)
|
||||
for op in orderpoint_obj.browse(cr, uid, ids, context=context):
|
||||
prods = self._product_virtual_get(cr, uid, op)
|
||||
if prods is None:
|
||||
|
|
|
@ -171,13 +171,13 @@ class product_product(osv.osv):
|
|||
def _product_available_text(self, cr, uid, ids, field_names=None, arg=False, context=None):
|
||||
res = {}
|
||||
for product in self.browse(cr, uid, ids, context=context):
|
||||
res[product.id] = str(product.qty_available) + _(" In Stock")
|
||||
res[product.id] = str(product.qty_available) + _(" On Hand")
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'reception_count': fields.function(_stock_move_count, string="Reception", type='integer', multi='pickings'),
|
||||
'delivery_count': fields.function(_stock_move_count, string="Delivery", type='integer', multi='pickings'),
|
||||
'qty_in_stock': fields.function(_product_available_text, type='char'),
|
||||
'qty_available_text': fields.function(_product_available_text, type='char'),
|
||||
'qty_available': fields.function(_product_available, multi='qty_available',
|
||||
type='float', digits_compute=dp.get_precision('Product Unit of Measure'),
|
||||
string='Quantity On Hand',
|
||||
|
@ -277,6 +277,12 @@ class product_product(osv.osv):
|
|||
res['fields']['qty_available']['string'] = _('Produced Qty')
|
||||
return res
|
||||
|
||||
|
||||
def action_view_routes(self, cr, uid, ids, context=None):
|
||||
template_obj = self.pool.get("product.template")
|
||||
templ_ids = list(set([x.product_tmpl_id.id for x in self.browse(cr, uid, ids, context=context)]))
|
||||
return template_obj.action_view_routes(cr, uid, templ_ids, context=context)
|
||||
|
||||
class product_template(osv.osv):
|
||||
_name = 'product.template'
|
||||
_inherit = 'product.template'
|
||||
|
@ -318,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',
|
||||
|
@ -370,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):
|
||||
|
|
|
@ -193,7 +193,7 @@
|
|||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="status" position="before">
|
||||
<group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
|
||||
<group name="lot" groups="stock.group_production_lot" string="Lots">
|
||||
<field name="track_all" groups="stock.group_production_lot"/>
|
||||
<field name="track_incoming" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
<field name="track_outgoing" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
|
@ -202,13 +202,13 @@
|
|||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button class="oe_stat_button"
|
||||
name="%(product_open_quants)d"
|
||||
icon="fa-bank"
|
||||
icon="fa-building-o"
|
||||
type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
|
||||
<div><field name="qty_in_stock"/></div>
|
||||
<div><field name="qty_available_text"/></div>
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button" string="Moves" name= "%(act_product_stock_move_open)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user" icon="fa-arrows-v"/>
|
||||
<button class="oe_inline oe_stat_button" name="%(product_open_orderpoint)d" type="action"
|
||||
attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-pinterest" string="Reordering Rules"/>
|
||||
attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-refresh" string="Reordering Rules"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -60,7 +60,7 @@ access_stock_location_path_internal_user,stock location path internal user,model
|
|||
access_stock_location_path_sale_manager,stock.location.path partner salemanager,model_stock_location_path,base.group_sale_manager,1,1,1,1
|
||||
access_stock_location_path_stock_user,stock.location.path stock user,model_stock_location_path,stock.group_stock_user,1,1,1,1
|
||||
access_stock_location_path,stock.location.path,model_stock_location_path,base.group_sale_salesman,1,0,0,0
|
||||
access_stock_location_route,stock.location.route,model_stock_location_route,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_location_route_stock_manager,stock.location.route,model_stock_location_route,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_location_route,stock.location.route,model_stock_location_route,base.group_user,1,0,0,0
|
||||
access_procurement_rule,procurement.rule.flow,model_procurement_rule,base.group_sale_salesman,1,0,0,0
|
||||
access_procurement_rule_internal,procurement.rule.flow internal,model_procurement_rule,base.group_user,1,0,0,0
|
||||
|
|
|
|
@ -50,7 +50,7 @@
|
|||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="stock_picking_rule">
|
||||
<record model="ir.rule" id="stock_picking_type_rule">
|
||||
<field name="name">Stock Picking Type multi-company</field>
|
||||
<field name="model_id" search="[('model','=','stock.picking.type')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
|
|
|
@ -272,27 +272,28 @@ class stock_quant(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'name': fields.function(_get_quant_name, type='char', string='Identifier'),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, ondelete="restrict"),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="restrict"),
|
||||
'qty': fields.float('Quantity', required=True, help="Quantity of products in this quant, in the default unit of measure of the product"),
|
||||
'package_id': fields.many2one('stock.quant.package', string='Package', help="The package containing this quant"),
|
||||
'packaging_type_id': fields.related('package_id', 'packaging_id', type='many2one', relation='product.packaging', string='Type of packaging', store=True),
|
||||
'reservation_id': fields.many2one('stock.move', 'Reserved for Move', help="The move the quant is reserved for"),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Lot'),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, ondelete="restrict", readonly=True, select=True),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="restrict", readonly=True, select=True),
|
||||
'qty': fields.float('Quantity', required=True, help="Quantity of products in this quant, in the default unit of measure of the product", readonly=True, select=True),
|
||||
'package_id': fields.many2one('stock.quant.package', string='Package', help="The package containing this quant", readonly=True, select=True),
|
||||
'packaging_type_id': fields.related('package_id', 'packaging_id', type='many2one', relation='product.packaging', string='Type of packaging', readonly=True, store=True),
|
||||
'reservation_id': fields.many2one('stock.move', 'Reserved for Move', help="The move the quant is reserved for", readonly=True, select=True),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True, select=True),
|
||||
'cost': fields.float('Unit Cost'),
|
||||
'owner_id': fields.many2one('res.partner', 'Owner', help="This is the owner of the quant"),
|
||||
'owner_id': fields.many2one('res.partner', 'Owner', help="This is the owner of the quant", readonly=True, select=True),
|
||||
|
||||
'create_date': fields.datetime('Creation Date'),
|
||||
'in_date': fields.datetime('Incoming Date'),
|
||||
'create_date': fields.datetime('Creation Date', readonly=True),
|
||||
'in_date': fields.datetime('Incoming Date', readonly=True, select=True),
|
||||
|
||||
'history_ids': fields.many2many('stock.move', 'stock_quant_move_rel', 'quant_id', 'move_id', 'Moves', help='Moves that operate(d) on this quant'),
|
||||
'company_id': fields.many2one('res.company', 'Company', help="The company to which the quants belong", required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', help="The company to which the quants belong", required=True, readonly=True, select=True),
|
||||
'inventory_value': fields.function(_calc_inventory_value, string="Inventory Value", type='float', readonly=True),
|
||||
|
||||
# Used for negative quants to reconcile after compensated by a new positive one
|
||||
'propagated_from_id': fields.many2one('stock.quant', 'Linked Quant', help='The negative quant this is coming from'),
|
||||
'negative_move_id': fields.many2one('stock.move', 'Move Negative Quant', help='If this is a negative quant, this will be the move that caused this negative quant.'),
|
||||
'negative_dest_location_id': fields.related('negative_move_id', 'location_dest_id', type='many2one', relation='stock.location', string="Negative Destination Location", help="Technical field used to record the destination location of a move that created a negative quant"),
|
||||
'propagated_from_id': fields.many2one('stock.quant', 'Linked Quant', help='The negative quant this is coming from', readonly=True, select=True),
|
||||
'negative_move_id': fields.many2one('stock.move', 'Move Negative Quant', help='If this is a negative quant, this will be the move that caused this negative quant.', readonly=True),
|
||||
'negative_dest_location_id': fields.related('negative_move_id', 'location_dest_id', type='many2one', relation='stock.location', string="Negative Destination Location", readonly=True,
|
||||
help="Technical field used to record the destination location of a move that created a negative quant"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -606,7 +607,6 @@ class stock_quant(osv.osv):
|
|||
raise osv.except_osv(_('Error'), _('You cannot move to a location of type view %s.') % (location.name))
|
||||
return True
|
||||
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Stock Picking
|
||||
#----------------------------------------------------------
|
||||
|
@ -635,7 +635,7 @@ class stock_picking(osv.osv):
|
|||
"""
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = {'min_date': False, 'max_date': False}
|
||||
res[id] = {'min_date': False, 'max_date': False, 'priority': '1'}
|
||||
if not ids:
|
||||
return res
|
||||
cr.execute("""select
|
||||
|
@ -1248,6 +1248,7 @@ class stock_picking(osv.osv):
|
|||
'''
|
||||
move_obj = self.pool.get('stock.move')
|
||||
operation_obj = self.pool.get('stock.pack.operation')
|
||||
moves = []
|
||||
for op in picking.pack_operation_ids:
|
||||
for product_id, remaining_qty in operation_obj._get_remaining_prod_quantities(cr, uid, op, context=context).items():
|
||||
if remaining_qty > 0:
|
||||
|
@ -1260,9 +1261,12 @@ class stock_picking(osv.osv):
|
|||
'product_uom': product.uom_id.id,
|
||||
'product_uom_qty': remaining_qty,
|
||||
'name': _('Extra Move: ') + product.name,
|
||||
'state': 'confirmed',
|
||||
'state': 'draft',
|
||||
}
|
||||
move_obj.create(cr, uid, vals, context=context)
|
||||
moves.append(move_obj.create(cr, uid, vals, context=context))
|
||||
if moves:
|
||||
move_obj.action_confirm(cr, uid, moves, context=context)
|
||||
return moves
|
||||
|
||||
def rereserve_quants(self, cr, uid, picking, move_ids=[], context=None):
|
||||
""" Unreserve quants then try to reassign quants."""
|
||||
|
@ -1289,11 +1293,13 @@ class stock_picking(osv.osv):
|
|||
else:
|
||||
need_rereserve, all_op_processed = self.picking_recompute_remaining_quantities(cr, uid, picking, context=context)
|
||||
#create extra moves in the picking (unexpected product moves coming from pack operations)
|
||||
todo_move_ids = []
|
||||
if not all_op_processed:
|
||||
self._create_extra_moves(cr, uid, picking, context=context)
|
||||
todo_move_ids += self._create_extra_moves(cr, uid, picking, context=context)
|
||||
|
||||
picking.refresh()
|
||||
#split move lines eventually
|
||||
todo_move_ids = []
|
||||
|
||||
toassign_move_ids = []
|
||||
for move in picking.move_lines:
|
||||
remaining_qty = move.remaining_qty
|
||||
|
@ -1371,7 +1377,7 @@ class stock_picking(osv.osv):
|
|||
op = operation
|
||||
if (operation.qty_done < operation.product_qty):
|
||||
new_operation = stock_operation_obj.copy(cr, uid, operation.id, {'product_qty': operation.qty_done,'qty_done': operation.qty_done}, context=context)
|
||||
stock_operation_obj.write(cr, uid, operation.id, {'product_qty': operation.product_qty - operation.qty_done,'qty_done': 0}, context=context)
|
||||
stock_operation_obj.write(cr, uid, operation.id, {'product_qty': operation.product_qty - operation.qty_done,'qty_done': 0, 'lot_id': False}, context=context)
|
||||
op = stock_operation_obj.browse(cr, uid, new_operation, context=context)
|
||||
pack_operation_ids.append(op.id)
|
||||
for record in op.linked_move_operation_ids:
|
||||
|
@ -1783,7 +1789,7 @@ class stock_move(osv.osv):
|
|||
'move_dest_id': move.id,
|
||||
'group_id': group_id,
|
||||
'route_ids': [(4, x.id) for x in move.route_ids],
|
||||
'warehouse_id': move.warehouse_id and move.warehouse_id.id or False,
|
||||
'warehouse_id': move.warehouse_id.id or (move.picking_type_id and move.picking_type_id.warehouse_id.id or False),
|
||||
'priority': move.priority,
|
||||
}
|
||||
|
||||
|
@ -3108,6 +3114,109 @@ class stock_warehouse(osv.osv):
|
|||
pull_obj.write(cr, uid, warehouse.mto_pull_id.id, mto_pull_vals, context=context)
|
||||
return True
|
||||
|
||||
def create_sequences_and_picking_types(self, cr, uid, warehouse, context=None):
|
||||
seq_obj = self.pool.get('ir.sequence')
|
||||
picking_type_obj = self.pool.get('stock.picking.type')
|
||||
#create new sequences
|
||||
in_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence in'), 'prefix': warehouse.code + '/IN/', 'padding': 5}, context=context)
|
||||
out_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence out'), 'prefix': warehouse.code + '/OUT/', 'padding': 5}, context=context)
|
||||
pack_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence packing'), 'prefix': warehouse.code + '/PACK/', 'padding': 5}, context=context)
|
||||
pick_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence picking'), 'prefix': warehouse.code + '/PICK/', 'padding': 5}, context=context)
|
||||
int_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence internal'), 'prefix': warehouse.code + '/INT/', 'padding': 5}, context=context)
|
||||
|
||||
wh_stock_loc = warehouse.lot_stock_id
|
||||
wh_input_stock_loc = warehouse.wh_input_stock_loc_id
|
||||
wh_output_stock_loc = warehouse.wh_output_stock_loc_id
|
||||
wh_pack_stock_loc = warehouse.wh_pack_stock_loc_id
|
||||
|
||||
#fetch customer and supplier locations, for references
|
||||
customer_loc, supplier_loc = self._get_partner_locations(cr, uid, warehouse.id, context=context)
|
||||
|
||||
#create in, out, internal picking types for warehouse
|
||||
input_loc = wh_input_stock_loc
|
||||
if warehouse.reception_steps == 'one_step':
|
||||
input_loc = wh_stock_loc
|
||||
output_loc = wh_output_stock_loc
|
||||
if warehouse.delivery_steps == 'ship_only':
|
||||
output_loc = wh_stock_loc
|
||||
|
||||
#choose the next available color for the picking types of this warehouse
|
||||
color = 0
|
||||
available_colors = [c%9 for c in range(3, 12)] # put flashy colors first
|
||||
all_used_colors = self.pool.get('stock.picking.type').search_read(cr, uid, [('warehouse_id', '!=', False), ('color', '!=', False)], ['color'], order='color')
|
||||
#don't use sets to preserve the list order
|
||||
for x in all_used_colors:
|
||||
if x['color'] in available_colors:
|
||||
available_colors.remove(x['color'])
|
||||
if available_colors:
|
||||
color = available_colors[0]
|
||||
|
||||
#order the picking types with a sequence allowing to have the following suit for each warehouse: reception, internal, pick, pack, ship.
|
||||
max_sequence = self.pool.get('stock.picking.type').search_read(cr, uid, [], ['sequence'], order='sequence desc')
|
||||
max_sequence = max_sequence and max_sequence[0]['sequence'] or 0
|
||||
|
||||
in_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Receptions'),
|
||||
'warehouse_id': warehouse.id,
|
||||
'code': 'incoming',
|
||||
'sequence_id': in_seq_id,
|
||||
'default_location_src_id': supplier_loc.id,
|
||||
'default_location_dest_id': input_loc.id,
|
||||
'sequence': max_sequence + 1,
|
||||
'color': color}, context=context)
|
||||
out_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Delivery Orders'),
|
||||
'warehouse_id': warehouse.id,
|
||||
'code': 'outgoing',
|
||||
'sequence_id': out_seq_id,
|
||||
'return_picking_type_id': in_type_id,
|
||||
'default_location_src_id': output_loc.id,
|
||||
'default_location_dest_id': customer_loc.id,
|
||||
'sequence': max_sequence + 4,
|
||||
'color': color}, context=context)
|
||||
picking_type_obj.write(cr, uid, [in_type_id], {'return_picking_type_id': out_type_id}, context=context)
|
||||
int_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Internal Transfers'),
|
||||
'warehouse_id': warehouse.id,
|
||||
'code': 'internal',
|
||||
'sequence_id': int_seq_id,
|
||||
'default_location_src_id': wh_stock_loc.id,
|
||||
'default_location_dest_id': wh_stock_loc.id,
|
||||
'active': True,
|
||||
'sequence': max_sequence + 2,
|
||||
'color': color}, context=context)
|
||||
pack_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pack'),
|
||||
'warehouse_id': warehouse.id,
|
||||
'code': 'internal',
|
||||
'sequence_id': pack_seq_id,
|
||||
'default_location_src_id': wh_pack_stock_loc.id,
|
||||
'default_location_dest_id': output_loc.id,
|
||||
'active': warehouse.delivery_steps == 'pick_pack_ship',
|
||||
'sequence': max_sequence + 3,
|
||||
'color': color}, context=context)
|
||||
pick_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pick'),
|
||||
'warehouse_id': warehouse.id,
|
||||
'code': 'internal',
|
||||
'sequence_id': pick_seq_id,
|
||||
'default_location_src_id': wh_stock_loc.id,
|
||||
'default_location_dest_id': wh_pack_stock_loc.id,
|
||||
'active': warehouse.delivery_steps != 'ship_only',
|
||||
'sequence': max_sequence + 2,
|
||||
'color': color}, context=context)
|
||||
|
||||
#write picking types on WH
|
||||
vals = {
|
||||
'in_type_id': in_type_id,
|
||||
'out_type_id': out_type_id,
|
||||
'pack_type_id': pack_type_id,
|
||||
'pick_type_id': pick_type_id,
|
||||
'int_type_id': int_type_id,
|
||||
}
|
||||
super(stock_warehouse, self).write(cr, uid, warehouse.id, vals=vals, context=context)
|
||||
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -3147,108 +3256,10 @@ class stock_warehouse(osv.osv):
|
|||
}, context=context_with_inactive)
|
||||
vals[values['field']] = location_id
|
||||
|
||||
#create new sequences
|
||||
in_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': vals.get('name', '') + _(' Sequence in'), 'prefix': vals.get('code', '') + '/IN/', 'padding': 5}, context=context)
|
||||
out_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': vals.get('name', '') + _(' Sequence out'), 'prefix': vals.get('code', '') + '/OUT/', 'padding': 5}, context=context)
|
||||
pack_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': vals.get('name', '') + _(' Sequence packing'), 'prefix': vals.get('code', '') + '/PACK/', 'padding': 5}, context=context)
|
||||
pick_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': vals.get('name', '') + _(' Sequence picking'), 'prefix': vals.get('code', '') + '/PICK/', 'padding': 5}, context=context)
|
||||
int_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': vals.get('name', '') + _(' Sequence internal'), 'prefix': vals.get('code', '') + '/INT/', 'padding': 5}, context=context)
|
||||
|
||||
#create WH
|
||||
new_id = super(stock_warehouse, self).create(cr, uid, vals=vals, context=context)
|
||||
|
||||
warehouse = self.browse(cr, uid, new_id, context=context)
|
||||
wh_stock_loc = warehouse.lot_stock_id
|
||||
wh_input_stock_loc = warehouse.wh_input_stock_loc_id
|
||||
wh_output_stock_loc = warehouse.wh_output_stock_loc_id
|
||||
wh_pack_stock_loc = warehouse.wh_pack_stock_loc_id
|
||||
|
||||
#fetch customer and supplier locations, for references
|
||||
customer_loc, supplier_loc = self._get_partner_locations(cr, uid, new_id, context=context)
|
||||
|
||||
#create in, out, internal picking types for warehouse
|
||||
input_loc = wh_input_stock_loc
|
||||
if warehouse.reception_steps == 'one_step':
|
||||
input_loc = wh_stock_loc
|
||||
output_loc = wh_output_stock_loc
|
||||
if warehouse.delivery_steps == 'ship_only':
|
||||
output_loc = wh_stock_loc
|
||||
|
||||
#choose the next available color for the picking types of this warehouse
|
||||
color = 0
|
||||
available_colors = [c%9 for c in range(3, 12)] # put flashy colors first
|
||||
all_used_colors = self.pool.get('stock.picking.type').search_read(cr, uid, [('warehouse_id', '!=', False), ('color', '!=', False)], ['color'], order='color')
|
||||
#don't use sets to preserve the list order
|
||||
for x in all_used_colors:
|
||||
if x['color'] in available_colors:
|
||||
available_colors.remove(x['color'])
|
||||
if available_colors:
|
||||
color = available_colors[0]
|
||||
|
||||
#order the picking types with a sequence allowing to have the following suit for each warehouse: reception, internal, pick, pack, ship.
|
||||
max_sequence = self.pool.get('stock.picking.type').search_read(cr, uid, [], ['sequence'], order='sequence desc')
|
||||
max_sequence = max_sequence and max_sequence[0]['sequence'] or 0
|
||||
|
||||
in_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Receptions'),
|
||||
'warehouse_id': new_id,
|
||||
'code': 'incoming',
|
||||
'sequence_id': in_seq_id,
|
||||
'default_location_src_id': supplier_loc.id,
|
||||
'default_location_dest_id': input_loc.id,
|
||||
'sequence': max_sequence + 1,
|
||||
'color': color}, context=context)
|
||||
out_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Delivery Orders'),
|
||||
'warehouse_id': new_id,
|
||||
'code': 'outgoing',
|
||||
'sequence_id': out_seq_id,
|
||||
'return_picking_type_id': in_type_id,
|
||||
'default_location_src_id': output_loc.id,
|
||||
'default_location_dest_id': customer_loc.id,
|
||||
'sequence': max_sequence + 4,
|
||||
'color': color}, context=context)
|
||||
picking_type_obj.write(cr, uid, [in_type_id], {'return_picking_type_id': out_type_id}, context=context)
|
||||
int_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Internal Transfers'),
|
||||
'warehouse_id': new_id,
|
||||
'code': 'internal',
|
||||
'sequence_id': int_seq_id,
|
||||
'default_location_src_id': wh_stock_loc.id,
|
||||
'default_location_dest_id': wh_stock_loc.id,
|
||||
'active': True,
|
||||
'sequence': max_sequence + 2,
|
||||
'color': color}, context=context)
|
||||
pack_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pack'),
|
||||
'warehouse_id': new_id,
|
||||
'code': 'internal',
|
||||
'sequence_id': pack_seq_id,
|
||||
'default_location_src_id': wh_pack_stock_loc.id,
|
||||
'default_location_dest_id': output_loc.id,
|
||||
'active': delivery_steps == 'pick_pack_ship',
|
||||
'sequence': max_sequence + 3,
|
||||
'color': color}, context=context)
|
||||
pick_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pick'),
|
||||
'warehouse_id': new_id,
|
||||
'code': 'internal',
|
||||
'sequence_id': pick_seq_id,
|
||||
'default_location_src_id': wh_stock_loc.id,
|
||||
'default_location_dest_id': wh_pack_stock_loc.id,
|
||||
'active': delivery_steps != 'ship_only',
|
||||
'sequence': max_sequence + 2,
|
||||
'color': color}, context=context)
|
||||
|
||||
#write picking types on WH
|
||||
vals = {
|
||||
'in_type_id': in_type_id,
|
||||
'out_type_id': out_type_id,
|
||||
'pack_type_id': pack_type_id,
|
||||
'pick_type_id': pick_type_id,
|
||||
'int_type_id': int_type_id,
|
||||
}
|
||||
super(stock_warehouse, self).write(cr, uid, new_id, vals=vals, context=context)
|
||||
self.create_sequences_and_picking_types(cr, uid, warehouse, context=context)
|
||||
warehouse.refresh()
|
||||
|
||||
#create routes and push/pull rules
|
||||
|
@ -3292,7 +3303,8 @@ class stock_warehouse(osv.osv):
|
|||
for push in route.push_ids:
|
||||
push_obj.write(cr, uid, push.id, {'name': pull.name.replace(warehouse.name, name, 1)}, context=context)
|
||||
#change the mto pull rule name
|
||||
pull_obj.write(cr, uid, warehouse.mto_pull_id.id, {'name': warehouse.mto_pull_id.name.replace(warehouse.name, name, 1)}, context=context)
|
||||
if warehouse.mto_pull_id.id:
|
||||
pull_obj.write(cr, uid, warehouse.mto_pull_id.id, {'name': warehouse.mto_pull_id.name.replace(warehouse.name, name, 1)}, context=context)
|
||||
|
||||
def _check_delivery_resupply(self, cr, uid, warehouse, new_location, change_to_multiple, context=None):
|
||||
""" Will check if the resupply routes from this warehouse follow the changes of number of delivery steps """
|
||||
|
@ -3374,11 +3386,12 @@ class stock_warehouse(osv.osv):
|
|||
if vals.get('name'):
|
||||
name = vals.get('name', warehouse.name)
|
||||
self._handle_renaming(cr, uid, warehouse, name, vals.get('code', warehouse.code), context=context_with_inactive)
|
||||
seq_obj.write(cr, uid, warehouse.in_type_id.sequence_id.id, {'name': name + _(' Sequence in'), 'prefix': vals.get('code', warehouse.code) + '\IN\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.pack_type_id.sequence_id.id, {'name': name + _(' Sequence packing'), 'prefix': vals.get('code', warehouse.code) + '\PACK\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.pick_type_id.sequence_id.id, {'name': name + _(' Sequence picking'), 'prefix': vals.get('code', warehouse.code) + '\PICK\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.int_type_id.sequence_id.id, {'name': name + _(' Sequence internal'), 'prefix': vals.get('code', warehouse.code) + '\INT\\'}, context=context)
|
||||
if warehouse.in_type_id:
|
||||
seq_obj.write(cr, uid, warehouse.in_type_id.sequence_id.id, {'name': name + _(' Sequence in'), 'prefix': vals.get('code', warehouse.code) + '\IN\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.pack_type_id.sequence_id.id, {'name': name + _(' Sequence packing'), 'prefix': vals.get('code', warehouse.code) + '\PACK\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.pick_type_id.sequence_id.id, {'name': name + _(' Sequence picking'), 'prefix': vals.get('code', warehouse.code) + '\PICK\\'}, context=context)
|
||||
seq_obj.write(cr, uid, warehouse.int_type_id.sequence_id.id, {'name': name + _(' Sequence internal'), 'prefix': vals.get('code', warehouse.code) + '\INT\\'}, context=context)
|
||||
if vals.get('resupply_wh_ids') and not vals.get('resupply_route_ids'):
|
||||
for cmd in vals.get('resupply_wh_ids'):
|
||||
if cmd[0] == 6:
|
||||
|
@ -3521,7 +3534,6 @@ class stock_location_path(osv.osv):
|
|||
# -------------------------
|
||||
|
||||
from openerp.report import report_sxw
|
||||
report_sxw.report_sxw('report.stock.quant.package.barcode', 'stock.quant.package', 'addons/stock/report/package_barcode.rml')
|
||||
|
||||
class stock_package(osv.osv):
|
||||
"""
|
||||
|
@ -3586,13 +3598,13 @@ class stock_package(osv.osv):
|
|||
'complete_name': fields.function(_complete_name, type='char', string="Package Name",),
|
||||
'parent_left': fields.integer('Left Parent', select=1),
|
||||
'parent_right': fields.integer('Right Parent', select=1),
|
||||
'packaging_id': fields.many2one('product.packaging', 'Packaging', help="This field should be completed only if everything inside the package share the same product, otherwise it doesn't really makes sense."),
|
||||
'packaging_id': fields.many2one('product.packaging', 'Packaging', help="This field should be completed only if everything inside the package share the same product, otherwise it doesn't really makes sense.", select=True),
|
||||
'ul_id': fields.many2one('product.ul', 'Logistic Unit'),
|
||||
'location_id': fields.function(_get_package_info, type='many2one', relation='stock.location', string='Location', multi="package",
|
||||
store={
|
||||
'stock.quant': (_get_packages, ['location_id'], 10),
|
||||
'stock.quant.package': (_get_packages_to_relocate, ['quant_ids', 'children_ids', 'parent_id'], 10),
|
||||
}, readonly=True),
|
||||
}, readonly=True, select=True),
|
||||
'quant_ids': fields.one2many('stock.quant', 'package_id', 'Bulk Content', readonly=True),
|
||||
'parent_id': fields.many2one('stock.quant.package', 'Parent Package', help="The package containing this item", ondelete='restrict', readonly=True),
|
||||
'children_ids': fields.one2many('stock.quant.package', 'parent_id', 'Contained Packages', readonly=True),
|
||||
|
@ -3600,12 +3612,12 @@ class stock_package(osv.osv):
|
|||
store={
|
||||
'stock.quant': (_get_packages, ['company_id'], 10),
|
||||
'stock.quant.package': (_get_packages_to_relocate, ['quant_ids', 'children_ids', 'parent_id'], 10),
|
||||
}, readonly=True),
|
||||
}, readonly=True, select=True),
|
||||
'owner_id': fields.function(_get_package_info, type='many2one', relation='res.partner', string='Owner', multi="package",
|
||||
store={
|
||||
'stock.quant': (_get_packages, ['owner_id'], 10),
|
||||
'stock.quant.package': (_get_packages_to_relocate, ['quant_ids', 'children_ids', 'parent_id'], 10),
|
||||
}, readonly=True),
|
||||
}, readonly=True, select=True),
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda self, cr, uid, context: self.pool.get('ir.sequence').get(cr, uid, 'stock.quant.package') or _('Unknown Pack')
|
||||
|
@ -3818,8 +3830,8 @@ class stock_pack_operation(osv.osv):
|
|||
if pack_op.qty_done < pack_op.product_qty:
|
||||
# we split the operation in two
|
||||
op = self.copy(cr, uid, pack_op.id, {'product_qty': pack_op.qty_done, 'qty_done': pack_op.qty_done}, context=context)
|
||||
self.write(cr, uid, ids, {'product_qty': pack_op.product_qty - pack_op.qty_done, 'qty_done': 0}, context=context)
|
||||
processed_ids.append(op)
|
||||
self.write(cr, uid, [pack_op.id], {'product_qty': pack_op.product_qty - pack_op.qty_done, 'qty_done': 0, 'lot_id': False}, context=context)
|
||||
processed_ids.append(op)
|
||||
self.write(cr, uid, processed_ids, {'processed': 'true'}, context=context)
|
||||
|
||||
def create_and_assign_lot(self, cr, uid, id, name, context=None):
|
||||
|
@ -3828,10 +3840,16 @@ class stock_pack_operation(osv.osv):
|
|||
obj = self.browse(cr,uid,id,context)
|
||||
product_id = obj.product_id.id
|
||||
val = {'product_id': product_id}
|
||||
new_lot_id = False
|
||||
if name:
|
||||
lots = self.pool.get('stock.production.lot').search(cr, uid, ['&', ('name', '=', name), ('product_id', '=', product_id)], context=context)
|
||||
if lots:
|
||||
new_lot_id = lots[0]
|
||||
val.update({'name': name})
|
||||
|
||||
if not obj.lot_id:
|
||||
new_lot_id = self.pool.get('stock.production.lot').create(cr, uid, val, context=context)
|
||||
if not new_lot_id:
|
||||
new_lot_id = self.pool.get('stock.production.lot').create(cr, uid, val, context=context)
|
||||
self.write(cr, uid, id, {'lot_id': new_lot_id}, context=context)
|
||||
|
||||
def _search_and_increment(self, cr, uid, picking_id, domain, filter_visible=False, visible_op_ids=False, increment=True, context=None):
|
||||
|
@ -3869,11 +3887,15 @@ class stock_pack_operation(osv.osv):
|
|||
self.write(cr, uid, [operation_id], {'qty_done': qty}, context=context)
|
||||
else:
|
||||
#no existing operation found for the given domain and picking => create a new one
|
||||
picking_obj = self.pool.get("stock.picking")
|
||||
picking = picking_obj.browse(cr, uid, picking_id, context=context)
|
||||
values = {
|
||||
'picking_id': picking_id,
|
||||
'product_qty': 0,
|
||||
'location_id': picking.location_id.id,
|
||||
'location_dest_id': picking.location_dest_id.id,
|
||||
'qty_done': 1,
|
||||
}
|
||||
}
|
||||
for key in domain:
|
||||
var_name, dummy, value = key
|
||||
uom_id = False
|
||||
|
@ -4072,11 +4094,11 @@ class stock_picking_type(osv.osv):
|
|||
tristates = []
|
||||
for picking in picking_obj.browse(cr, uid, picking_ids, context=context):
|
||||
if picking.date_done > picking.date:
|
||||
tristates.insert(0, {'tooltip': picking.name + _(': Late'), 'value': -1})
|
||||
tristates.insert(0, {'tooltip': picking.name or '' + _(': Late'), 'value': -1})
|
||||
elif picking.backorder_id:
|
||||
tristates.insert(0, {'tooltip': picking.name + _(': Backorder exists'), 'value': 0})
|
||||
tristates.insert(0, {'tooltip': picking.name or '' + _(': Backorder exists'), 'value': 0})
|
||||
else:
|
||||
tristates.insert(0, {'tooltip': picking.name + _(': OK'), 'value': 1})
|
||||
tristates.insert(0, {'tooltip': picking.name or '' + _(': OK'), 'value': 1})
|
||||
res[picking_type_id] = tristates
|
||||
return res
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
<record model="ir.actions.act_window" id="location_open_quants">
|
||||
<field name="context">{'search_default_productgroup': 1}</field>
|
||||
<field name="domain">[('location_id', 'child_of', active_ids)]</field>
|
||||
<field name="name">Quants</field>
|
||||
<field name="name">Current Stock</field>
|
||||
<field name="res_model">stock.quant</field>
|
||||
</record>
|
||||
|
||||
|
@ -1356,6 +1356,7 @@
|
|||
<field name="model">stock.picking.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking Types">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="warehouse_id"/>
|
||||
<field name="sequence_id"/>
|
||||
|
@ -1794,7 +1795,7 @@
|
|||
</record>
|
||||
<record model="ir.actions.act_window" id="product_open_quants">
|
||||
<field name="context">{'search_default_internal_loc': 1, 'search_default_product_id': active_id, 'search_default_locationgroup':1}</field>
|
||||
<field name="name">Quants</field>
|
||||
<field name="name">Current Stock</field>
|
||||
<field name="res_model">stock.quant</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -7,18 +7,15 @@
|
|||
<t>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<img class="image" t-att-src="'data:image/png;base64,%s' % res_company.logo" style="border:auto;"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 mt6">
|
||||
<table class="table table-condensed" style="border-bottom: 3px solid black !important;"><thead><th> </th></thead></table>
|
||||
<img t-if="not o.loc_barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
|
||||
<img t-if="o.loc_barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.loc_barcode, 600, 100)" style="width:300px;height:50px"/>
|
||||
<p class="text-center" t-if="not o.loc_barcode" t-field="o.name"></p>
|
||||
<p class="text-center" t-if="o.loc_barcode" t-field="o.loc_barcode"></p>
|
||||
<p>
|
||||
<span t-if="not o.loc_barcode" t-field="o.name"/>
|
||||
<span t-if="o.loc_barcode" t-field="o.loc_barcode"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
<t t-call="report.external_layout">
|
||||
<div class="page">
|
||||
<div class="row"><div class="col-xs-4 pull-right">
|
||||
<img t-att-src="'/report/barcode/Code128/%s' % o.name"/>
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px;"/>
|
||||
</div></div>
|
||||
<div t-if="o.picking_type_id.code=='incoming'">
|
||||
<div t-if="o.picking_type_id.code=='incoming' and o.partner_id">
|
||||
<span><strong>Supplier Address:</strong></span>
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code=='internal'">
|
||||
<div t-if="o.picking_type_id.code=='internal' and o.partner_id">
|
||||
<span><strong>Warehouse Address:</strong></span>
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code=='outgoing'">
|
||||
<div t-if="o.picking_type_id.code=='outgoing' and o.partner_id">
|
||||
<span><strong>Customer Address:</strong></span>
|
||||
</div>
|
||||
<div t-if="o.partner_id" name="partner_header">
|
||||
|
@ -73,7 +73,7 @@
|
|||
<t t-if="o.picking_type_id.code != 'incoming'"><td><span t-field="move.location_id"/></td></t>
|
||||
<td>
|
||||
<span t-if="move.product_id and move.product_id.ean13">
|
||||
<img t-att-src="'/report/barcode/EAN13/%s' % move.product_id.ean13"/>
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', move.product_id.ean13, 600, 100)" style="width:300px;height:50px"/>
|
||||
</span>
|
||||
</td>
|
||||
<t t-if="o.picking_type_id.code != 'outgoing'"><td><span t-field="move.location_dest_id"/></td></t>
|
||||
|
@ -104,13 +104,13 @@
|
|||
</t>
|
||||
<td>
|
||||
<span t-if="pack_operation.lot_id">
|
||||
<img t-att-src="'/report/barcode/Code128/%s' % pack_operation.lot_id.name"/>
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', pack_operation.lot_id.name, 600, 100)" style="width:300px;height:50px"/>
|
||||
</span>
|
||||
<span t-if="pack_operation.product_id and not pack_operation.lot_id and pack_operation.product_id.ean13">
|
||||
<img t-att-src="'/report/barcode/EAN13/%s' % pack_operation.product_id.ean13"/>
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', pack_operation.product_id.ean13, 600, 100)" style="width:300px;height:50px"/>
|
||||
</span>
|
||||
<span t-if="pack_operation.package_id and not pack_operation.product_id">
|
||||
<img t-att-src="'/report/barcode/Code128/%s' % pack_operation.package_id.name"/>
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', pack_operation.package_id.name, 600, 100)" style="width:300px;height:50px"/>
|
||||
</span>
|
||||
</td>
|
||||
<t t-if="o.picking_type_id.code != 'outgoing'"><td><span t-field="pack_operation.location_dest_id"/>
|
||||
|
|
|
@ -43,8 +43,10 @@ class procurement_compute(osv.osv_memory):
|
|||
proc_obj = self.pool.get('procurement.order')
|
||||
#As this function is in a new thread, I need to open a new cursor, because the old one may be closed
|
||||
new_cr = self.pool.cursor()
|
||||
for proc in self.browse(new_cr, uid, ids, context=context):
|
||||
proc_obj._procure_orderpoint_confirm(new_cr, uid, use_new_cursor=new_cr.dbname, context=context)
|
||||
user_obj = self.pool.get('res.users')
|
||||
user = user_obj.browse(new_cr, uid, uid, context=context)
|
||||
for comp in user.company_ids:
|
||||
proc_obj._procure_orderpoint_confirm(new_cr, uid, use_new_cursor=new_cr.dbname, company_id = comp.id, context=context)
|
||||
#close the new cursor
|
||||
new_cr.close()
|
||||
return {}
|
||||
|
|
|
@ -53,6 +53,7 @@ Dashboard / Reports for Warehouse Management includes:
|
|||
'wizard/stock_change_standard_price_view.xml',
|
||||
'wizard/stock_invoice_onshipping_view.xml',
|
||||
'wizard/stock_valuation_history_view.xml',
|
||||
'wizard/stock_return_picking_view.xml',
|
||||
'product_data.xml',
|
||||
'product_view.xml',
|
||||
'stock_account_view.xml',
|
||||
|
|
|
@ -114,19 +114,16 @@ class product_product(osv.osv):
|
|||
self.write(cr, uid, rec_id, {'standard_price': new_price})
|
||||
return True
|
||||
|
||||
|
||||
class product_template(osv.osv):
|
||||
_name = 'product.template'
|
||||
_inherit = 'product.template'
|
||||
_columns = {
|
||||
'valuation': fields.property(type='selection', selection=[('manual_periodic', 'Periodical (manual)'),
|
||||
('real_time', 'Real Time (automated)')], string='Inventory Valuation',
|
||||
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves, with product price as specified by the 'Costing Method'" \
|
||||
"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),
|
||||
}
|
||||
|
||||
|
||||
class product_template(osv.osv):
|
||||
_name = 'product.template'
|
||||
_inherit = 'product.template'
|
||||
_columns = {
|
||||
'cost_method': fields.property(type='selection', selection=[('standard', 'Standard Price'), ('average', 'Average Price'), ('real', 'Real Price')],
|
||||
help="""Standard Price: The cost price is manually updated at the end of a specific period (usually every year).
|
||||
Average Price: The cost price is recomputed at each incoming shipment and used for the product valuation.
|
||||
|
|
|
@ -30,11 +30,7 @@
|
|||
<field name="property_stock_account_input" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="property_stock_account_output" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='standard_price']" position='replace'>
|
||||
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
|
||||
<field name="cost_method" groups="stock_account.group_inventory_valuation"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -27,11 +27,10 @@ class stock_location_path(osv.osv):
|
|||
'invoice_state': fields.selection([
|
||||
("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not Applicable")], "Invoice Status",
|
||||
required=True,),
|
||||
("none", "Not Applicable")], "Invoice Status",),
|
||||
}
|
||||
_defaults = {
|
||||
'invoice_state': 'none',
|
||||
'invoice_state': '',
|
||||
}
|
||||
|
||||
#----------------------------------------------------------
|
||||
|
@ -43,11 +42,10 @@ class procurement_rule(osv.osv):
|
|||
'invoice_state': fields.selection([
|
||||
("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not Applicable")], "Invoice Status",
|
||||
required=True),
|
||||
("none", "Not Applicable")], "Invoice Status",),
|
||||
}
|
||||
_defaults = {
|
||||
'invoice_state': 'none',
|
||||
'invoice_state': '',
|
||||
}
|
||||
|
||||
#----------------------------------------------------------
|
||||
|
@ -61,16 +59,16 @@ class procurement_order(osv.osv):
|
|||
'invoice_state': fields.selection([("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not Applicable")
|
||||
], "Invoice Control", required=True),
|
||||
], "Invoice Control"),
|
||||
}
|
||||
|
||||
def _run_move_create(self, cr, uid, procurement, context=None):
|
||||
res = super(procurement_order, self)._run_move_create(cr, uid, procurement, context=context)
|
||||
res.update({'invoice_state': (procurement.rule_id.invoice_state in ('none', False) and procurement.invoice_state or procurement.rule_id.invoice_state) or 'none'})
|
||||
res.update({'invoice_state': procurement.rule_id.invoice_state or procurement.invoice_state or 'none'})
|
||||
return res
|
||||
|
||||
_defaults = {
|
||||
'invoice_state': 'none'
|
||||
'invoice_state': ''
|
||||
}
|
||||
|
||||
|
||||
|
@ -92,7 +90,7 @@ class stock_move(osv.osv):
|
|||
}
|
||||
|
||||
def _get_master_data(self, cr, uid, move, company, context=None):
|
||||
''' returns a tupple (browse_record(res.partner), ID(res.users), ID(res.currency)'''
|
||||
''' returns a tuple (browse_record(res.partner), ID(res.users), ID(res.currency)'''
|
||||
return move.picking_id.partner_id, uid, company.currency_id.id
|
||||
|
||||
def _create_invoice_line_from_vals(self, cr, uid, move, invoice_line_vals, context=None):
|
||||
|
@ -204,7 +202,7 @@ class stock_picking(osv.osv):
|
|||
for picking in self.browse(cr, uid, ids, context=context):
|
||||
key = group and picking.id or True
|
||||
for move in picking.move_lines:
|
||||
if move.procurement_id and (move.procurement_id.invoice_state == '2binvoiced') or move.invoice_state == '2binvoiced':
|
||||
if move.invoice_state == '2binvoiced':
|
||||
if (move.state != 'cancel') and not move.scrapped:
|
||||
todo.setdefault(key, [])
|
||||
todo[key].append(move)
|
||||
|
@ -259,12 +257,7 @@ class stock_picking(osv.osv):
|
|||
invoice_line_vals['origin'] = origin
|
||||
|
||||
move_obj._create_invoice_line_from_vals(cr, uid, move, invoice_line_vals, context=context)
|
||||
|
||||
move_obj.write(cr, uid, move.id, {'invoice_state': 'invoiced'}, context=context)
|
||||
if move.procurement_id:
|
||||
self.pool.get('procurement.order').write(cr, uid, [move.procurement_id.id], {
|
||||
'invoice_state': 'invoiced',
|
||||
}, context=context)
|
||||
|
||||
invoice_obj.button_compute(cr, uid, invoices.values(), context=context, set_total=(inv_type in ('in_invoice', 'in_refund')))
|
||||
return invoices.values()
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</record>
|
||||
<record forcecreate="True" id="default_valuation" model="ir.property">
|
||||
<field name="name">Valuation Property</field>
|
||||
<field name="fields_id" search="[('model', '=', 'product.product'), ('name', '=', 'valuation')]"/>
|
||||
<field name="fields_id" search="[('model', '=', 'product.template'), ('name', '=', 'valuation')]"/>
|
||||
<field name="value">manual_periodic</field>
|
||||
<field name="type">selection</field>
|
||||
</record>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='do_partial_open_barcode']" position="after">
|
||||
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|',('state','<>','done'),('invoice_state','<>','2binvoiced')]}" type="action" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="%(action_stock_invoice_onshipping)d" string="Refund Invoice" attrs="{'invisible': ['|',('state','<>','done'),('invoice_state','<>','invoiced')]}" type="action" class="oe_highlight" groups="base.group_user" context="{'inv_type': 'out_refund'}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_type']" position="after">
|
||||
<field name="invoice_state" groups="account.group_account_invoice"/>
|
||||
|
|
|
@ -22,3 +22,4 @@
|
|||
import stock_change_standard_price
|
||||
import stock_invoice_onshipping
|
||||
import stock_valuation_history
|
||||
import stock_return_picking
|
||||
|
|
|
@ -24,34 +24,48 @@ from openerp.tools.translate import _
|
|||
|
||||
class stock_invoice_onshipping(osv.osv_memory):
|
||||
def _get_journal(self, cr, uid, context=None):
|
||||
res = self._get_journal_id(cr, uid, context=context)
|
||||
if res:
|
||||
return res[0][0]
|
||||
return False
|
||||
|
||||
def _get_journal_id(self, cr, uid, context=None):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
journal_type = self._get_journal_type(cr, uid, context=context)
|
||||
journals = journal_obj.search(cr, uid, [('type', '=', journal_type)])
|
||||
return journals and journals[0] or False
|
||||
|
||||
def _get_journal_type(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
value = journal_obj.search(cr, uid, [('type', 'in',('sale','sale_Refund'))])
|
||||
res_ids = context and context.get('active_ids', [])
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
pickings = pick_obj.browse(cr, uid, res_ids, context=context)
|
||||
vals = []
|
||||
for jr_type in journal_obj.browse(cr, uid, value, context=context):
|
||||
t1 = jr_type.id,jr_type.name
|
||||
if t1 not in vals:
|
||||
vals.append(t1)
|
||||
return vals
|
||||
pick = pickings and pickings[0]
|
||||
if not pick or not pick.move_lines:
|
||||
return 'sale'
|
||||
src_usage = pick.move_lines[0].location_id.usage
|
||||
dest_usage = pick.move_lines[0].location_dest_id.usage
|
||||
type = pick.picking_type_id.code
|
||||
if type == 'outgoing' and dest_usage == 'supplier':
|
||||
journal_type = 'purchase_refund'
|
||||
elif type == 'outgoing' and dest_usage == 'customer':
|
||||
journal_type = 'sale'
|
||||
elif type == 'incoming' and src_usage == 'supplier':
|
||||
journal_type = 'purchase'
|
||||
elif type == 'incoming' and src_usage == 'customer':
|
||||
journal_type = 'sale_refund'
|
||||
else:
|
||||
journal_type = 'sale'
|
||||
return journal_type
|
||||
|
||||
_name = "stock.invoice.onshipping"
|
||||
_description = "Stock Invoice Onshipping"
|
||||
_columns = {
|
||||
'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True),
|
||||
'journal_type': fields.selection([('purchase_refund', 'Refund Purchase'), ('purchase', 'Create Supplier Invoice'),
|
||||
('sale_refund', 'Refund Sale'), ('sale', 'Create Customer Invoice')], 'Journal Type', readonly=True),
|
||||
'group': fields.boolean("Group by partner"),
|
||||
'inv_type': fields.selection([('out_invoice','Create Invoice'),('out_refund','Refund Invoice')], "Invoice Type"),
|
||||
'invoice_date': fields.date('Invoice Date'),
|
||||
}
|
||||
_defaults = {
|
||||
'journal_type': _get_journal_type,
|
||||
'journal_id' : _get_journal,
|
||||
'inv_type': lambda self,cr,uid,ctx: ctx.get('inv_type', 'out_invoice')
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
|
@ -71,24 +85,30 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
def open_invoice(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
invoice_ids = self.create_invoice(cr, uid, ids, context=context)
|
||||
if not invoice_ids:
|
||||
raise osv.except_osv(_('Error!'), _('No invoice created!'))
|
||||
|
||||
onshipdata_obj = self.read(cr, uid, ids, ['journal_id', 'group', 'invoice_date', 'inv_type'])
|
||||
inv_type = onshipdata_obj[0]['inv_type']
|
||||
data = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
action_model = False
|
||||
action = {}
|
||||
|
||||
|
||||
journal2type = {'sale':'out_invoice', 'purchase':'in_invoice' , 'sale_refund':'out_refund', 'purchase_refund':'in_refund'}
|
||||
inv_type = journal2type.get(data.journal_type) or 'out_invoice'
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
if inv_type == "out_refund":
|
||||
action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree3")
|
||||
elif inv_type == "out_invoice":
|
||||
action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree1")
|
||||
if inv_type == "out_invoice":
|
||||
action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree1')
|
||||
elif inv_type == "in_invoice":
|
||||
action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree2')
|
||||
elif inv_type == "out_refund":
|
||||
action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree3')
|
||||
elif inv_type == "in_refund":
|
||||
action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree4')
|
||||
|
||||
if action_model:
|
||||
action_pool = self.pool[action_model]
|
||||
if action_id:
|
||||
action_pool = self.pool['ir.actions.act_window']
|
||||
action = action_pool.read(cr, uid, action_id, context=context)
|
||||
action['domain'] = "[('id','in', ["+','.join(map(str,invoice_ids))+"])]"
|
||||
return action
|
||||
|
@ -97,18 +117,17 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
def create_invoice(self, cr, uid, ids, context=None):
|
||||
context = context or {}
|
||||
picking_pool = self.pool.get('stock.picking')
|
||||
onshipdata_obj = self.read(cr, uid, ids, ['journal_id', 'group', 'invoice_date', 'inv_type'])
|
||||
|
||||
context['date_inv'] = onshipdata_obj[0]['invoice_date']
|
||||
inv_type = onshipdata_obj[0]['inv_type']
|
||||
data = self.browse(cr, uid, ids[0], context=context)
|
||||
journal2type = {'sale':'out_invoice', 'purchase':'in_invoice', 'sale_refund':'out_refund', 'purchase_refund':'in_refund'}
|
||||
context['date_inv'] = data.invoice_date
|
||||
acc_journal = self.pool.get("account.journal")
|
||||
inv_type = journal2type.get(data.journal_type) or 'out_invoice'
|
||||
context['inv_type'] = inv_type
|
||||
|
||||
active_ids = context.get('active_ids', [])
|
||||
if isinstance(onshipdata_obj[0]['journal_id'], tuple):
|
||||
onshipdata_obj[0]['journal_id'] = onshipdata_obj[0]['journal_id'][0]
|
||||
res = picking_pool.action_invoice_create(cr, uid, active_ids,
|
||||
journal_id = onshipdata_obj[0]['journal_id'],
|
||||
group = onshipdata_obj[0]['group'],
|
||||
journal_id = data.journal_id.id,
|
||||
group = data.group,
|
||||
type = inv_type,
|
||||
context=context)
|
||||
return res
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Create invoice">
|
||||
<h1>
|
||||
<field name="inv_type" readonly="1"/>
|
||||
<field name="journal_type" readonly="1"/>
|
||||
</h1>
|
||||
<group>
|
||||
<field name="journal_id"/>
|
||||
<field name="journal_id" domain="[('type','=',journal_type)]"/>
|
||||
<field name="group"/>
|
||||
<field name="invoice_date" />
|
||||
</group>
|
||||
|
@ -23,17 +23,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<act_window name="Create Invoice"
|
||||
res_model="stock.invoice.onshipping"
|
||||
src_model="stock.picking"
|
||||
key2="client_action_multi"
|
||||
multi="True"
|
||||
view_mode="form"
|
||||
view_type="form"
|
||||
target="new"
|
||||
id="action_stock_invoice_onshipping"/>
|
||||
|
||||
<act_window name="Create Draft Invoices"
|
||||
res_model="stock.invoice.onshipping"
|
||||
src_model="stock.picking"
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
from openerp.tools.translate import _
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class stock_return_picking(osv.osv_memory):
|
||||
_inherit = 'stock.return.picking'
|
||||
_columns = {
|
||||
'invoice_state': fields.selection([('2binvoiced', 'To be refunded/invoiced'), ('none', 'No invoicing')], 'Invoicing',required=True),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(stock_return_picking, self).default_get(cr, uid, fields, context=context)
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
pick = pick_obj.browse(cr, uid, record_id, context=context)
|
||||
if pick:
|
||||
if 'invoice_state' in fields:
|
||||
if pick.invoice_state=='invoiced':
|
||||
res.update({'invoice_state': '2binvoiced'})
|
||||
else:
|
||||
res.update({'invoice_state': 'none'})
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def _create_returns(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.browse(cr, uid, ids[0], context=context)
|
||||
new_picking, picking_type_id = super(stock_return_picking, self)._create_returns(cr, uid, ids, context=context)
|
||||
if data.invoice_state == '2binvoiced':
|
||||
pick_obj = self.pool.get("stock.picking")
|
||||
move_obj = self.pool.get("stock.move")
|
||||
move_ids = [x.id for x in pick_obj.browse(cr, uid, new_picking, context=context).move_lines]
|
||||
move_obj.write(cr, uid, move_ids, {'invoice_state': '2binvoiced'})
|
||||
return new_picking, picking_type_id
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,14 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<record id="view_stock_return_picking_form_inherit" model="ir.ui.view">
|
||||
<field name="name">Return lines</field>
|
||||
<field name="model">stock.return.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_return_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_return_moves" position="after">
|
||||
<field name="invoice_state"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -55,12 +55,13 @@ class stock_history(osv.osv):
|
|||
product_tmpl_obj = self.pool.get("product.template")
|
||||
lines_rec = self.browse(cr, uid, lines, context=context)
|
||||
for line_rec in lines_rec:
|
||||
if not line_rec.product_id.id in prod_dict:
|
||||
if line_rec.product_id.cost_method == 'real':
|
||||
prod_dict[line_rec.product_id.id] = line_rec.price_unit_on_quant
|
||||
else:
|
||||
if line_rec.product_id.cost_method == 'real':
|
||||
price = line_rec.price_unit_on_quant
|
||||
else:
|
||||
if not line_rec.product_id.id in prod_dict:
|
||||
prod_dict[line_rec.product_id.id] = product_tmpl_obj.get_history_price(cr, uid, line_rec.product_id.product_tmpl_id.id, line_rec.company_id.id, date=date, context=context)
|
||||
inv_value += prod_dict[line_rec.product_id.id] * line_rec.quantity
|
||||
price = prod_dict[line_rec.product_id.id]
|
||||
inv_value += price * line_rec.quantity
|
||||
line['inventory_value'] = inv_value
|
||||
return res
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<record id="picking_type_dropship" model="stock.picking.type">
|
||||
<field name="name">Dropship</field>
|
||||
<field name="sequence_id" ref="seq_picking_type_dropship"/>
|
||||
<field name="code">incoming</field>
|
||||
<field name="code">outgoing</field>
|
||||
<field name="default_location_src_id" ref="stock.stock_location_suppliers"/>
|
||||
<field name="default_location_dest_id" ref="stock.stock_location_customers"/>
|
||||
</record>
|
||||
|
@ -37,7 +37,6 @@
|
|||
<field name="procure_method">make_to_stock</field>
|
||||
<field name="route_id" ref="route_drop_shipping"/>
|
||||
<field name="picking_type_id" ref="picking_type_dropship"/>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -318,8 +318,9 @@ class WebsiteSurvey(http.Controller):
|
|||
'filter_finish': filter_finish
|
||||
})
|
||||
|
||||
def prepare_result_dict(self,survey, current_filters=[]):
|
||||
def prepare_result_dict(self,survey, current_filters=None):
|
||||
"""Returns dictionary having values for rendering template"""
|
||||
current_filters = current_filters if current_filters else []
|
||||
survey_obj = request.registry['survey.survey']
|
||||
result = {'survey':survey, 'page_ids': []}
|
||||
for page in survey.page_ids:
|
||||
|
@ -347,8 +348,10 @@ class WebsiteSurvey(http.Controller):
|
|||
total = ceil(total_record / float(limit))
|
||||
return range(1, int(total + 1))
|
||||
|
||||
def get_graph_data(self, question, current_filters=[]):
|
||||
def get_graph_data(self, question, current_filters=None):
|
||||
'''Returns formatted data required by graph library on basis of filter'''
|
||||
# TODO refactor this terrible method and merge it with prepare_result_dict
|
||||
current_filters = current_filters if current_filters else []
|
||||
survey_obj = request.registry['survey.survey']
|
||||
result = []
|
||||
if question.type == 'multiple_choice':
|
||||
|
@ -360,9 +363,8 @@ class WebsiteSurvey(http.Controller):
|
|||
data = survey_obj.prepare_result(request.cr, request.uid, question, current_filters, context=request.context)
|
||||
for answer in data['answers']:
|
||||
values = []
|
||||
for res in data['result']:
|
||||
if res[1] == answer:
|
||||
values.append({'text': data['rows'][res[0]], 'count': data['result'][res]})
|
||||
for row in data['rows']:
|
||||
values.append({'text': data['rows'].get(row), 'count': data['result'].get((row, answer))})
|
||||
result.append({'key': data['answers'].get(answer), 'values': values})
|
||||
return json.dumps(result)
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ from openerp.addons.website.models.website import slug
|
|||
from urlparse import urljoin
|
||||
from itertools import product
|
||||
from collections import Counter
|
||||
from collections import OrderedDict
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
|
@ -289,8 +290,7 @@ class survey_survey(osv.Model):
|
|||
:param finished: True for completely filled survey,Falser otherwise.
|
||||
:returns list of filtered user_input_ids.
|
||||
'''
|
||||
if context is None:
|
||||
context = {}
|
||||
context = context if context else {}
|
||||
if filters:
|
||||
input_line_obj = self.pool.get('survey.user_input_line')
|
||||
domain_filter, choice, filter_display_data = [], [], []
|
||||
|
@ -339,22 +339,27 @@ class survey_survey(osv.Model):
|
|||
filter_display_data.append({'question_text': question.question, 'labels': [label.value for label in labels]})
|
||||
return filter_display_data
|
||||
|
||||
def prepare_result(self, cr, uid, question, current_filters=[], context=None):
|
||||
def prepare_result(self, cr, uid, question, current_filters=None, context=None):
|
||||
''' Compute statistical data for questions by counting number of vote per choice on basis of filter '''
|
||||
if context is None:
|
||||
context = {}
|
||||
current_filters = current_filters if current_filters else []
|
||||
context = context if context else {}
|
||||
|
||||
#Calculate and return statistics for choice
|
||||
if question.type in ['simple_choice', 'multiple_choice']:
|
||||
result_summary = {}
|
||||
[result_summary.update({label.id: {'text': label.value, 'count': 0, 'answer_id': label.id}}) for label in question.labels_ids]
|
||||
for input_line in question.user_input_line_ids:
|
||||
if input_line.answer_type == 'suggestion' and result_summary.get(input_line.value_suggested.id) and (not(current_filters) or input_line.user_input_id.id in current_filters):
|
||||
result_summary[input_line.value_suggested.id]['count'] += 1
|
||||
result_summary = result_summary.values()
|
||||
result_summary = []
|
||||
for label in question.labels_ids:
|
||||
count = 0
|
||||
for input_line in question.user_input_line_ids:
|
||||
if input_line.answer_type == 'suggestion' and input_line.value_suggested.id == label.id and (not current_filters or input_line.user_input_id.id in current_filters):
|
||||
count = count + 1
|
||||
label_summary = {'text': label.value, 'count': count, 'answer_id': label.id}
|
||||
result_summary = result_summary + [label_summary]
|
||||
|
||||
#Calculate and return statistics for matrix
|
||||
if question.type == 'matrix':
|
||||
rows, answers, res = {}, {}, {}
|
||||
rows = OrderedDict()
|
||||
answers = OrderedDict()
|
||||
res = dict()
|
||||
[rows.update({label.id: label.value}) for label in question.labels_ids_2]
|
||||
[answers.update({label.id: label.value}) for label in question.labels_ids]
|
||||
for cell in product(rows.keys(), answers.keys()):
|
||||
|
@ -386,10 +391,10 @@ class survey_survey(osv.Model):
|
|||
'most_comman': Counter(all_inputs).most_common(5)})
|
||||
return result_summary
|
||||
|
||||
def get_input_summary(self, cr, uid, question, current_filters=[], context=None):
|
||||
def get_input_summary(self, cr, uid, question, current_filters=None, context=None):
|
||||
''' Returns overall summary of question e.g. answered, skipped, total_inputs on basis of filter '''
|
||||
if context is None:
|
||||
context = {}
|
||||
current_filters = current_filters if current_filters else []
|
||||
context = context if context else {}
|
||||
result = {}
|
||||
if question.survey_id.user_input_ids:
|
||||
total_input_ids = current_filters or [input_id.id for input_id in question.survey_id.user_input_ids if input_id.state != 'new']
|
||||
|
|
|
@ -2325,7 +2325,7 @@
|
|||
.openerp .oe_form .oe_form_field_image .oe_form_field_image_controls {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
padding: 4px 0;
|
||||
padding: 6px 0;
|
||||
width: 100%;
|
||||
display: none;
|
||||
text-align: center;
|
||||
|
@ -2647,11 +2647,11 @@
|
|||
.openerp .oe_list_editable .oe_list_content td.oe_list_field_cell {
|
||||
padding: 4px 6px 3px;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) {
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell {
|
||||
color: transparent;
|
||||
text-shadow: none;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) * {
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell * {
|
||||
visibility: hidden;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_m2o_drop_down_button {
|
||||
|
@ -2667,6 +2667,13 @@
|
|||
min-width: 0;
|
||||
max-width: none;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_list_field_handle {
|
||||
color: transparent;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_readonly {
|
||||
padding: 4px 6px 3px;
|
||||
text-align: left;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea {
|
||||
height: 27px;
|
||||
-moz-border-radius: 0;
|
||||
|
@ -2678,9 +2685,14 @@
|
|||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field select {
|
||||
min-width: 0;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float.oe_readonly, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer.oe_readonly {
|
||||
padding: 6px 0px 0px;
|
||||
text-align: right;
|
||||
max-width: 100px;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
|
||||
width: 100% !important;
|
||||
text-align: right;
|
||||
}
|
||||
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_datetime input.oe_datepicker_master, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_date input.oe_datepicker_master {
|
||||
width: 100% !important;
|
||||
|
@ -3324,9 +3336,9 @@ body.oe_single_form .oe_single_form_container {
|
|||
.openerp_ie ul.oe_form_status li.oe_active > .arrow span, .openerp_ie ul.oe_form_status_clickable li.oe_active > .arrow span {
|
||||
background-color: #729fcf !important;
|
||||
}
|
||||
}
|
||||
.openerp_ie .oe_webclient {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.openerp {
|
||||
|
|
|
@ -1902,7 +1902,7 @@ $sheet-padding: 16px
|
|||
.oe_form_field_image_controls
|
||||
position: absolute
|
||||
top: 1px
|
||||
padding: 4px 0
|
||||
padding: 6px 0
|
||||
width: 100%
|
||||
display: none
|
||||
text-align: center
|
||||
|
@ -2138,7 +2138,7 @@ $sheet-padding: 16px
|
|||
.oe_list_editable .oe_list_content td.oe_list_field_cell
|
||||
padding: 4px 6px 3px
|
||||
.oe_list.oe_list_editable.oe_editing
|
||||
.oe_edition .oe_list_field_cell:not(.oe_readonly)
|
||||
.oe_edition .oe_list_field_cell
|
||||
*
|
||||
visibility: hidden
|
||||
color: transparent
|
||||
|
@ -2150,6 +2150,11 @@ $sheet-padding: 16px
|
|||
.oe_input_icon
|
||||
margin-top: 5px
|
||||
.oe_form_field
|
||||
&.oe_list_field_handle
|
||||
color: transparent
|
||||
&.oe_readonly
|
||||
padding: 4px 6px 3px
|
||||
text-align: left
|
||||
min-width: 0
|
||||
max-width: none
|
||||
input, textarea
|
||||
|
@ -2160,9 +2165,13 @@ $sheet-padding: 16px
|
|||
input, textarea, select
|
||||
min-width: 0
|
||||
&.oe_form_field_float,&.oe_form_view_integer
|
||||
input
|
||||
&.oe_readonly
|
||||
padding: 6px 0px 0px
|
||||
text-align: right
|
||||
max-width: 100px
|
||||
input
|
||||
width: 100% !important
|
||||
text-align: right
|
||||
&.oe_form_field_datetime,&.oe_form_field_date
|
||||
input.oe_datepicker_master
|
||||
width: 100% !important
|
||||
|
|
|
@ -21,6 +21,17 @@ instance.web.serialize_sort = function (criterion) {
|
|||
}).join(', ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverse of the serialize_sort function: convert an array of SQL-like sort
|
||||
* descriptors into a list of fields prefixed with '-' if necessary.
|
||||
*/
|
||||
instance.web.deserialize_sort = function (criterion) {
|
||||
return _.map(criterion, function (criteria) {
|
||||
var split = _.without(criteria.split(' '), '');
|
||||
return (split[1] && split[1].toLowerCase() === 'desc' ? '-' : '') + split[0];
|
||||
});
|
||||
};
|
||||
|
||||
instance.web.Query = instance.web.Class.extend({
|
||||
init: function (model, fields) {
|
||||
this._model = model;
|
||||
|
@ -685,6 +696,15 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin,
|
|||
this._sort.unshift((reverse ? '-' : '') + field);
|
||||
return undefined;
|
||||
},
|
||||
/**
|
||||
* Set the sort criteria on the dataset.
|
||||
*
|
||||
* @param {Array} fields_list: list of fields order descriptors, as used by
|
||||
* Odoo's ORM (such as 'name desc', 'product_id', 'order_date asc')
|
||||
*/
|
||||
set_sort: function (fields_list) {
|
||||
this._sort = instance.web.deserialize_sort(fields_list);
|
||||
},
|
||||
size: function () {
|
||||
return this.ids.length;
|
||||
},
|
||||
|
|
|
@ -78,12 +78,12 @@ var Tour = {
|
|||
this.time = new Date().getTime();
|
||||
if (tour.path && !window.location.href.match(new RegExp("("+Tour.getLang()+")?"+tour.path+"#?$", "i"))) {
|
||||
var href = Tour.getLang()+tour.path;
|
||||
console.log("Tour Begin from run method (redirection to "+href+")");
|
||||
console.log("Tour '"+tour_id+"' Begin from run method (redirection to "+href+")");
|
||||
Tour.saveState(tour.id, mode || tour.mode, -1, 0);
|
||||
$(document).one("ajaxStop", Tour.running);
|
||||
window.location.href = href;
|
||||
} else {
|
||||
console.log("Tour Begin from run method");
|
||||
console.log("Tour '"+tour_id+"' Begin from run method");
|
||||
Tour.saveState(tour.id, mode || tour.mode, 0, 0);
|
||||
Tour.running();
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ var Tour = {
|
|||
"step_id": 0
|
||||
};
|
||||
window.location.hash = "";
|
||||
console.log("Tour Begin from url hash");
|
||||
console.log("Tour '"+state.id+"' Begin from url hash");
|
||||
Tour.saveState(state.id, state.mode, state.step_id, 0);
|
||||
}
|
||||
if (!state.id) {
|
||||
|
@ -376,7 +376,7 @@ var Tour = {
|
|||
}
|
||||
Tour.saveState(state.id, state.mode, state.step_id, state.number-1, state.wait+1);
|
||||
console.log("Tour '"+state.id+"' wait for running (tour undefined)");
|
||||
setTimeout(Tour.running, state.mode === "test" ? Tour.defaultDelay : Tour.retryRunningDelay);
|
||||
setTimeout(Tour.running, Tour.retryRunningDelay);
|
||||
}
|
||||
},
|
||||
check: function (step) {
|
||||
|
@ -433,7 +433,7 @@ var Tour = {
|
|||
Tour.saveState(state.id, state.mode, step.id, state.number);
|
||||
|
||||
if (step.id !== state.step_id) {
|
||||
console.log("Tour Step: '" + (step._title || step.title) + "' (" + (new Date().getTime() - this.time) + "ms)");
|
||||
console.log("Tour '"+state.id+"' Step: '" + (step._title || step.title) + "' (" + (new Date().getTime() - this.time) + "ms)");
|
||||
}
|
||||
|
||||
Tour.autoTogglePopover(true);
|
||||
|
@ -465,8 +465,10 @@ var Tour = {
|
|||
var test = state.step.id >= state.tour.steps.length-1;
|
||||
Tour.reset();
|
||||
if (test) {
|
||||
console.log("Tour '"+state.id+"' finish: ok");
|
||||
console.log('ok');
|
||||
} else {
|
||||
console.log("Tour '"+state.id+"' finish: error");
|
||||
console.log('error');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2810,7 +2810,9 @@ instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instanc
|
|||
},
|
||||
set_dimensions: function (height, width) {
|
||||
this._super(height, width);
|
||||
this.datewidget.$input.css('height', height);
|
||||
if (!this.get("effective_readonly")) {
|
||||
this.datewidget.$input.css('height', height);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -3510,6 +3512,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
this.floating = false;
|
||||
this.current_display = null;
|
||||
this.is_started = false;
|
||||
this.ignore_focusout = false;
|
||||
},
|
||||
reinit_value: function(val) {
|
||||
this.internal_set_value(val);
|
||||
|
@ -3641,6 +3644,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
var ed_delay = 200;
|
||||
var ed_duration = 15000;
|
||||
var anyoneLoosesFocus = function (e) {
|
||||
if (self.ignore_focusout) { return; }
|
||||
var used = false;
|
||||
if (self.floating) {
|
||||
if (self.last_search.length > 0) {
|
||||
|
@ -3844,11 +3848,17 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
_search_create_popup: function() {
|
||||
this.no_ed = true;
|
||||
this.ed_def.reject();
|
||||
return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
|
||||
this.ignore_focusout = true;
|
||||
this.reinit_value(false);
|
||||
var res = instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
|
||||
this.ignore_focusout = false;
|
||||
this.no_ed = false;
|
||||
return res;
|
||||
},
|
||||
set_dimensions: function (height, width) {
|
||||
this._super(height, width);
|
||||
this.$input.css('height', height);
|
||||
if (!this.get("effective_readonly") && this.$input)
|
||||
this.$input.css('height', height);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5506,9 +5516,13 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance.
|
|||
this._super.apply(this, arguments);
|
||||
},
|
||||
initialize_content: function() {
|
||||
var self= this;
|
||||
this.$el.find('input.oe_form_binary_file').change(this.on_file_change);
|
||||
this.$el.find('button.oe_form_binary_file_save').click(this.on_save_as);
|
||||
this.$el.find('.oe_form_binary_file_clear').click(this.on_clear);
|
||||
this.$el.find('.oe_form_binary_file_edit').click(function(event){
|
||||
self.$el.find('input.oe_form_binary_file').click();
|
||||
});
|
||||
},
|
||||
on_file_change: function(e) {
|
||||
var self = this;
|
||||
|
@ -5676,8 +5690,6 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
|
|||
return;
|
||||
$img.css("max-width", "" + self.options.size[0] + "px");
|
||||
$img.css("max-height", "" + self.options.size[1] + "px");
|
||||
$img.css("margin-left", "" + (self.options.size[0] - $img.width()) / 2 + "px");
|
||||
$img.css("margin-top", "" + (self.options.size[1] - $img.height()) / 2 + "px");
|
||||
});
|
||||
$img.on('error', function() {
|
||||
$img.attr('src', self.placeholder);
|
||||
|
|
|
@ -354,6 +354,12 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
this.sidebar.$el.hide();
|
||||
}
|
||||
//Sort
|
||||
var default_order = this.fields_view.arch.attrs.default_order,
|
||||
unsorted = !this.dataset._sort.length;
|
||||
if (unsorted && default_order) {
|
||||
this.dataset.set_sort(default_order.split(','));
|
||||
}
|
||||
|
||||
if(this.dataset._sort.length){
|
||||
if(this.dataset._sort[0].indexOf('-') == -1){
|
||||
this.$el.find('th[data-id=' + this.dataset._sort[0] + ']').addClass("sortdown");
|
||||
|
|
|
@ -285,9 +285,7 @@
|
|||
if (!this.editor.is_editing()) { return; }
|
||||
for(var i=0, len=this.fields_for_resize.length; i<len; ++i) {
|
||||
var item = this.fields_for_resize[i];
|
||||
if (!item.field.get('effective_invisible')) {
|
||||
this.resize_field(item.field, item.cell);
|
||||
}
|
||||
this.resize_field(item.field, item.cell);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -306,6 +304,11 @@
|
|||
at: 'left top',
|
||||
of: $cell
|
||||
});
|
||||
if (field.get('effective_readonly')) {
|
||||
field.$el.addClass('oe_readonly');
|
||||
}
|
||||
if(field.widget == "handle")
|
||||
field.$el.addClass('oe_list_field_handle');
|
||||
},
|
||||
/**
|
||||
* @return {jQuery.Deferred}
|
||||
|
@ -451,13 +454,7 @@
|
|||
setup_events: function () {
|
||||
var self = this;
|
||||
_.each(this.editor.form.fields, function(field, field_name) {
|
||||
var set_invisible = function() {
|
||||
field.set({'force_invisible': field.get('effective_readonly')});
|
||||
};
|
||||
field.on("change:effective_readonly", self, set_invisible);
|
||||
set_invisible();
|
||||
field.on('change:effective_invisible', self, function () {
|
||||
if (field.get('effective_invisible')) { return; }
|
||||
field.on("change:effective_readonly", self, function(){
|
||||
var item = _(self.fields_for_resize).find(function (item) {
|
||||
return item.field === field;
|
||||
});
|
||||
|
|
|
@ -1310,15 +1310,16 @@
|
|||
<t t-name="FieldBinaryImage">
|
||||
<span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">
|
||||
<div class="oe_form_field_image_controls oe_edit_only">
|
||||
<t t-call="HiddenInputFile">
|
||||
<t t-set="fileupload_id" t-value="widget.fileupload_id"/>
|
||||
Edit
|
||||
</t>
|
||||
<i class="fa fa-pencil fa-1g pull-left col-md-offset-1 oe_form_binary_file_edit" title="Edit"/>
|
||||
<i class="fa fa-trash-o fa-1g col-md-offset-5 oe_form_binary_file_clear" title="Clear"/>
|
||||
<div class="oe_form_binary_progress" style="display: none">
|
||||
<img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
|
||||
<b>Uploading ...</b>
|
||||
</div>
|
||||
</div>
|
||||
<t t-call="HiddenInputFile">
|
||||
<t t-set="fileupload_id" t-value="widget.fileupload_id"/>
|
||||
</t>
|
||||
</span>
|
||||
</t>
|
||||
<t t-name="FieldBinaryImage-img">
|
||||
|
|
|
@ -255,6 +255,8 @@
|
|||
QUnit.done(function(result) {
|
||||
if (result.failed === 0) {
|
||||
console.log('ok');
|
||||
} else {
|
||||
console.log('error');
|
||||
}
|
||||
});
|
||||
openerp.web.qweb.add_template("/web/webclient/qweb");
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue