Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:44:52+00:00 2026-06-08T21:44:52+00:00

I hope friends can help me. I have code that I created, the goal

  • 0

I hope friends can help me.

I have code that I created, the goal is to enter a value into journal entries. That’s my code.

class deposit(osv.osv):
    _name='deposit.travel'
    _description='Deposit2 Travel'

    def action_process(self, cr, uid, ids, context=None):
        move_lines = []
        for deposit in self.browse(cr, uid, ids, context=context):
            # Create the move lines first
            move_lines.append((0,0, self.get_move_line(cr, uid, deposit, 'src')))
            #print deposit
            move_lines.append((0, 0, self.get_move_line(cr, uid, deposit, 'dest')))
            # Create the move for the deposit
            move = {
                'journal_id': deposit.journal_id.id,
                'date': deposit.date,
                'deposit_id': deposit.id,
                'name':'/',
                'line_id': move_lines
            }
            move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
            self.pool.get('account.move').post(cr, uid, [move_id])
            self.write(cr, uid, [deposit.id], {'move_id': move_id,
                                              'state': 'done'},context=context)
        return True

        def get_move_line(self, cr, uid, deposit, type, context=None):
            return {
                'type': type,
                'name': deposit.name or '/',
                'debit': type == 'dest' and deposit.amount or 0.0,
                'credit': type == 'src' and deposit.amount or 0.0,
                'account_id': type == 'src' and deposit.dept_from.id or deposit.dept_to.id,
                'date': deposit.date,
                'deposit_id': deposit.id
            }
     _columns = {
        'partner':fields.many2one('res.partner','Partner',required=True),
        'date':fields.date('Date of Deposit',required=True),
        'period_id':fields.many2one('account.period','Force Period', required=True),
        'journal_id':fields.many2one('account.journal','Journal', required=True),
        'amount':fields.float('Amount',required=True,digits_compute=dp.get_precision('Account')),
        'move_id':fields.many2one('account.move','Journal Entry', readonly=True, select=1),
        'name':fields.related('move_id','name',type='char',readonly=True, size=64, relation='account.move',string='Deposit Ticket #'),
        'dept_from':fields.many2one('account.account','Deposit From'),
        'dept_to':fields.many2one('account.account','Deposit To'),
        'state': fields.selection([
            ('draft','Draft'),
            ('to_be_reviewed','Ready for Review'),
            ('done','Done'),
            ('cancel', 'Cancel')
            ],'State', select=True, readonly=True),
        }
         _defaults = {
        'date': time.strftime('%Y-%m-%d'),
        'period_id':_get_period,
        'state': 'draft',
         }
deposit()

but when i click the button to which I put the command action_process, appear error like this ‘deposit’ object has no attribute ‘get_move_line’. get_move_line is a function, why error the attribute ?
I need your help. Thank’s before

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:44:54+00:00Added an answer on June 8, 2026 at 9:44 pm

    The indentation is incorrect for function get_move_line. De-indent the function one tab.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I am very confused, so I hope you friends can help me out.
Friends, I'm new to both Javascript and Regular Expressions and hope you can help!
what's up? :-) I have one problem and i hope you can help me
Friends, I'm facing another challenge in APEX and I hope you can help. I
Hope that someone can share their experience with some of the latest emerging backbone.js
Hope the AWK gurus can provide a solution to my problem . I have
hope someone can answer this. Here is some sample code. namespace std { #ifdef
Hope someone could help me with this: I would like to have a column
Friends, I'm converting an Oracle Form to Apex and have run into problem(s?) which
I have a problem that I can't figure out myself. I've tried using LEFT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.