Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
320 มุมมอง

We are allocating commissions to internal and external Salespeople via an Analytic Plan - one account per salesperson - as explained in https://www.odoo.com/forum/help-1/how-to-calculate-commissions-using-analytic-accounts-257040


Everything is working great - we can adjust the commissions even after validating the Customer Invoice and can use Vendor Bills to pay people.

We would like to only pay out commissions when we have received payment from our Customers.

Is there a way to filter the Analytic Items by the status of the associated Customer Invoice?

Do we need a custom field?

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

You can actually just create a new Search Filter.

This example inherits the existing Analytic Items View and adds a filter to show only those Analytic Lines where the Customer Invoice is paid:

<xpath expr="//filter[@name='month']" position="after">
    <filter name="move_id" string="Invoices that are Paid"
            domain="[('move_line_id.move_id.payment_state', 'in', ['paid'])]"/>
</xpath>


The domain of the filter goes through the Journal Item linked to each Analytic Line, then through the Invoice to the Payment State.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
6
ม.ค. 25
10506
0
ธ.ค. 23
1421
Discounts accounting แก้ไขแล้ว
1
มี.ค. 23
5427
0
ก.ย. 21
3883
0
ก.พ. 21
3528