@ -0,0 +1,50 @@ |
|||
.. image:: https://img.shields.io/badge/license-OPL--1-red.svg |
|||
:target: https://www.odoo.com/documentation/18.0/legal/licenses.html#odoo-apps |
|||
:alt: License: OPL-1 |
|||
|
|||
Product Multi Document |
|||
====================== |
|||
This module helps to attach multiple documents in product. |
|||
|
|||
Configuration |
|||
------------- |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Odoo Proprietary License v1.0 (OPL-1) |
|||
(https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers : (V15) Aysha Shalin, |
|||
(V16) Afra M P, |
|||
(V17) Aysha Shalin, |
|||
(V18) Ashwin T, |
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
from . import models |
@ -0,0 +1,45 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'name': 'Product Multi Document', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Purchases,Discuss', |
|||
'summary': """Multiple documents can be attached to a product with the help |
|||
of this module.""", |
|||
'description': """This module helps to add multiple documents in product |
|||
and we can see these documents while we are selecting a product in purchase |
|||
order line and automatically get attached in Email.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['base', 'documents', 'purchase'], |
|||
'data': [ |
|||
'views/product_template_views.xml', |
|||
'views/purchase_order_views.xml', |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'OPL-1', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,6 @@ |
|||
## Module <product_multi_document> |
|||
|
|||
#### 22.10.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial commit for Product Multi Document |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
from . import mail_template |
|||
from . import product_template |
|||
from . import purchase_order_line |
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
import base64 |
|||
from odoo import models |
|||
|
|||
|
|||
class MailTemplate(models.Model): |
|||
"""Inherit the class to send mail to all product documents.""" |
|||
_inherit = "mail.template" |
|||
|
|||
def _generate_template_attachments(self, res_ids, render_fields, |
|||
render_results=None): |
|||
"""Super the function generate_email to add product documents in mail""" |
|||
res = super()._generate_template_attachments( |
|||
res_ids, render_fields, render_results) |
|||
if self.render_model == 'purchase.order': |
|||
documents = [] |
|||
for document_id in self.env['purchase.order'].browse( |
|||
res_ids[0]).order_line.document_ids: |
|||
documents.append( |
|||
(document_id.name, base64.b64encode(document_id.raw))) |
|||
res[res_ids[0]]['attachments'] += documents |
|||
return res |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
""" Inherited product.template to add field """ |
|||
_inherit = 'product.template' |
|||
|
|||
document_ids = fields.Many2many('documents.document', |
|||
string='Document', |
|||
help='Added product document', |
|||
domain=[('type', '=', 'binary')]) |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashwin T (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies of the |
|||
# Software or modified copies of the Software. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. |
|||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|||
# OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class PurchaseOrderLine(models.Model): |
|||
""" Inherited purchase.order.line to add documents field """ |
|||
_inherit = 'purchase.order.line' |
|||
|
|||
document_ids = fields.Many2many( |
|||
related='product_id.product_tmpl_id.document_ids', string='Documents', |
|||
help='Product documents') |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 7.6 KiB |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Inherit the product_template form view to add field --> |
|||
<record id="product_template_only_form_view" model="ir.ui.view"> |
|||
<field name='name'>product.template.view.form.inherit.product.multi.document</field> |
|||
<field name='model'>product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_only_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="barcode" position="after"> |
|||
<field name="document_ids" widget="many2many_tags"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Inherit the product_template form view to add field --> |
|||
<record id="purchase_order_form" model="ir.ui.view"> |
|||
<field name='name'>purchase.order.view.form.inherit.product.multi.document</field> |
|||
<field name='model'>purchase.order</field> |
|||
<field name="inherit_id" ref="purchase.purchase_order_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//list/field[@name='name']" position="after"> |
|||
<field name="document_ids" widget="many2many_tags"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |