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

[18.0][MIG] account_invoice_line_sale_line_position: Migration to 18.0 #343

Open
wants to merge 13 commits into
base: 18.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
96 changes: 96 additions & 0 deletions account_invoice_line_sale_line_position/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=======================================
Account Invoice Line Sale Line Position
=======================================

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

.. |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--invoice--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoice-reporting/tree/18.0/account_invoice_line_sale_line_position
:alt: OCA/account-invoice-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoice-reporting-18-0/account-invoice-reporting-18-0-account_invoice_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/account-invoice-reporting&target_branch=18.0
:alt: Try me on Runboat

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

This module is build on top of the module sale_order_line_position.

It adds (if any) the sale line position on the invoice line. There can
be multiple positions for one invoicing line. And they are added to the
report.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoice-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/account-invoice-reporting/issues/new?body=module:%20account_invoice_line_sale_line_position%0Aversion:%2018.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>`__:

- Nguyen Ho <nguyenhk@trobz.com>
- Khoi (Kien Kim) <khoikk@trobz.com>

- `Binhex <https://binhex.cloud/>`__:
- David Luis Mora <d.luis@binhex.cloud>

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

The migration of this module from 13.0 to 14.0 was financially supported
by Camptocamp

The migration of this module from 16.0 to 18.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/account-invoice-reporting <https://github.com/OCA/account-invoice-reporting/tree/18.0/account_invoice_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 account_invoice_line_sale_line_position/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions account_invoice_line_sale_line_position/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "Account Invoice Line Sale Line Position",
"summary": "Adds the related sale line position on invoice line.",
"version": "18.0.1.0.0",
"category": "Sale",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/account-invoice-reporting",
"depends": ["sale_order_line_position"],
"data": ["views/account_move_views.xml", "report/invoice_report.xml"],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_line_sale_line_position
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_bank_statement_line__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_payment__has_order_position
msgid "Has Order Position"
msgstr ""

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_invoice_line_sale_line_position
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.report_invoice_document
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.view_move_form
msgid "Pos"
msgstr ""

#. module: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move_line__position_formatted
msgid "Position Formatted"
msgstr ""
54 changes: 54 additions & 0 deletions account_invoice_line_sale_line_position/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_line_sale_line_position
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-05-11 13:05+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n"
"Language-Team: none\n"
"Language: de\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.3.2\n"

#. module: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_bank_statement_line__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_payment__has_order_position
msgid "Has Order Position"
msgstr "Hat Auftragsposition"

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move
msgid "Journal Entry"
msgstr "Journalbuchung"

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move_line
msgid "Journal Item"
msgstr "Journal-Item"

#. module: account_invoice_line_sale_line_position
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.report_invoice_document
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.view_move_form
msgid "Pos"
msgstr "Pos"

#. module: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move_line__position_formatted
msgid "Position Formatted"
msgstr ""

#~ msgid "Display Name"
#~ msgstr "Anzeigename"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Zuletzt geändert am"
45 changes: 45 additions & 0 deletions account_invoice_line_sale_line_position/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_line_sale_line_position
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-29 10:09+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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 4.17\n"

#. module: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_bank_statement_line__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move__has_order_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_payment__has_order_position
msgid "Has Order Position"
msgstr "Tiene posición de pedido"

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move
msgid "Journal Entry"
msgstr "Entrada diaria"

#. module: account_invoice_line_sale_line_position
#: model:ir.model,name:account_invoice_line_sale_line_position.model_account_move_line
msgid "Journal Item"
msgstr "artículo diario"

#. module: account_invoice_line_sale_line_position
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.report_invoice_document
#: model_terms:ir.ui.view,arch_db:account_invoice_line_sale_line_position.view_move_form
msgid "Pos"
msgstr "Posición"

#. module: account_invoice_line_sale_line_position
#: model:ir.model.fields,field_description:account_invoice_line_sale_line_position.field_account_move_line__position_formatted
msgid "Position Formatted"
msgstr "Posición Formateada"
1 change: 1 addition & 0 deletions account_invoice_line_sale_line_position/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_invoice
35 changes: 35 additions & 0 deletions account_invoice_line_sale_line_position/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import api, fields, models


class AccountMove(models.Model):
_inherit = "account.move"

has_order_position = fields.Boolean(compute="_compute_has_order_position")

@api.depends("invoice_line_ids.position_formatted")
def _compute_has_order_position(self):
for record in self:
record.has_order_position = any(

Check warning on line 15 in account_invoice_line_sale_line_position/models/account_invoice.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_line_sale_line_position/models/account_invoice.py#L15

Added line #L15 was not covered by tests
record.invoice_line_ids.mapped("position_formatted")
)


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

position_formatted = fields.Char(compute="_compute_position_formatted")

@api.depends("sale_line_ids.position")
def _compute_position_formatted(self):
for record in self:
if record.display_type:
record.position_formatted = ""
continue
values = [
val for val in record.sale_line_ids.mapped("position_formatted") if val
]

record.position_formatted = "/".join(values)
3 changes: 3 additions & 0 deletions account_invoice_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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Thierry Ducrest \<<thierry.ducrest@camptocamp.com>\>
- [Trobz](https://trobz.com):
- Nguyen Ho \<<nguyenhk@trobz.com>\>
- Khoi (Kien Kim) \<<khoikk@trobz.com>\>
- [Binhex](https://binhex.cloud/):
- David Luis Mora \<<d.luis@binhex.cloud>\>
5 changes: 5 additions & 0 deletions account_invoice_line_sale_line_position/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The migration of this module from 13.0 to 14.0 was financially supported
by Camptocamp

The migration of this module from 16.0 to 18.0 was financially supported
by Camptocamp
5 changes: 5 additions & 0 deletions account_invoice_line_sale_line_position/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module is build on top of the module sale_order_line_position.

It adds (if any) the sale line position on the invoice line. There can
be multiple positions for one invoicing line. And they are added to the
report.
16 changes: 16 additions & 0 deletions account_invoice_line_sale_line_position/report/invoice_report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//table/thead/tr/th[@name='th_description']" position="before">
<th t-if="o.has_order_position" class="text-left">Pos</th>
</xpath>
<xpath
expr="//table/tbody[hasclass('invoice_tbody')]//td[@name='account_invoice_line_name']"
position="before"
>
<td t-if="o.has_order_position">
<span t-field="line.position_formatted" />
</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