Skip to content

Commit

Permalink
[16.0][MIG] repair_execute_invoice_onchange_partner: Migration to 16.0 (
Browse files Browse the repository at this point in the history
avanzosc#91)

* [ADD] repair_execute_invoice_onchange_partner: When creating an invoice from a repair order, execute the "onchange" partner of the invoice. (avanzosc#77)

* [MIG] repair_execute_invoice_onchange_partner: Migration to 16.0

* [ADD] Change invoice to move

---------

Co-authored-by: alfredoavanzosc <alfredodelafuente@avanzosc.es>
  • Loading branch information
unaiberis and alfredoavanzosc authored Jul 15, 2024
1 parent c16cf6b commit c5a4d97
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 0 deletions.
28 changes: 28 additions & 0 deletions repair_execute_invoice_onchange_partner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. 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

=======================================
Repair execute invoice onchange partner
=======================================

* When creating an invoice from a repair order, execute the "onchange" partner
of the invoice.

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
------------
* Ana Juaristi <anajuaristi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>

Do not contact contributors directly about support or help with technical issues.
1 change: 1 addition & 0 deletions repair_execute_invoice_onchange_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions repair_execute_invoice_onchange_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Repair Execute Move Onchange Partner",
"version": "16.0.1.0.0",
"category": "Manufacturing",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-repair-addons",
"license": "AGPL-3",
"depends": [
"repair",
],
"data": [],
"installable": True,
"auto_install": True,
}
27 changes: 27 additions & 0 deletions repair_execute_invoice_onchange_partner/i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_execute_invoice_onchange_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 08:48+0000\n"
"PO-Revision-Date: 2023-11-24 08:48+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: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_account_invoice
msgid "Invoice"
msgstr "Factura"

#. module: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_repair_order
msgid "Repair Order"
msgstr "Ordre de reparació"

27 changes: 27 additions & 0 deletions repair_execute_invoice_onchange_partner/i18n/en_US.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_execute_invoice_onchange_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 08:49+0000\n"
"PO-Revision-Date: 2023-11-24 08:49+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: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_account_invoice
msgid "Invoice"
msgstr ""

#. module: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_repair_order
msgid "Repair Order"
msgstr ""

27 changes: 27 additions & 0 deletions repair_execute_invoice_onchange_partner/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_execute_invoice_onchange_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 08:49+0000\n"
"PO-Revision-Date: 2023-11-24 08:49+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: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_account_invoice
msgid "Invoice"
msgstr "Factura"

#. module: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_repair_order
msgid "Repair Order"
msgstr "Orden de reparación"

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_execute_invoice_onchange_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 08:48+0000\n"
"PO-Revision-Date: 2023-11-24 08:48+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: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_account_invoice
msgid "Invoice"
msgstr ""

#. module: repair_execute_invoice_onchange_partner
#: model:ir.model,name:repair_execute_invoice_onchange_partner.model_repair_order
msgid "Repair Order"
msgstr ""

2 changes: 2 additions & 0 deletions repair_execute_invoice_onchange_partner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import repair_order
from . import account_invoice
14 changes: 14 additions & 0 deletions repair_execute_invoice_onchange_partner/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, models


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

@api.model
def create(self, vals):
move = super().create(vals)
if "create_move_from_repair" in self.env.context:
move._onchange_partner_id()
return move
12 changes: 12 additions & 0 deletions repair_execute_invoice_onchange_partner/models/repair_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2023 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models


class RepairOrder(models.Model):
_inherit = "repair.order"

def action_move_create(self, group=False):
return super(
RepairOrder, self.with_context(create_move_from_repair=True)
).action_move_create(group=group)
6 changes: 6 additions & 0 deletions setup/repair_execute_invoice_onchange_partner/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,
)

0 comments on commit c5a4d97

Please sign in to comment.