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_invoice_repair_info: In invoice new field "Repair… #113

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
27 changes: 27 additions & 0 deletions account_invoice_repair_info/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. 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 Invoice Repair Info
===========================

* In invoice new field "Repair Order".

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

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/mrp-repair-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.

Credits
=======

Contributors
------------
* Alfredo de la Fuente <[email protected]>
* Ana Juaristi <[email protected]>

Do not contact contributors directly about support or help with technical issues.
1 change: 1 addition & 0 deletions account_invoice_repair_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions account_invoice_repair_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Account Invoice Repair Info",
"version": "14.0.1.0.0",
"category": "Inventory/Inventory",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-repair-addons",
"depends": ["account", "repair"],
"data": [
"report/account_invoice_report.xml",
"views/account_move_views.xml",
],
"installable": True,
}
48 changes: 48 additions & 0 deletions account_invoice_repair_info/i18n/account_invoice_repair_info.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_repair_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 12:00+0000\n"
"PO-Revision-Date: 2024-11-27 12:00+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_invoice_repair_info
#: model_terms:ir.ui.view,arch_db:account_invoice_repair_info.report_invoice_document
msgid "<strong>Repair Order Lot:</strong>"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__display_name
msgid "Display Name"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__id
msgid "ID"
msgstr ""

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

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_bank_statement_line__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_payment__repair_order_id
msgid "Repair Order"
msgstr ""
48 changes: 48 additions & 0 deletions account_invoice_repair_info/i18n/en_GB.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_repair_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 12:00+0000\n"
"PO-Revision-Date: 2024-11-27 12:00+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_invoice_repair_info
#: model_terms:ir.ui.view,arch_db:account_invoice_repair_info.report_invoice_document
msgid "<strong>Repair Order Lot:</strong>"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__display_name
msgid "Display Name"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__id
msgid "ID"
msgstr ""

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

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_bank_statement_line__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_payment__repair_order_id
msgid "Repair Order"
msgstr ""
48 changes: 48 additions & 0 deletions account_invoice_repair_info/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_repair_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-27 12:01+0000\n"
"PO-Revision-Date: 2024-11-27 12:01+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_invoice_repair_info
#: model_terms:ir.ui.view,arch_db:account_invoice_repair_info.report_invoice_document
msgid "<strong>Repair Order Lot:</strong>"
msgstr "<strong>Lote orden reparación:</strong>"

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__id
msgid "ID"
msgstr ""

#. module: account_invoice_repair_info
#: model:ir.model,name:account_invoice_repair_info.model_account_move
msgid "Journal Entry"
msgstr "Asiento contable"

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move____last_update
msgid "Last Modified on"
msgstr "Última modificación en"

#. module: account_invoice_repair_info
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_bank_statement_line__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_move__repair_order_id
#: model:ir.model.fields,field_description:account_invoice_repair_info.field_account_payment__repair_order_id
msgid "Repair Order"
msgstr "Orden reparación"
1 change: 1 addition & 0 deletions account_invoice_repair_info/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
23 changes: 23 additions & 0 deletions account_invoice_repair_info/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


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

repair_order_id = fields.Many2one(
string="Repair Order",
comodel_name="repair.order",
compute="_compute_repair_order_id",
store=True,
)

@api.depends("repair_ids")
def _compute_repair_order_id(self):
for move in self:
repair_order_id = self.env["repair.order"]
for repair in move.repair_ids:
repair_order_id = repair.id
move.repair_order_id = repair_order_id
15 changes: 15 additions & 0 deletions account_invoice_repair_info/report/account_invoice_report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<div name="reference" position="after">
<div
class="col-auto col-3 mw-100 mb-2"
name="lot_from_repair"
t-if="o.repair_order_id and o.repair_order_id.lot_id"
>
<strong>Repair Order Lot:</strong>
<p class="m-0" t-field="o.repair_order_id.lot_id.name" />
</div>
</div>
</template>
</odoo>
38 changes: 38 additions & 0 deletions account_invoice_repair_info/views/account_move_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter" />
<field name="arch" type="xml">
<field name="invoice_user_id" position="after">
<field name="repair_order_id" />
</field>
</field>
</record>

<record id="view_invoice_tree" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml">
<field name="ref" position="after">
<field name="repair_order_id" optional="show" readonly="1" />
</field>
</field>
</record>

<record id="view_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<field name="payment_reference" position="after">
<field
name="repair_order_id"
readonly="1"
attrs="{'invisible': [('repair_order_id', '=', False)]}"
/>
</field>
</field>
</record>


</odoo>
6 changes: 6 additions & 0 deletions setup/account_invoice_repair_info/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