-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] Refactore the way prepaid work is invoiced.
Add project invoicing typology to ease the configuration of the invoincing on project Add possibility to configure product to follow the prepaid invoicing workflow, if used, the customer invoice revenue will go in a advanced revenue account and when invoiced from timesheet, an transfert accounting move will be created to put revenue from the advanced revenue account to a refular revenue account Supplier invoices following the prepaid workflow are set to pay depending on if the paid amounts in the analytic account is positive
- Loading branch information
1 parent
ab239dd
commit 917dd88
Showing
41 changed files
with
1,490 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
from . import invoice | ||
from . import product | ||
from . import sale | ||
from . import res_company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
commission_rate = fields.Float( | ||
help="Rate in % for the commission on subcontractor work", default=11.00 | ||
) | ||
|
||
def _get_commission_rate(self): | ||
self.ensure_one() | ||
return self.commission_rate / 100.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import subcontractor_invoice_work | ||
from . import res_config_settings |
13 changes: 13 additions & 0 deletions
13
account_invoice_subcontractor/wizard/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
commission_rate = fields.Float( | ||
related="company_id.commission_rate", | ||
readonly=False, | ||
help="Rate in % for the commission on subcontractor work", | ||
) |
26 changes: 26 additions & 0 deletions
26
account_invoice_subcontractor/wizard/res_config_settings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_ecotaxe_res_config_settings" model="ir.ui.view"> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="account.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='analytic']" position="after"> | ||
<h2>Subcontractors</h2> | ||
<div class="row mt16 o_settings_container" id="subonctractor"> | ||
<div | ||
class="col-12 col-lg-12 o_setting_box" | ||
id="subcontractor-settings" | ||
> | ||
<div class="o_setting_left_pane" /> | ||
<div class="o_setting_right_pane"> | ||
<div class="row"> | ||
</div> | ||
<label for="commission_rate" class="col-md-5" /> | ||
<field name="commission_rate" /> | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
|
||
<record forcecreate="True" id="invoice_enough_analytic_amount" model="ir.cron"> | ||
<field | ||
name="name" | ||
>Compute subonctractor supplier invoices to pay depending on analytic accounts</field> | ||
<field eval="False" name="active" /> | ||
<field name="user_id" ref="base.user_root" /> | ||
<field name="interval_number">1</field> | ||
<field name="interval_type">days</field> | ||
<field name="numbercall">-1</field> | ||
<field eval="False" name="doall" /> | ||
<field name="state">code</field> | ||
<field name="code">model.compute_enought_analytic_amount_cron()</field> | ||
<field name="model_id" ref="account.model_account_move" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="account_revenue_consulting" model="account.account"> | ||
<field name="name">Service Consulting</field> | ||
<field name="code">706140</field> | ||
<field name="user_type_id" ref="account.data_account_type_revenue" /> | ||
</record> | ||
|
||
<record id="account_revenue_maintenance" model="account.account"> | ||
<field name="name">Service Maintenance</field> | ||
<field name="code">706150</field> | ||
<field name="user_type_id" ref="account.data_account_type_revenue" /> | ||
</record> | ||
|
||
<record id="account_expense_consulting" model="account.account"> | ||
<field name="name">Consulting subcontracting</field> | ||
<field name="code">611140</field> | ||
<field name="user_type_id" ref="account.data_account_type_expenses" /> | ||
</record> | ||
|
||
<record id="account_expense_maintenance" model="account.account"> | ||
<field name="name">Maintenance Subcontracting</field> | ||
<field name="code">611150</field> | ||
<field name="user_type_id" ref="account.data_account_type_expenses" /> | ||
</record> | ||
|
||
<record id="account_expense_internal" model="account.account"> | ||
<field name="name">Internal task cost</field> | ||
<field name="code">611160</field> | ||
<field name="user_type_id" ref="account.data_account_type_expenses" /> | ||
</record> | ||
|
||
<record id="account_prepaid_customer_maintenance" model="account.account"> | ||
<field name="name">Prepaid Revenues (maintenance)</field> | ||
<field name="code">418101</field> | ||
<field name="reconcile" eval="False" /> | ||
<field name="is_prepaid_account" eval="True" /> | ||
<field name="user_type_id" ref="account.data_account_type_current_assets" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="product_product_1" model="product.product"> | ||
<field name="name">consulting</field> | ||
<field name="categ_id" ref="product.product_category_3" /> | ||
<field name="list_price">500</field> | ||
<field name="type">service</field> | ||
<field name="uom_id" ref="uom.product_uom_day" /> | ||
<field name="uom_po_id" ref="uom.product_uom_day" /> | ||
<field name="property_account_income_id" ref="account_revenue_consulting" /> | ||
<field name="property_account_expense_id" ref="account_expense_consulting" /> | ||
<field name="subcontracted" eval="True" /> | ||
</record> | ||
|
||
<record id="product_product_2" model="product.product"> | ||
<field name="name">consulting (maintenance package)</field> | ||
<field name="categ_id" ref="product.product_category_3" /> | ||
<field name="list_price">600</field> | ||
<field name="type">service</field> | ||
<field name="uom_id" ref="uom.product_uom_day" /> | ||
<field name="uom_po_id" ref="uom.product_uom_day" /> | ||
<field name="property_account_income_id" ref="account_revenue_maintenance" /> | ||
<field name="property_account_expense_id" ref="account_expense_maintenance" /> | ||
<field | ||
name="prepaid_revenue_account_id" | ||
ref="account_prepaid_customer_maintenance" | ||
/> | ||
</record> | ||
|
||
<record id="product_product_3" model="product.product"> | ||
<field name="name">Internal Task</field> | ||
<field name="categ_id" ref="product.product_category_3" /> | ||
<field name="list_price">0</field> | ||
<field name="type">service</field> | ||
<field name="uom_id" ref="uom.product_uom_day" /> | ||
<field name="uom_po_id" ref="uom.product_uom_day" /> | ||
<field name="property_account_expense_id" ref="account_expense_internal" /> | ||
</record> | ||
|
||
</odoo> |
Oops, something went wrong.