Skip to content

Commit

Permalink
[15.0][3890][MIG] purchase_invoice_indicator: Migration to 15.0 (#76)
Browse files Browse the repository at this point in the history
* [3537][ADD] purchase_invoice_indicator (#340)

* [ADD] partner_invoice_target

* [IMP] purchase_invoice_indiactor: black, isort, prettier

* [MIG] purchase_invoice_indicator: Migration to 15.0

* [UPD] dotfiles (#359)

* add setup

* [IMP] purchase_invoice_indicator
  • Loading branch information
AungKoKoLin1997 authored Oct 23, 2023
1 parent 82f9f95 commit 26596ad
Show file tree
Hide file tree
Showing 14 changed files with 630 additions and 0 deletions.
55 changes: 55 additions & 0 deletions purchase_invoice_indicator/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
==========================
Purchase Invoice Indicator
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-qrtl%2Frmm--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/rmm-custom/tree/15.0/purchase_invoice_indicator
:alt: qrtl/rmm-custom

|badge1| |badge2| |badge3|

This module introduces the is_invoice_issuer field to the Partner model and
the is_invoice field to the Invoice model. When an invoice is created,
the is_invoice_issuer value from the associated Partner or Commercial Partner record is automatically
propagated to the is_invoice field in the new Invoice record.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/rmm-custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/qrtl/rmm-custom/issues/new?body=module:%20purchase_invoice_indicator%0Aversion:%2015.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
~~~~~~~

* Quartile Limited

Maintainers
~~~~~~~~~~~

This module is part of the `qrtl/rmm-custom <https://github.com/qrtl/rmm-custom/tree/15.0/purchase_invoice_indicator>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions purchase_invoice_indicator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions purchase_invoice_indicator/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Purchase Invoice Indicator",
"version": "15.0.1.0.0",
"category": "Purchase",
"website": "https://www.quartile.co",
"author": "Quartile Limited",
"license": "AGPL-3",
"depends": ["purchase"],
"data": ["views/res_partner_views.xml", "views/account_move_views.xml"],
"installable": True,
}
44 changes: 44 additions & 0 deletions purchase_invoice_indicator/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_invoice_indicator
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-04 08:35+0000\n"
"PO-Revision-Date: 2023-08-04 08:35+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: purchase_invoice_indicator
#: model:ir.model,name:purchase_invoice_indicator.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: purchase_invoice_indicator
#: model:ir.model.fields,field_description:purchase_invoice_indicator.field_account_bank_statement_line__is_invoice_issuer
#: model:ir.model.fields,field_description:purchase_invoice_indicator.field_account_move__is_invoice_issuer
#: model:ir.model.fields,field_description:purchase_invoice_indicator.field_account_payment__is_invoice_issuer
msgid "Is Invoice Issuer"
msgstr "適格請求書"

#. module: purchase_invoice_indicator
#: model:ir.model,name:purchase_invoice_indicator.model_account_move
msgid "Journal Entry"
msgstr "仕訳"

#. module: purchase_invoice_indicator
#: model:ir.model,name:purchase_invoice_indicator.model_purchase_order
msgid "Purchase Order"
msgstr "購買オーダ"

#. module: purchase_invoice_indicator
#: model:ir.model.fields,field_description:purchase_invoice_indicator.field_res_partner__is_invoice_issuer
#: model:ir.model.fields,field_description:purchase_invoice_indicator.field_res_users__is_invoice_issuer
msgid "Qualified Invoice Issuer"
msgstr "適格請求書発行事業者"
3 changes: 3 additions & 0 deletions purchase_invoice_indicator/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import account_move
from . import res_partner
from . import purchase_order
18 changes: 18 additions & 0 deletions purchase_invoice_indicator/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


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

is_invoice_issuer = fields.Boolean()

@api.onchange("partner_id")
def onchange_invoice_partner_id(self):
if self.partner_id:
self.is_invoice_issuer = (
self.partner_id.is_invoice_issuer
or self.partner_id.commercial_partner_id.is_invoice_issuer
)
16 changes: 16 additions & 0 deletions purchase_invoice_indicator/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

def _prepare_invoice(self):
invoice_vals = super()._prepare_invoice()
invoice_vals["is_invoice_issuer"] = (
self.partner_id.is_invoice_issuer
or self.partner_id.commercial_partner_id.is_invoice_issuer
)
return invoice_vals
10 changes: 10 additions & 0 deletions purchase_invoice_indicator/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

is_invoice_issuer = fields.Boolean("Qualified Invoice Issuer")
4 changes: 4 additions & 0 deletions purchase_invoice_indicator/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module introduces the is_invoice_issuer field to the Partner model and
the is_invoice field to the Invoice model. When an invoice is created,
the is_invoice_issuer value from the associated Partner or Commercial Partner record is automatically
propagated to the is_invoice field in the new Invoice record.
Loading

0 comments on commit 26596ad

Please sign in to comment.