Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
1 change: 1 addition & 0 deletions account_cutoff_accrual_order_product_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions account_cutoff_accrual_order_product_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2021 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# 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",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_cutoff_line, account_cutoff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2021 Jacques-Etienne Baudoux (BCIM sprl) <je@bcim.be>
# 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
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)
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).
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Jacques-Étienne Baudoux (BCIM) <je@bcim.be>
- Denis Roussel <denis.Roussel@acsone.eu>
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading