diff --git a/account_invoice_merge_attachment/README.rst b/account_invoice_merge_attachment/README.rst index 127dc4eca9d..9698570b4df 100644 --- a/account_invoice_merge_attachment/README.rst +++ b/account_invoice_merge_attachment/README.rst @@ -2,10 +2,13 @@ Account Invoice Merge Attachment ================================ -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1e6da1fe73b943a887b55f71bc88da6edf48c2743e2305b59dc7809e61b89fa7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -13,17 +16,17 @@ Account Invoice Merge Attachment .. |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-OCA%2Ffield--service-lightgray.png?logo=github - :target: https://github.com/OCA/field-service/tree/12.0/account_invoice_merge_attachment - :alt: OCA/field-service +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_merge_attachment + :alt: OCA/account-invoicing .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-account_invoice_merge_attachment + :target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_merge_attachment :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/264/12.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to link attachment on merged invoices @@ -40,10 +43,10 @@ Configuration Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub 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 `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -75,6 +78,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/field-service `_ project on GitHub. +This module is part of the `OCA/account-invoicing `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_merge_attachment/__manifest__.py b/account_invoice_merge_attachment/__manifest__.py index 8748c1b242e..46f9d86b25d 100644 --- a/account_invoice_merge_attachment/__manifest__.py +++ b/account_invoice_merge_attachment/__manifest__.py @@ -1,21 +1,20 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Account Invoice Merge Attachment', - 'summary': """ + "name": "Account Invoice Merge Attachment", + "summary": """ Consider attachment during invoice merge process""", - 'version': '12.0.1.0.0', - 'license': 'AGPL-3', - 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', - 'website': 'https://www.acsone.eu', - 'depends': [ - 'account_invoice_merge', - 'document', + "version": "12.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-invoicing", + "depends": [ + "account_invoice_merge", + "document", ], - 'data': [ - 'wizards/invoice_merge.xml', + "data": [ + "wizards/invoice_merge.xml", ], - 'auto_install': True, + "auto_install": True, } diff --git a/account_invoice_merge_attachment/models/account_invoice.py b/account_invoice_merge_attachment/models/account_invoice.py index 4efb2aa794b..ad7eb58301a 100644 --- a/account_invoice_merge_attachment/models/account_invoice.py +++ b/account_invoice_merge_attachment/models/account_invoice.py @@ -1,31 +1,27 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, models +from odoo import models class AccountInvoice(models.Model): - _inherit = 'account.invoice' + _inherit = "account.invoice" @api.multi def do_merge(self, keep_references=True, date_invoice=False): invoices_info = super(AccountInvoice, self).do_merge( - keep_references=keep_references, date_invoice=date_invoice) + keep_references=keep_references, date_invoice=date_invoice + ) - if self.env.context.get('link_attachment'): - AttachmentObj = self.env['ir.attachment'] + if self.env.context.get("link_attachment"): + AttachmentObj = self.env["ir.attachment"] for new_invoice_id in invoices_info: old_invoice_ids = invoices_info[new_invoice_id] - attachs = AttachmentObj.search([ - ('res_model', '=', self._name), - ('res_id', 'in', old_invoice_ids) - ]) + attachs = AttachmentObj.search( + [("res_model", "=", self._name), ("res_id", "in", old_invoice_ids)] + ) for attach in attachs: - attach.copy(default={ - 'res_id': new_invoice_id, - 'name': attach.name - }) + attach.copy(default={"res_id": new_invoice_id, "name": attach.name}) return invoices_info diff --git a/account_invoice_merge_attachment/static/description/index.html b/account_invoice_merge_attachment/static/description/index.html index 23bfb008101..affa0e1bf4e 100644 --- a/account_invoice_merge_attachment/static/description/index.html +++ b/account_invoice_merge_attachment/static/description/index.html @@ -1,20 +1,20 @@ - - + Account Invoice Merge Attachment