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] delivery_line_sale_line_position: Migration to 17.0 #310

Open
wants to merge 13 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
89 changes: 89 additions & 0 deletions delivery_line_sale_line_position/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
================================
Delivery Line Sale Line Position
================================

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

.. |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%2Fstock--logistics--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-reporting/tree/17.0/delivery_line_sale_line_position
:alt: OCA/stock-logistics-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-17-0/stock-logistics-reporting-17-0-delivery_line_sale_line_position
: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/stock-logistics-reporting&target_branch=17.0
:alt: Try me on Runboat

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

This module is build on top of the module sale_order_line_position.

On the delivery report it adds a column with the Position from the
related sale order line.

The Position can also made visible int the stock picking view.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-reporting/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/stock-logistics-reporting/issues/new?body=module:%20delivery_line_sale_line_position%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
-------

* Camptocamp

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

- Thierry Ducrest <thierry.ducrest@camptocamp.com>
- `Trobz <https://trobz.com>`__:
- Do Anh Duy <duyda@trobz.com>

Other credits
-------------

The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp

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/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/17.0/delivery_line_sale_line_position>`_ 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 delivery_line_sale_line_position/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions delivery_line_sale_line_position/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "Delivery Line Sale Line Position",
"summary": "Adds the sale line position to the delivery report lines",
"version": "17.0.1.0.0",
"category": "Delivery",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/stock-logistics-reporting",
"depends": ["stock", "sale_order_line_position"],
"data": [
"report/report_deliveryslip.xml",
"views/stock_move.xml",
"views/stock_picking.xml",
],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * delivery_line_sale_line_position
#
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: delivery_line_sale_line_position
#: model_terms:ir.ui.view,arch_db:delivery_line_sale_line_position.report_delivery_document
msgid "<strong>Pos</strong>"
msgstr ""

#. module: delivery_line_sale_line_position
#: model:ir.model.fields,field_description:delivery_line_sale_line_position.field_stock_move__position_sale_line
#: model:ir.model.fields,field_description:delivery_line_sale_line_position.field_stock_move_line__position_sale_line
msgid "Position"
msgstr ""

#. module: delivery_line_sale_line_position
#: model:ir.model,name:delivery_line_sale_line_position.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr ""

#. module: delivery_line_sale_line_position
#: model:ir.model,name:delivery_line_sale_line_position.model_stock_move
msgid "Stock Move"
msgstr ""
2 changes: 2 additions & 0 deletions delivery_line_sale_line_position/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_move
from . import stock_move_line
13 changes: 13 additions & 0 deletions delivery_line_sale_line_position/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


class StockMove(models.Model):
_inherit = "stock.move"

position_sale_line = fields.Char(
related="sale_line_id.position_formatted",
string="Position",
)
12 changes: 12 additions & 0 deletions delivery_line_sale_line_position/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

position_sale_line = fields.Char(
related="move_id.position_sale_line", string="Position"
)
3 changes: 3 additions & 0 deletions delivery_line_sale_line_position/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions delivery_line_sale_line_position/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Thierry Ducrest \<<thierry.ducrest@camptocamp.com>\>
- [Trobz](https://trobz.com):
- Do Anh Duy \<<duyda@trobz.com>\>
2 changes: 2 additions & 0 deletions delivery_line_sale_line_position/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp
6 changes: 6 additions & 0 deletions delivery_line_sale_line_position/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module is build on top of the module sale_order_line_position.

On the delivery report it adds a column with the Position from the
related sale order line.

The Position can also made visible int the stock picking view.
52 changes: 52 additions & 0 deletions delivery_line_sale_line_position/report/report_deliveryslip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_delivery_document" inherit_id="stock.report_delivery_document">
<!-- Changes for when the picking is not yet done -->
<xpath expr="//table[@name='stock_move_table']/thead" position="before">
<t
t-set="has_line_position"
t-value="any(o.move_ids.filtered(lambda x: x.position_sale_line and x.product_uom_qty))"
/>
</xpath>
<xpath expr="//table[@name='stock_move_table']/thead//th[1]" position="before">
<th t-if="has_line_position" name="th_sm_pos"><strong>Pos</strong></th>
</xpath>
<xpath expr="//table[@name='stock_move_table']/tbody//td[1]" position="before">
<td t-if="has_line_position" name="td_sm_pos">
<span t-field="move.position_sale_line" />
</td>
</xpath>
<!-- Changes for when the picking is done -->
<xpath expr="//table[@name='stock_move_line_table']/thead" position="before">
<t
t-set="has_line_position"
t-value="any(o.move_line_ids.mapped('position_sale_line'))"
/>
</xpath>
<xpath
expr="//table[@name='stock_move_line_table']/thead//th[1]"
position="before"
>
<th t-if="has_line_position and has_serial_number" name="th_sml_pos"><strong
>Pos</strong></th>
</xpath>
<!--
NOTE: The rows are rendered by other templates.
`stock_report_delivery_has_serial_move_line` if the lines have lots/serials
`stock_report_delivery_aggregated_move_lines` if they don't. In this case the lines are
aggregated, and so we don't display the position.
-->
</template>

<template
id="stock_report_delivery_has_serial_move_line"
inherit_id="stock.stock_report_delivery_has_serial_move_line"
>
<xpath expr="//td[1]" position="before">
<td t-if="has_line_position">
<span t-field="move_line.position_sale_line" />
</td>
</xpath>
</template>

</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading