Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

By Selecting Product, Vendor's Name will Appear

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
res.partnerpurchase_ordervendorpurchase.order.line
2082 Tampilan
Avatar
S.M. Kawsar Hossain

Here is my case. I want to add a field named partner_id(string =’vendor’s name’, widget =many2one) from purchase.order after the field “name” in page in purchase.order.line. Also when I select a product, it will show me that product name. But whatever I am trying, its not working. Here its not the case the first vendor will be shown. Whoever has that product, the Id will be shown.

I have also used onchange method but still not working. Please, resolve this problem.

here my code:

for vedor:

 rom odoo import models, fields, api

class PurchaseOrderLine(models.Model):


    _inherit = 'purchase.order.line'    


    agent_price = fields.Monetary(string="Vendor's Price", compute='_compute_agent_price', store=True) 


    partner_id = fields.Many2one('res.partner', string="Vendor", compute='_compute_partner_id', store=True)


                

    @api.depends('order_id.partner_id', 'product_id')


    def _compute_agent_price(self):


        for line in self:


            if line.order_id.partner_id and line.product_id:


                vendor = line.order_id.partner_id


                product = line.product_id


                agent_price = vendor.purchase_line_ids.filtered(lambda x: x.product_id == product).agent_price


                line.agent_price = agent_price or 0.0


            else:


                line.agent_price = 0.0


    @api.depends('product_qty', 'agent_price', 'taxes_id')


    def _compute_amount(self):


        for line in self:


            tax_results = self.env['account.tax']._compute_taxes([line._convert_to_tax_base_line_dict()])


            totals = list(tax_results['totals'].values())[0]


            amount_untaxed = totals['amount_untaxed']


            amount_tax = totals['amount_tax']


            line.update({


                'price_subtotal': amount_untaxed,


                'price_tax': amount_tax,


                'price_total': amount_untaxed + amount_tax,


            })




    def _convert_to_tax_base_line_dict(self):


        """ Convert the current record to a dictionary in order to use the generic taxes computation method


        defined on account.tax.




        :return: A python dictionary.


        """


        self.ensure_one()


        return self.env['account.tax']._convert_to_tax_base_line_dict(


            self,


            partner=self.order_id.partner_id,


            currency=self.order_id.currency_id,


            product=self.product_id,


            taxes=self.taxes_id,


            price_unit=self.agent_price,


            quantity=self.product_qty,


            price_subtotal=self.price_subtotal,


        )


for addquantity:

from odoo import models, fields, api,_


from odoo.exceptions import ValidationError




##for vendor


class PurchaseLine(models.Model):


    _inherit = 'res.partner'




    purchase_line_ids = fields.One2many('purchase.line', 'purchase_line_id', string='Order Lines', edit="inline")




class CustomPurchaseLine(models.Model):


    _name = 'purchase.line'


    _description = 'Custom Purchase Line'




    purchase_line_id = fields.Many2one('res.partner', string='Vendor', required=True)


    ###in editview form of RFQ page,in line 89, invisible=1 is used


    product_id = fields.Many2one('product.product', string='Product', required=True)


    currency_id = fields.Many2one('res.currency', string='Currency')


    agent_price = fields.Monetary(string="Vendor's Price", currency_field='currency_id')

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How can I customize purchase order report and purchase order form view Diselesaikan
purchase_order purchase.order.line
Avatar
Avatar
1
Sep 21
8203
How to remove "My company" or "User" from vendors list?
purchase_order vendor
Avatar
Avatar
1
Des 20
4423
The operation cannot be completed!! Issue...
vendor purchase.order purchase.order.line
Avatar
0
Jan 24
2792
How do I pay the supplier only for products that have been sold? Diselesaikan
supplier purchase_order vendor
Avatar
Avatar
1
Agu 22
4754
Need Help in Computing a Field Value in Purchase Order
purchase_order compute purchase.order.line
Avatar
2
Okt 20
3869
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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