Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

How to display account move line (in_invoice) in list view including taxes entries?

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
accountingfilter
2 ตอบกลับ
4497 มุมมอง
อวตาร
RALPH IDOKO

The requirement is to have a menu that will display account move line entries with expense account selected on the vendor bills. If taxes are applied, the listing should include all tax entries.  See the expected output: https://i.sstatic.net/2A4IgAM6.jpg.

See my current domain:

<record id="action_account_move_line" model="ir.actions.act_window">
    <field name="name">Expense Analysis</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">account.move.line</field>
    <field name="view_mode">tree,pivot,graph</field>
    <field name="domain">[('account_id.deprecated', '=', False),('account_id.internal_group', 'in', ['expense']),('exclude_from_invoice_tab','=',False)]</field>
    <field name="view_id" eval="expense_line_tree_view"/>
</record>

The above domain only fetched the move line entries without the taxes. See the current result: https://i.sstatic.net/JXR7852C.jpg

Gracia.

0
อวตาร
ละทิ้ง
อวตาร
RALPH IDOKO
ผู้เขียน คำตอบที่ดีที่สุด

Thank you Andry. Your suggested workaround was so invaluable. However, hard-coding IDs into domain might cause avoidable issues further down the line especially if you are not working with a final version of your database as the IDs will be regenerated if a new database is created.

My adopted approach was to create an sql view with init method containing sql statements using UNION and JOIN. That way, it became easy to grab the desired tables and fields.

See complete class below:

from odoo import models, fields, tools

class ExpenseAnalysisWithTaxes(models.Model):
_name = ".expense.analysis.with.taxes"
_description = "Expense Analysis"
_auto = False # This is a SQL view, not a normal table

id = fields.Integer("ID", readonly=True)
date = fields.Date("Date", readonly=True)
name = fields.Char("Description of Job", readonly=True)
move_name = fields.Char("Payment Reference", readonly=True)
partner_id = fields.Many2one("res.partner", "Partner", readonly=True)
account_id = fields.Many2one("account.account", "Account", readonly=True)
account_name = fields.Char("Account Name", readonly=True)
price_subtotal = fields.Monetary("Total Amount", readonly=True)
currency_id = fields.Many2one("res.currency", "Currency", readonly=True, default=lambda self: self.env.company.currency_id)

def init(self):
"""Create the SQL view dynamically when the module is installed or updated."""
tools.drop_view_if_exists(self._cr, "expense_analysis_with_taxes")
self._cr.execute("""
CREATE OR REPLACE VIEW expense_analysis_with_taxes AS (
-- Expense lines
SELECT
aml.id AS id,
aml.date AS date,
aml.name AS name,
am.name AS move_name,
aml.partner_id AS partner_id,
aml.account_id AS account_id,
aa.name AS account_name,
aml.price_total AS price_subtotal
FROM account_move_line aml
JOIN account_account aa ON aml.account_id = aa.id
JOIN account_move am ON aml.move_id = am.id
WHERE am.move_type IN ('in_invoice','in_receipt')
AND aa.internal_group = 'expense'

UNION ALL

-- Tax lines (identified via tax_line_id)
SELECT
aml.id AS id,
aml.date AS date,
CONCAT('Tax: ', at.name) AS name,
am.name AS move_name,
aml.partner_id AS partner_id,
aml.account_id AS account_id,
aa.name AS account_name,
ABS(aml.price_subtotal) AS price_subtotal
FROM account_move_line aml
JOIN account_account aa ON aml.account_id = aa.id
JOIN account_move am ON aml.move_id = am.id
JOIN account_tax at ON aml.tax_line_id = at.id
WHERE am.move_type IN ('in_invoice','in_receipt')
) ORDER BY id DESC;
""")
Based on this, I then defined a menu, window action and tree view.

Hope this helps someone.


0
อวตาร
ละทิ้ง
อวตาร
Andry Ang
คำตอบที่ดีที่สุด

Hi Raplh,

I have a workaround for your case. First you need to know few things:

  1. Tax payable is a liabilities account which have a different account_type than expense
  2. There is no grouping on tax payable accounts except you create one for them
  3. You used filter on internal_group, this includes 3 account types: Expenses, Depreciation, and Cost of Revenue. Double check if you really need "internal_group" or "account_type"

For tax accounts, you might need to hard code the ids into the domain tuples.

Hope this helps

0
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
a favorites or bookmarking needed!
configuration accounting filter
อวตาร
0
ม.ค. 25
1208
filter all contacts from "active" companies
accounting filter contacts
อวตาร
อวตาร
1
พ.ย. 22
2783
Facing QuickBooks Error 6123? @ +1-804-(985)-1002 Here’s the Easiest Fix
accounting
อวตาร
0
พ.ย. 25
3
{{GUIA`$Avianca$𓆩×͜×𓆪 𝐏𝐀}}¿Cómo llamar a Avianca desde Panamá?
accounting
อวตาร
0
พ.ย. 25
58
Invoice Printing Error in Odoo V19 – GCC/Saudi Localization
accounting
อวตาร
อวตาร
1
พ.ย. 25
166
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ 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