Skip to content

Commit

Permalink
[MIG]Migrated Code
Browse files Browse the repository at this point in the history
  • Loading branch information
murtuzasaleh committed Oct 15, 2018
1 parent 58d5fa2 commit c14f523
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 6 deletions.
3 changes: 2 additions & 1 deletion sale_validity/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When you create a new quotation, the *Expiration Date* will be set by default to

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/167/10.0
:target: https://runbot.odoo-community.org/runbot/167/11.0


Bug Tracker
Expand All @@ -39,6 +39,7 @@ Contributors

* Camptocamp
* Alexis de Lattre <[email protected]>
* Serpent Consulting Services Pvt. Ltd. <[email protected]>

Maintainer
----------
Expand Down
8 changes: 4 additions & 4 deletions sale_validity/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

{
'name': 'Default Quotation Validity',
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Set a default validity delay on quotations',
'depends': ['sale'],
'depends': ['sale_management'],
'author': 'Camptocamp,Odoo Community Association (OCA)',
'website': 'http://www.camptocamp.com',
'data': ['views/sale_config_settings.xml'],
'website': 'https://github.com/OCA/sale-workflow',
'data': ['views/res_config_settings.xml'],
'installable': True,
}
2 changes: 1 addition & 1 deletion sale_validity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

from . import company
from . import sale_config_settings
from . import res_config_settings
from . import sale_order
13 changes: 13 additions & 0 deletions sale_validity/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

default_sale_order_validity_days = fields.Integer(
related='company_id.default_sale_order_validity_days')
1 change: 1 addition & 0 deletions sale_validity/tests/test_sale_validity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_sale_validity(self):
company.default_sale_order_validity_days = 30
so_validity = self.create_so()
self.assertTrue(so_validity.validity_date)
so_validity._onchange_date_order()

def create_so(self):
vals = {
Expand Down
34 changes: 34 additions & 0 deletions sale_validity/views/res_config_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!--
© 2017 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>

<record id="res_config_settings_view_form_sale_order_validity" model="ir.ui.view">
<field name="name">default.sale.order.validity.sale.settings.form</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr='//div[hasclass("o_settings_container")][3]' position="inside">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label for="default_sale_order_validity_days"/>
<div class="text-muted mt4 mb4">
By default, the validity date of sale orders will be the date of the sale order plus the number of days defined in this field.
If the value of this field is 0, the sale orders will not have a validity date by default.
</div>
<div class="text-muted mt4 mb4">
<field name="default_sale_order_validity_days"/>
<label string="Days" style="margin-left: 5px;"/>
</div>
</div>
</div>
</xpath>
</field>
</record>

</odoo>

0 comments on commit c14f523

Please sign in to comment.