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

[14.0][ADD] account_move_sale_line_description: Show sale order line … #3018

Open
wants to merge 1 commit into
base: 14.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
29 changes: 29 additions & 0 deletions account_move_sale_line_description/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==================================
Account Move Sale Line Description
==================================

* Show sale order line description in account move line.


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

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble,
please check there if your issue has already been reported. If you spotted
it first, help us smash it by providing detailed and welcomed feedback.

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

Credits
=======

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

* Ana Juaristi <[email protected]>
* Alfredo de la Fuente <[email protected]>
1 change: 1 addition & 0 deletions account_move_sale_line_description/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions account_move_sale_line_description/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Account Move Sale Line Description",
"version": "14.0.1.0.0",
"author": "Avanzosc",
"category": "Sale",
"website": "https://github.com/avanzosc/odoo-addons",
"depends": [
"account",
"sale",
],
"data": [
"report/report_account_move.xml",
],
"license": "AGPL-3",
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_sale_line_description
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 10:24+0000\n"
"PO-Revision-Date: 2024-11-27 10:24+0000\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_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__display_name
msgid "Display Name"
msgstr ""

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__id
msgid "ID"
msgstr ""

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

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line____last_update
msgid "Last Modified on"
msgstr ""
36 changes: 36 additions & 0 deletions account_move_sale_line_description/i18n/en_GB.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_sale_line_description
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 10:24+0000\n"
"PO-Revision-Date: 2024-11-27 10:24+0000\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_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__display_name
msgid "Display Name"
msgstr ""

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__id
msgid "ID"
msgstr ""

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

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line____last_update
msgid "Last Modified on"
msgstr ""
36 changes: 36 additions & 0 deletions account_move_sale_line_description/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_sale_line_description
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 10:24+0000\n"
"PO-Revision-Date: 2024-11-27 10:24+0000\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_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line__id
msgid "ID"
msgstr ""

#. module: account_move_sale_line_description
#: model:ir.model,name:account_move_sale_line_description.model_account_move_line
msgid "Journal Item"
msgstr "Apunte contable"

#. module: account_move_sale_line_description
#: model:ir.model.fields,field_description:account_move_sale_line_description.field_account_move_line____last_update
msgid "Last Modified on"
msgstr "Última modificación el"
1 change: 1 addition & 0 deletions account_move_sale_line_description/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
25 changes: 25 additions & 0 deletions account_move_sale_line_description/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, models


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

@api.onchange("sale_line_ids")
def compute_account_move_line_description(self):
for record in self:
str_name = "" if record.sale_line_ids else record.name
for line in record.sale_line_ids:
if len(record.sale_line_ids) > 1:
str_name += " - "
str_name += line.name
record.name = str_name

@api.model_create_multi
def create(self, vals_list):
res = super().create(vals_list)
if res.sale_line_ids:
res.compute_account_move_line_description()
return res
19 changes: 19 additions & 0 deletions account_move_sale_line_description/report/report_account_move.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template
id="report_invoice_document"
inherit_id="account.report_invoice_document"
priority="100"
>
<xpath expr="//td[@name='account_invoice_line_name']/span" position="replace">
<t t-if="len(line.sale_line_ids)==0">
<span t-field="line.name" t-options="{'widget': 'text'}" />
</t>
<t t-else="">
<t t-foreach="line.sale_line_ids" t-as="sale_line">
<span><t t-esc="sale_line.name" /></span>
</t>
</t>
</xpath>
</template>
</odoo>
6 changes: 6 additions & 0 deletions setup/account_move_sale_line_description/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading