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

[15.0][MIG] sale_timesheet_order_line_sync: Migration to version 15.0 #518

Closed
Closed
89 changes: 89 additions & 0 deletions sale_timesheet_order_line_sync/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
==============================
Sale Timesheet Order Line Sync
==============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/14.0/sale_timesheet_order_line_sync
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-14-0/timesheet-14-0-sale_timesheet_order_line_sync
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/117/14.0
:alt: Try me on Runbot

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

This module synchronises task sale order line in *not invoiced* timesheet
lines.

Synchronization occurs only when saving a different order line in the task.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Go to **Project > All Tasks**
#. Open specific task for editing
#. In *Extra Info*, select a customer.
#. Set a Sales Order Item where the invoiced product's *Service Invoicing Policy* is *Timesheets on tasks*
#. Add *Timesheets* to the task if there aren't any.
#. Open Sale Order to view delivered quantity

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/timesheet/issues/new?body=module:%20sale_timesheet_order_line_sync%0Aversion:%2014.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
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Dauden
* João Marques

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/timesheet <https://github.com/OCA/timesheet/tree/14.0/sale_timesheet_order_line_sync>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_timesheet_order_line_sync/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
16 changes: 16 additions & 0 deletions sale_timesheet_order_line_sync/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2020 Tecnativa - Carlos Dauden
# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Timesheet Order Line Sync",
"version": "15.0.1.0.0",
"category": "Sales",
"website": "https://github.com/OCA/timesheet",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"application": False,
"summary": "Propagate task order line in not invoiced timesheet lines",
"depends": ["sale_timesheet", "sale_project"],
}
22 changes: 22 additions & 0 deletions sale_timesheet_order_line_sync/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_order_line_sync
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-18 20:19+0000\n"
"Last-Translator: Josep M <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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 3.10\n"

#. module: sale_timesheet_order_line_sync
#: model:ir.model,name:sale_timesheet_order_line_sync.model_project_task
msgid "Task"
msgstr "Tarea"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_order_line_sync
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: sale_timesheet_order_line_sync
#: model:ir.model.fields,field_description:sale_timesheet_order_line_sync.field_project_task__display_name
msgid "Display Name"
msgstr ""

#. module: sale_timesheet_order_line_sync
#: model:ir.model.fields,field_description:sale_timesheet_order_line_sync.field_project_task__id
msgid "ID"
msgstr ""

#. module: sale_timesheet_order_line_sync
#: model:ir.model.fields,field_description:sale_timesheet_order_line_sync.field_project_task____last_update
msgid "Last Modified on"
msgstr ""

#. module: sale_timesheet_order_line_sync
#: model:ir.model,name:sale_timesheet_order_line_sync.model_project_task
msgid "Task"
msgstr ""
3 changes: 3 additions & 0 deletions sale_timesheet_order_line_sync/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import project_task
23 changes: 23 additions & 0 deletions sale_timesheet_order_line_sync/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class ProjectTask(models.Model):
_inherit = "project.task"

def write(self, vals):
res = super().write(vals)
sale_line_id = vals.get("sale_line_id", None)
if sale_line_id is None:
return res
# Avoid rewrite so_line if pricing_type is fixed_rate
self.filtered(lambda t: t.pricing_type == "fixed_rate").sudo().mapped(
"timesheet_ids"
).filtered(
lambda l: (not l.timesheet_invoice_id and l.so_line.id != sale_line_id)
).write(
{"so_line": sale_line_id}
)
return res
4 changes: 4 additions & 0 deletions sale_timesheet_order_line_sync/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Dauden
* João Marques
4 changes: 4 additions & 0 deletions sale_timesheet_order_line_sync/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module synchronises task sale order line in *not invoiced* timesheet
lines.

Synchronization occurs only when saving a different order line in the task.
10 changes: 10 additions & 0 deletions sale_timesheet_order_line_sync/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#. Go to **Project > My Tasks**.
#. Open specific task for editing.
#. Select a customer.
#. Within the project, make sure at least **Timesheets** and **Billable**
options under **Settings** tab are selected.
#. Make sure the product is a service and its **Invoicing Policy** is set to
**Based on Timesheets**.
#. Set a Sales Order Item where the invoiced product's *Service Invoicing Policy* is *Timesheets on tasks*
#. Add *Timesheets* to the task if there aren't any.
#. Open **Sales Order Item** option to view delivered quantity.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading