Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] account_cutoff_picking_product_category #265

Closed
Closed
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
84 changes: 84 additions & 0 deletions account_cutoff_picking_product_category/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
=======================================
Account Cutoff Picking Product Category
=======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d9968bf30451a1c3c75f382c59eb0c062c42e1ab1ec1f871944bb08c782ba0c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github
:target: https://github.com/OCA/account-closing/tree/16.0/account_cutoff_picking_product_category
:alt: OCA/account-closing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_cutoff_picking_product_category
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-closing&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to have the product category on cutoff lines level.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

The module is used mainly for reporting purpose (reports per product
category).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-closing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-closing/issues/new?body=module:%20account_cutoff_picking_product_category%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV
* BCIM

Contributors
------------

- Jacques-Étienne Baudoux [email protected]
- Denis Roussel [email protected]

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/16.0/account_cutoff_picking_product_category>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_cutoff_picking_product_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions account_cutoff_picking_product_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Account Cutoff Picking Product Category",
"summary": """
Allows to get the product category on cutoff lines""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,BCIM,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-closing",
"depends": ["account_cutoff_picking", "account_move_line_product_category"],
"data": [
"views/account_cutoff_line.xml",
],
}
1 change: 1 addition & 0 deletions account_cutoff_picking_product_category/models/__init__.py
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 account_cutoff_picking_product_category/models/account_cutoff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2018 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
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 account_cutoff_picking_product_category/readme/CONTEXT.md
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 <[email protected]>
- Denis Roussel <[email protected]>
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
Loading