Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

OpenERP 6.1 / Account.Move / Auto counterpart entry

By
oerp
on 5/15/13, 1:44 PM 2,276 views

Hello,

the OpenERP v6.1 (web client) don't propose automatic generation of counterpart entries when we encode account move lines manually in jouranl entries ? Menu > Accounting > Journal Entries >Journal Entries Try to start encoding a journal item in the journal entry, and press enter to continue the second line, Normally in V5 and V7, it generate a counterpart but in 6.1 no conterpart is generated,

i'm wondering whether it's a bug in 6.1 or a missed configuration ?

Thanks

1
oerp
On 5/16/13, 8:14 AM

Hi,

I have solved the problem : here is the solution :
1 - I added a field in the account.move Object :
'line_id_temp': fields.char('lines ids', size=256),
it's a field where I save the last move line
2 - I override the Return of onchange_line_id (in account.py) by
return {'value': {'balance': balance, 'line_id_temp': line_ids and line_ids[0] or False}
3 - Change the context of the line_id field in form view (view_move_form) (in account_view.xml) like this
context="{'balance': balance , 'journal': journal_id, 'line_id_temp': line_id_temp }"
4 - In account_move_line file, update the line (line 227) by
if context.get('lines'):
5 - In account_move_line file, add these line before the line 241 (if account and .... ) at the same level :
data['account_id'] = account.id

Thanks

0
le_dilem
On 5/15/13, 2:30 PM

hi, I've already seen this problem,

I solved like this:

I created a new module "account_cp" I added new field in the journal table

class account_journal(osv.osv):
    _inherit = "account.journal"
    _description = "Journal"
    _columns = {

        'default_cp_account_id': fields.many2one('account.account', 'Contre partie', domain="[('type','!=','view')]", help="It acts as a default account for cp amount"),

    }

account_journal()

after that I changed in the module account/account_move_line.py line 277

#pick the good account on the journal accordingly if the next proposed line will be a debit or a credit
            journal_data = journal_obj.browse(cr, uid, context['journal_id'], context=context)
            if not move_id:
               account = total > 0 and journal_data.default_credit_account_id or journal_data.default_debit_account_id
            else: 
               account = total > 0 and journal_data.default_cp_account_id or journal_data.default_cp_account_id

Hi, Thank you for your quick response, but the patch doesn't work, perhaps I didn't make the right changes in account_move file, can you send me the whole file account_move_line, or the whole function " _default_get ", thanks

oerp
on 5/16/13, 6:28 AM

i ok but i changed in V7 give me your adress mail. i have problem with Karma.

le_dilem
on 5/16/13, 6:58 AM

I'm using V 6.1, thanks

oerp
on 5/16/13, 7:23 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/15/13, 1:44 PM
Seen: 2276 times
Last updated: 3/16/15, 8:10 AM