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 8259415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:51:30+00:00 2026-06-08T02:51:30+00:00

oI select same field from mo.queue and I want save it into the procurement.order

  • 0

oI select same field from mo.queue and I want save it into the procurement.order table

My code looks as follows:

def action_ship_create(self, cr, uid, ids, id_queue, context=None):
    queue_obj = self.pool.get('mo.queue'). browse (cr, uid, id_queue, context=context)
    mo_name = queue_obj.name 
    query_param = (mo_name)
    cr.execute("select origin,create_date,product_uos_qty,product_qty,name,city from mo_queue",(query_param,))
    ads = cr.fetchone()
    name = ads and ads [0] or None
    print "======================"
    print name
    print "======================"

    val = { 'origin': name,
          } 
    print "======================"
    print val
    print "======================"  

    return {'value': val }  


    proc_id = self.pool.get('procurement.order').create(cr, uid, {
        'origin':origin,
    })
    proc_ids.append(proc_id)

The result of the print is:

print name = SO013

print val = {'origin': u'SO013'}

But the data is not inserted into the procurement.order table.

  • 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-08T02:51:32+00:00Added an answer on June 8, 2026 at 2:51 am

    your code me look like this after return statement is does not executes anything do put cdeo before return and your code need lot of tuning, like do not use SQL Injection it is not good idea.

    def action_ship_create(self, cr, uid, ids, id_queue, context=None):
            queue_obj = self.pool.get('mo.queue'). browse (cr, uid, id_queue, context=context)
            queue_model = self.poo.get(queue_obj.name)
            procurement_pool = self.pool.get('procurement.order')
            qsids = queue_model.search(cr, uid, )
            for record in queue_model.browse(cr, uid, qsids):
              if record.origin:
                   #this will crate a new record the table procurement.order so 
                   #field values may be not enough so you can update logic
                   #and If you want to update record value you need a proc ids and you can do it.
                   procurement_pool.create(cr, uid, {'origin':record.origin})
            return {'value': {'origin': record.origin}}  
    

    Hope this will help you let me know i I am missing.

    Thank You

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

Sidebar

Related Questions

How to select a same database? I want to create a table from already
I'm getting the same results from select length(column_name) from table as from select dbms_lob.getlength(column_name)
I have several tables with the same structure. How can I select SUM(field) from
I have a query like this: SELECT field FROM table WHERE column1 = 'x'
Can I SELECT multiple columns into multiple variables within the same select query in
Consider having a matrix. From this matrix I select the same number of elements
These two querys gives me the exact same result: select * from topics where
How do I rewrite this T-SQL code to produce the same results SELECT ACC.Title,
I have multiple multi-select boxes with the same class and i want to unselect
I need to insert data from several tables with all the same field names

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.