-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[11.0][ADD]account_supplier_invoice_number
- Loading branch information
1 parent
88083f7
commit ac98a6e
Showing
7 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png | ||
:target: https://www.gnu.org/licenses/agpl | ||
:alt: License: AGPL-3 | ||
|
||
======================= | ||
Supplier invoice number | ||
======================= | ||
|
||
This module adds the 'Supplier Invoice Number' field to a supplier invoice. | ||
|
||
This module is a prerequisite for other modules adding extra functionality such as | ||
|
||
- supplier invoices with structured communications | ||
- supplier invoice duplicate checking | ||
|
||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
- Align this module with the OCA 'account_invoice_supplier_ref_unique' module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2009-2019 Noviat. | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Supplier invoice number', | ||
'version': '11.0.1.0.0', | ||
'category': 'Accounting & Finance', | ||
'website': 'https://www.noviat.com', | ||
'author': 'Noviat', | ||
'license': 'AGPL-3', | ||
'data': [ | ||
'views/account_invoice_views.xml', | ||
], | ||
'depends': [ | ||
'account', | ||
], | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_invoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2009-2019 Noviat. | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountInvoice(models.Model): | ||
_inherit = 'account.invoice' | ||
|
||
supplier_invoice_number = fields.Char( | ||
string='Vendor Invoice Number', | ||
readonly=True, | ||
states={'draft': [('readonly', False)]}, | ||
copy=False) | ||
|
||
@api.onchange('supplier_invoice_number') | ||
def _onchange_supplier_invoice_number(self): | ||
if not self.reference: | ||
self.reference = self.supplier_invoice_number | ||
|
||
@api.onchange('reference') | ||
def _onchange_vendor_bill_reference(self): | ||
if self.type in ['in_invoice', 'in_refund'] \ | ||
and not self.supplier_invoice_number: | ||
self.supplier_invoice_number = self.reference |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
account_supplier_invoice_number/views/account_invoice_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="invoice_supplier_form" model="ir.ui.view"> | ||
<field name="name">account.invoice.supplier.form.inherit</field> | ||
<field name="model">account.invoice</field> | ||
<field name="inherit_id" ref="account.invoice_supplier_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="partner_id" position="after"> | ||
<field name="supplier_invoice_number"/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |