What it does
This module adds Delegation Partner field to invoice/voucher lines so that user can select a specific partner for a line.
This will be helpful when you want to record revenue/expense on a delegation partner instead of the invoice/voucher's partner
Use case
Requirements
- Company to pay phone fee on behalf of its employees.
- The payment will be debit to corresponding employee's payable account in payslip
Master data:
Create a current asset account. For example, 13881 for Vietnamese Accounting
Create a product Employee Phone Fee with 13881 as its expense account, no tax specified
Create a salary rule with the following setup (this requires either Odoo EE or the TVTMA Payroll which is published at https://apps.odoo.com/apps/modules/13.0/to_hr_payroll/)
Debit account: an employee payable account (e.g. 334 for Vietnamese Accounting Standards)
Credit account: the previously created account (i.e. 13881)
Salary rule's Python code
result = sum(employee.env['account.move.line'].sudo().search([
('partner_id','=',employee.sudo().address_home_id.commercial_partner_id.id),
('date','>=',payslip.date_from),
('date','<=',payslip.date_to),
('account_id.code','=','13881'),
('parent_state','=','posted')]
).mapped('balance'))
See it in action
- Create a vendor bill with the following data
- Vendor: Vendor 1
- Create several invoice lines:
- Product: Employee Phone Fee
- Price: any that should be greater than zero
- Delegation partner: select a partner that link to employee's private address
- Validate the invoice to see the following entries
- Debit: 13881, addressing the employee partner
- Credit: vendor payable account (e.g. 331 for Vietnamese Accounting), addressing the vendor
- Create a payslip for the corresponding period and validate it to see an accounting entry as below
- Debit: employee payable account (e.g. 334 for Vietnamese accounting)
- Credit: 13881
Editions Supported
- Community Edition
- Enterprise Edition
This software and associated files (the "Software") may only be
used
(executed, modified, executed after modifications) if you have
purchased a
valid license from the authors, typically via Odoo Apps,
or if you
have
received a written agreement from the authors of the
Software (see the
COPYRIGHT file).
You may develop Odoo modules that use the Software as a library
(typically
by depending on it, importing it and using its
resources), but
without
copying any source code or material from the
Software. You may distribute
those modules under the license of your
choice, provided that this
license
is compatible with the terms of
the Odoo Proprietary License (For
example:
LGPL, MIT, or proprietary
licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell
copies of the
Software or modified copies of the Software.
Thông báo bản quyền và chấp thuận nêu trên buộc phải được bao gồm trong tất cả các bản sao hoặc các phần quan trọng của Phần mềm.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT
SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.