From 862958d1ba6dd86c7107c927045f5ce177afd266 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Wed, 26 Jul 2023 11:26:03 +0530 Subject: [PATCH] Jul 25 : [UPDT] Updated 'separate_quotation_number_odoo' --- .../__manifest__.py | 11 +++--- .../doc/RELEASE_NOTES.md | 4 ++ .../models/sale_order.py | 31 ++++++++++++---- .../static/description/index.html | 37 ++----------------- .../views/sale_order_views.xml | 5 +-- 5 files changed, 38 insertions(+), 50 deletions(-) diff --git a/separate_quotation_number_odoo/__manifest__.py b/separate_quotation_number_odoo/__manifest__.py index 34e630879..1bcf0f516 100644 --- a/separate_quotation_number_odoo/__manifest__.py +++ b/separate_quotation_number_odoo/__manifest__.py @@ -22,16 +22,15 @@ { 'name': 'Separate Quotation Number', 'version': '16.0.1.0.0', - 'summary': 'Separate Quotation Number', - 'sequence': 4, - 'description': """Separate sequence number for sales quotation and sale - orders. This is used to separate sales quotation and sale orders.""", 'category': 'Sales', + 'summary': 'Separate Quotation Number', + 'description': """Separate sequence number for sales quotation and sale orders. + This is used to separate sales quotation and sale orders.""", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', 'website': 'https://www.cybrosys.com', - 'license': 'LGPL-3', + 'images': ['static/description/banner.png'], 'depends': [ 'base', 'sale_management', @@ -41,7 +40,7 @@ 'data/ir_sequence_data.xml', 'views/sale_order_views.xml' ], - 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', 'installable': True, 'application': False, 'auto_install': False, diff --git a/separate_quotation_number_odoo/doc/RELEASE_NOTES.md b/separate_quotation_number_odoo/doc/RELEASE_NOTES.md index 19be002f0..5cf32acf0 100644 --- a/separate_quotation_number_odoo/doc/RELEASE_NOTES.md +++ b/separate_quotation_number_odoo/doc/RELEASE_NOTES.md @@ -5,3 +5,7 @@ #### ADD - Initial commit for separate_quotation_number_odoo +#### 24.07.2023 +#### Version 16.0.1.0.1 +#### FIX +- Fixed the @api.model decorator issue \ No newline at end of file diff --git a/separate_quotation_number_odoo/models/sale_order.py b/separate_quotation_number_odoo/models/sale_order.py index a4f6ae738..4cd9a0b91 100644 --- a/separate_quotation_number_odoo/models/sale_order.py +++ b/separate_quotation_number_odoo/models/sale_order.py @@ -23,17 +23,34 @@ from odoo import models, fields, api class SaleOrder(models.Model): + """ + This class extends the default 'sale.order' model to include an additional + field called 'quotation_ref', which holds an auto-generated reference + number for the quotation. + """ _inherit = 'sale.order' quotation_ref = fields.Char(string='Quotation Reference', - copy=False, readonly=True, tracking=True) + copy=False, readonly=True, tracking=True, + help="Auto-generated reference number") - @api.model + @api.model_create_multi def create(self, vals): - """Method for generating sequence for quotation """ + """ + Create Sale Orders and generate sequence numbers for quotations. + This method is called when creating multiple sale orders at once. + Generates a unique sequence number for each sale order's 'quotation_ref' + field using the 'seq_quotation'. + + :param vals_list: A list of dictionaries containing values for creating + multiple sale orders. + :type vals_list: list(dict) + :return: The created sale orders. + """ res = super(SaleOrder, self).create(vals) - seq_val = self.env.ref( - 'separate_quotation_number_odoo.seq_quotation').id - res.quotation_ref = self.env['ir.sequence'].browse( - seq_val).next_by_id() + for vals in res: + seq_val = self.env.ref( + 'separate_quotation_number_odoo.seq_quotation').id + vals.quotation_ref = self.env['ir.sequence'].browse( + seq_val).next_by_id() return res diff --git a/separate_quotation_number_odoo/static/description/index.html b/separate_quotation_number_odoo/static/description/index.html index ae4e41fc0..a75528162 100644 --- a/separate_quotation_number_odoo/static/description/index.html +++ b/separate_quotation_number_odoo/static/description/index.html @@ -38,10 +38,7 @@ - - -
@@ -169,7 +166,6 @@ Sequence number will show in state quotation send also.
- @@ -197,20 +193,17 @@ - -

- Quotation sequence will active at the state draft and send + Quotation sequence will active at the state draft and send quotation.

-

- Quotation number will display in the tree view. + Quotation number will display in the tree view.

@@ -327,7 +320,6 @@ -
-
@@ -353,7 +344,6 @@ Odoo Customization
-
@@ -365,7 +355,6 @@ Odoo Implementation
-
@@ -377,8 +366,6 @@ Odoo Support
- -
@@ -391,7 +378,6 @@ Odoo Developer
-
@@ -403,7 +389,6 @@ Odoo Integration
-
@@ -415,8 +400,6 @@ Odoo Migration
- -
@@ -428,7 +411,6 @@ Odoo Consultancy
-
@@ -440,7 +422,6 @@ Odoo Implementation
-
@@ -453,13 +434,10 @@ Licensing Consultancy
-
- -
-
@@ -489,7 +466,6 @@ sell your products

-
@@ -504,7 +480,6 @@ and convivial experience

-
@@ -518,7 +493,6 @@ educational management

-
@@ -532,7 +506,6 @@ schedule your operations

-
@@ -547,7 +520,6 @@ awe-inspiring product pages

-
@@ -561,7 +533,6 @@ services and invoice

-
@@ -575,7 +546,6 @@ restaurant methodically

-
@@ -592,7 +562,6 @@
- @@ -653,4 +622,4 @@
- \ No newline at end of file + diff --git a/separate_quotation_number_odoo/views/sale_order_views.xml b/separate_quotation_number_odoo/views/sale_order_views.xml index 8e685d751..7e6d11d52 100644 --- a/separate_quotation_number_odoo/views/sale_order_views.xml +++ b/separate_quotation_number_odoo/views/sale_order_views.xml @@ -1,7 +1,7 @@ - + sale.order.view.form.inherit.separate_quotation_number_odoo sale.order @@ -16,9 +16,8 @@ - - + sale.order.view.tree.inherit.separate_quotation_number_odoo sale.order