-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] account_cutoff_accrual_order_product_category
- Loading branch information
Showing
23 changed files
with
578 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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 @@ | ||
from . import models |
19 changes: 19 additions & 0 deletions
19
account_cutoff_accrual_order_product_category/__manifest__.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,19 @@ | ||
# Copyright 2021 Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Account Cutoff Accrual Order Product Category", | ||
"summary": """ | ||
Allows to get the product category on cutoff lines""", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "BCIM,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/account-closing", | ||
"depends": [ | ||
"account_cutoff_accrual_order_base", | ||
"account_move_line_product_category", | ||
], | ||
"data": [ | ||
"views/account_cutoff_line.xml", | ||
], | ||
} |
1 change: 1 addition & 0 deletions
1
account_cutoff_accrual_order_product_category/models/__init__.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 @@ | ||
from . import account_cutoff_line, account_cutoff |
26 changes: 26 additions & 0 deletions
26
account_cutoff_accrual_order_product_category/models/account_cutoff.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,26 @@ | ||
# Copyright 2021 Jacques-Etienne Baudoux (BCIM sprl) <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class AccountCutoff(models.Model): | ||
_inherit = "account.cutoff" | ||
|
||
def _get_merge_keys(self): | ||
"""Return merge criteria for provision lines | ||
The returned list must contain valid field names | ||
for account.move.line. Provision lines with the | ||
same values for these fields will be merged. | ||
The list must at least contain account_id. | ||
""" | ||
res = super()._get_merge_keys() | ||
if "categ_id" not in res: | ||
res.append("categ_id") | ||
return res | ||
|
||
def _prepare_provision_line(self, cutoff_line): | ||
res = super()._prepare_provision_line(cutoff_line) | ||
res["categ_id"] = cutoff_line.product_id.categ_id.id | ||
return res |
11 changes: 11 additions & 0 deletions
11
account_cutoff_accrual_order_product_category/models/account_cutoff_line.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,11 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class AccountCutoffLine(models.Model): | ||
|
||
_inherit = "account.cutoff.line" | ||
|
||
categ_id = fields.Many2one(related="product_id.categ_id", readonly=True) |
1 change: 1 addition & 0 deletions
1
account_cutoff_accrual_order_product_category/readme/CONTEXT.md
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 @@ | ||
The module is used mainly for reporting purpose (reports per product category). |
2 changes: 2 additions & 0 deletions
2
account_cutoff_accrual_order_product_category/readme/CONTRIBUTORS.md
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,2 @@ | ||
- Jacques-Étienne Baudoux (BCIM) <[email protected]> | ||
- Denis Roussel <[email protected]> |
1 change: 1 addition & 0 deletions
1
account_cutoff_accrual_order_product_category/readme/DESCRIPTION.md
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 @@ | ||
This module allows to have the product category on cutoff lines level. |
Binary file added
BIN
+9.23 KB
account_cutoff_accrual_order_product_category/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.