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

[17.0][MIG] project task analytic propagation: Migration to 17.0 #737

Open
wants to merge 6 commits into
base: 17.0
Choose a base branch
from
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
114 changes: 114 additions & 0 deletions project_task_analytic_propagation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
=================================
Project Task Analytic Propagation
=================================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/17.0/project_task_analytic_propagation
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-17-0/timesheet-17-0-project_task_analytic_propagation
: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/timesheet&target_branch=17.0
:alt: Try me on Runboat

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

This module allows you to change the analytical account of the unbilled
timesheet when your related task changes the account as it does with the
sales order item.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Go to Sales > Order and select an order with a project related to it
but not invoiced yet.
2. Click on task's smart button and select a task with 'Sales Order
Item' set (or create a new task in other case).
3. Select any analytic account in 'Extra Info'.
4. Record some time on timesheets page.
5. Go back to your order and create an invoice.
6. Go to the previous task and record some time. Then change the
analytic account.
7. In timesheet's page only not invoiced timesheets changed the analytic
account.
8. To check this go to Timesheets > Reporting > by Task.
9. Change to list view and group by Project > Task > Analytic Account.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/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/timesheet/issues/new?body=module:%20project_task_analytic_propagation%0Aversion:%2017.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
-------

* Moduon

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

- Eduardo López (`Moduon <https://www.moduon.team/>`__)
- Rafael Blasco (`Moduon <https://www.moduon.team/>`__)

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.

.. |maintainer-edlopen| image:: https://github.com/edlopen.png?size=40px
:target: https://github.com/edlopen
:alt: edlopen
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
:target: https://github.com/rafaelbn
:alt: rafaelbn

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-edlopen| |maintainer-rafaelbn|

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/17.0/project_task_analytic_propagation>`_ 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 project_task_analytic_propagation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions project_task_analytic_propagation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/LGPL-3.0)

{
"name": "Project Task Analytic Propagation",
"summary": "Updates timesheet's analytic account"
" when their task changes the analytic.",
"version": "17.0.1.0.0",
"development_status": "Alpha",
"category": "Timesheet",
"website": "https://github.com/OCA/timesheet",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["edlopen", "rafaelbn"],
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": [
"sale_timesheet",
],
}
27 changes: 27 additions & 0 deletions project_task_analytic_propagation/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_analytic_propagation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-26 16:34+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: project_task_analytic_propagation
#: model:ir.model.fields,field_description:project_task_analytic_propagation.field_account_analytic_line__account_id
msgid "Analytic Account"
msgstr "Conto analitico"

#. module: project_task_analytic_propagation
#: model:ir.model,name:project_task_analytic_propagation.model_account_analytic_line
msgid "Analytic Line"
msgstr "Riga analitica"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_analytic_propagation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: project_task_analytic_propagation
#: model:ir.model.fields,field_description:project_task_analytic_propagation.field_account_analytic_line__account_id
msgid "Analytic Account"
msgstr ""

#. module: project_task_analytic_propagation
#: model:ir.model,name:project_task_analytic_propagation.model_account_analytic_line
msgid "Analytic Line"
msgstr ""
28 changes: 28 additions & 0 deletions project_task_analytic_propagation/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_analytic_propagation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-22 03:22+0000\n"
"Last-Translator: Rodrigo Macedo <[email protected]."
"translation.odoo-community.org>\n"
"Language-Team: none\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: project_task_analytic_propagation
#: model:ir.model.fields,field_description:project_task_analytic_propagation.field_account_analytic_line__account_id
msgid "Analytic Account"
msgstr "Conta Analítica"

#. module: project_task_analytic_propagation
#: model:ir.model,name:project_task_analytic_propagation.model_account_analytic_line
msgid "Analytic Line"
msgstr "Linha Analítica"
1 change: 1 addition & 0 deletions project_task_analytic_propagation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_analytic_line
24 changes: 24 additions & 0 deletions project_task_analytic_propagation/models/account_analytic_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/LGPL-3.0)
from odoo import api, fields, models


class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

account_id = fields.Many2one(
compute="_compute_account_id",
store=True,
readonly=False,
)

@api.depends("task_id.analytic_account_id")
def _compute_account_id(self):
"""Change the analytic account non billed lines."""
timesheet_ids = self.filtered(
lambda t: not t.is_so_line_edited
and t._is_not_billed()
and t.task_id.analytic_account_id
)
for timesheet in timesheet_ids:
timesheet.account_id = timesheet.task_id.analytic_account_id
3 changes: 3 additions & 0 deletions project_task_analytic_propagation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions project_task_analytic_propagation/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Eduardo López ([Moduon](https://www.moduon.team/))
- Rafael Blasco ([Moduon](https://www.moduon.team/))
2 changes: 2 additions & 0 deletions project_task_analytic_propagation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows you to change the analytical account of the unbilled timesheet when your
related task changes the account as it does with the sales order item.
11 changes: 11 additions & 0 deletions project_task_analytic_propagation/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To use this module, you need to:

1. Go to Sales > Order and select an order with a project related to it but not invoiced yet.
2. Click on task's smart button and select a task with 'Sales Order Item' set (or create a new task in other case).
3. Select any analytic account in 'Extra Info'.
4. Record some time on timesheets page.
5. Go back to your order and create an invoice.
6. Go to the previous task and record some time. Then change the analytic account.
7. In timesheet's page only not invoiced timesheets changed the analytic account.
8. To check this go to Timesheets > Reporting > by Task.
9. Change to list view and group by Project > Task > Analytic Account.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading