Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

how to create a custom field at delivery order (stock.picking) which gets its value from sales order in odoo

Odoberať

Get notified when there's activity on this post

This question has been flagged
stock_pickingdeliveryordersales.orderodooV8
3 Replies
16064 Zobrazenia
Avatar
Susi

I have add field in sales_order and stock_picking 'cabang_id' :many2one

and i want get value cabang from sales order to stock.picking (delivery order )when confirm sale. i have try with method action_button confirm but its doesnt work. anyone can help me how should i do with my code ? thanks before


i'm using odoo v8

0
Avatar
Zrušiť
Avatar
Dasadiya Chaitanya
Best Answer

The following way you can solve your issue.

1. Set custom field on sale.order and stock.pirking in py as well as view side.

2. Inherit the stock.move in your custom module and use the _prepare_picking_assign() over ridding method.

3. Using super and set your custom field value.

4. View that changes After confirming of Sale Order document.


For example :

from openerp import models, fields, api, _

class sale_order(models.Model):

    _inherit='sale.order' customer_field=fields.Char(string='Customer Field')

class stock_picking(models.Model):

    _inherit='stock.picking' customer_field=fields.Char(string='Customer Field')    

class stock_move(models.Model):

    _inherit='stock.move'

def _prepare_picking_assign(self,cr, uid, move, context=None):

    res=super(stock_move,self)._prepare_picking_assign(cr, uid, move, context) if move.procurement_id and move.procurement_id.sale_line_id and move.procurement_id.sale_line_id.order_id:

        sale_obj = move.procurement_id.sale_line_id.order_id if sale_obj.dif_pick_address:

            res.update({ 'customer_field':sale_obj.customer_field, }) return res


Above code is working fine in Odoo 8.0 version

Also, You should set in the view part so that you can check the sale order values come into stock picking after confirming your sale order.

I hope my answer may helpful for you :)


Source :

http://stackoverflow.com/questions/39953729/add-shipping-address-field-in-stock-picking-in-odoo/39956194#39956194


2
Avatar
Zrušiť
Susi
Autor

thanks dasadiya, i have try your code but its getting erorr like this line 11, in _prepare_picking_assign

if sale_obj.dif_pick_address:

ValueError: "'sale.order' object has no attribute 'dif_pick_address'" while evaluating

u'action_ship_create()'

Susi
Autor

sorry dasadiya,, ignore my comment in above. i already succes with your code. but the value only appear in stock.picking but in stock move its still empty. Can you explain how that work? thanks before

Avatar
owais khan
Best Answer

i am use v14 than function nat call

0
Avatar
Zrušiť
Avatar
Arunagiri K
Best Answer

Please write this code in your stock.picking 

@api.multi

 @api.depends('sale_id')

 def update_sale_delivery(self):

         for record in self:

             for rec in record.sale_id:

                 if rec.cabang_id:

                        record.cabang_id=rec.cabang_id.id

it will help you i hope 

0
Avatar
Zrušiť
Susi
Autor

dear arunagiri thanks before but i'am still use os.osv may you translate your code to osv os ? thanks before

Arunagiri K

use onchange method for 8

def onchange_field1(self, cr, uid, ids, field1, context=None):

vals = {}

if field1 > 0:

vals['field2'] = field1

return {'value': vals}

<field name="field1" on_change="onchange_field1(field1)"/>

Arunagiri K

if field:

only

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Odoo v8 check availability in view delivery order changes delivery order to ready to transfer
stock_picking deliveryorder sales.order sales_order odoo8
Avatar
0
jan 17
4241
Stock picking removes sale orders link Solved
stock_picking sales.order stock_move
Avatar
Avatar
Avatar
2
feb 24
4820
How to add a button at the top of the sales order detail?
buttons sales.order odooV8
Avatar
Avatar
Avatar
Avatar
3
dec 22
6319
Can't validate stock.picking with product on multi-location
stock_picking validateerror odooV8
Avatar
0
sep 19
71
How to modify Delivery Order & Incoming Shipment view ? Solved
stock stock_picking deliveryorder
Avatar
Avatar
2
jan 24
15310
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now