Browse Source

Jul 25 : [UPDT] Updated 'separate_quotation_number_odoo'

pull/267/head
AjmalCybro 2 years ago
parent
commit
862958d1ba
  1. 11
      separate_quotation_number_odoo/__manifest__.py
  2. 4
      separate_quotation_number_odoo/doc/RELEASE_NOTES.md
  3. 31
      separate_quotation_number_odoo/models/sale_order.py
  4. 37
      separate_quotation_number_odoo/static/description/index.html
  5. 5
      separate_quotation_number_odoo/views/sale_order_views.xml

11
separate_quotation_number_odoo/__manifest__.py

@ -22,16 +22,15 @@
{ {
'name': 'Separate Quotation Number', 'name': 'Separate Quotation Number',
'version': '16.0.1.0.0', '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', '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', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com', 'website': 'https://www.cybrosys.com',
'license': 'LGPL-3', 'images': ['static/description/banner.png'],
'depends': [ 'depends': [
'base', 'base',
'sale_management', 'sale_management',
@ -41,7 +40,7 @@
'data/ir_sequence_data.xml', 'data/ir_sequence_data.xml',
'views/sale_order_views.xml' 'views/sale_order_views.xml'
], ],
'images': ['static/description/banner.png'], 'license': 'LGPL-3',
'installable': True, 'installable': True,
'application': False, 'application': False,
'auto_install': False, 'auto_install': False,

4
separate_quotation_number_odoo/doc/RELEASE_NOTES.md

@ -5,3 +5,7 @@
#### ADD #### ADD
- Initial commit for separate_quotation_number_odoo - Initial commit for separate_quotation_number_odoo
#### 24.07.2023
#### Version 16.0.1.0.1
#### FIX
- Fixed the @api.model decorator issue

31
separate_quotation_number_odoo/models/sale_order.py

@ -23,17 +23,34 @@ from odoo import models, fields, api
class SaleOrder(models.Model): 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' _inherit = 'sale.order'
quotation_ref = fields.Char(string='Quotation Reference', 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): 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) res = super(SaleOrder, self).create(vals)
seq_val = self.env.ref( for vals in res:
'separate_quotation_number_odoo.seq_quotation').id seq_val = self.env.ref(
res.quotation_ref = self.env['ir.sequence'].browse( 'separate_quotation_number_odoo.seq_quotation').id
seq_val).next_by_id() vals.quotation_ref = self.env['ir.sequence'].browse(
seq_val).next_by_id()
return res return res

37
separate_quotation_number_odoo/static/description/index.html

@ -38,10 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- NAVIGATION SECTION --> <!-- NAVIGATION SECTION -->
<div class="d-flex align-items-center" <div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;"> style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
@ -169,7 +166,6 @@
<span <span
style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Sequence number will show in state quotation send also.</span> style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Sequence number will show in state quotation send also.</span>
</div> </div>
</div> </div>
</div> </div>
<!-- END OF FEATURES SECTION --> <!-- END OF FEATURES SECTION -->
@ -197,20 +193,17 @@
</h3> </h3>
<img src="assets/screenshots/screenshot_1.png" <img src="assets/screenshots/screenshot_1.png"
class="img-thumbnail"> class="img-thumbnail">
</div> </div>
<div style="display: block; margin: 30px auto;"> <div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Quotation sequence will active at the state draft and send Quotation sequence will active at the state draft and send
quotation. </h3> quotation. </h3>
<img src="assets/screenshots/screenshot_2.png" <img src="assets/screenshots/screenshot_2.png"
class="img-thumbnail"> class="img-thumbnail">
</div> </div>
<div style="display: block; margin: 30px auto;"> <div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Quotation number will display in the tree view. Quotation number will display in the tree view.
</h3> </h3>
<img src="assets/screenshots/screenshot_3.png" <img src="assets/screenshots/screenshot_3.png"
class="img-thumbnail"> class="img-thumbnail">
@ -327,7 +320,6 @@
<!-- END OF RELATED PRODUCTS --> <!-- END OF RELATED PRODUCTS -->
<!-- OUR SERVICES --> <!-- OUR SERVICES -->
<div class="d-flex align-items-center" <div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" <div class="d-flex justify-content-center align-items-center mr-2"
@ -339,7 +331,6 @@
Our Services Our Services
</h2> </h2>
</div> </div>
<div class="container my-5"> <div class="container my-5">
<div class="row"> <div class="row">
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
@ -353,7 +344,6 @@
Odoo Odoo
Customization</h6> Customization</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -365,7 +355,6 @@
Odoo Odoo
Implementation</h6> Implementation</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -377,8 +366,6 @@
Odoo Odoo
Support</h6> Support</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -391,7 +378,6 @@
Odoo Odoo
Developer</h6> Developer</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -403,7 +389,6 @@
Odoo Odoo
Integration</h6> Integration</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -415,8 +400,6 @@
Odoo Odoo
Migration</h6> Migration</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -428,7 +411,6 @@
Odoo Odoo
Consultancy</h6> Consultancy</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -440,7 +422,6 @@
Odoo Odoo
Implementation</h6> Implementation</h6>
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" <div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;"> style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
@ -453,13 +434,10 @@
Licensing Consultancy</h6> Licensing Consultancy</h6>
</div> </div>
</div> </div>
</div> </div>
<!-- END OF END OF OUR SERVICES --> <!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES --> <!-- OUR INDUSTRIES -->
<div class="d-flex align-items-center" <div class="d-flex align-items-center"
style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" <div class="d-flex justify-content-center align-items-center mr-2"
@ -472,7 +450,6 @@
Industries Industries
</h2> </h2>
</div> </div>
<div class="container my-5"> <div class="container my-5">
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
@ -489,7 +466,6 @@
sell your products</p> sell your products</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -504,7 +480,6 @@
and convivial experience</p> and convivial experience</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -518,7 +493,6 @@
educational management</p> educational management</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -532,7 +506,6 @@
schedule your operations</p> schedule your operations</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -547,7 +520,6 @@
awe-inspiring product pages</p> awe-inspiring product pages</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -561,7 +533,6 @@
services and invoice</p> services and invoice</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -575,7 +546,6 @@
restaurant methodically</p> restaurant methodically</p>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" <div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;"> style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
@ -592,7 +562,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- END OF END OF OUR INDUSTRIES --> <!-- END OF END OF OUR INDUSTRIES -->
<!-- SUPPORT --> <!-- SUPPORT -->
@ -653,4 +622,4 @@
</div> </div>
</div> </div>
</div> </div>
<!-- END OF SUPPORT --> <!-- END OF SUPPORT -->

5
separate_quotation_number_odoo/views/sale_order_views.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<!-- Quotation sequence field in fom view --> <!-- Quotation sequence field in fom view -->
<record id="sale_order_view_form_inherit" model="ir.ui.view"> <record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.view.form.inherit.separate_quotation_number_odoo</field> <field name="name">sale.order.view.form.inherit.separate_quotation_number_odoo</field>
<field name="model">sale.order</field> <field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/> <field name="inherit_id" ref="sale.view_order_form"/>
@ -16,9 +16,8 @@
</xpath> </xpath>
</field> </field>
</record> </record>
<!-- Quotation sequence field in tree view --> <!-- Quotation sequence field in tree view -->
<record id="sale_order_view_tree_inherit" model="ir.ui.view"> <record id="view_quotation_tree" model="ir.ui.view">
<field name="name">sale.order.view.tree.inherit.separate_quotation_number_odoo</field> <field name="name">sale.order.view.tree.inherit.separate_quotation_number_odoo</field>
<field name="model">sale.order</field> <field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/> <field name="inherit_id" ref="sale.view_quotation_tree"/>

Loading…
Cancel
Save