new module
This commit is contained in:
parent
db8fc59689
commit
efe612789a
5 changed files with 47 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from odoo import api, fields, models, Command
|
||||
|
||||
|
||||
class Partner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
|
|
|
|||
1
bemade_update_validity_date_when_send_so/__init__.py
Normal file
1
bemade_update_validity_date_when_send_so/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
||||
20
bemade_update_validity_date_when_send_so/__manifest__.py
Normal file
20
bemade_update_validity_date_when_send_so/__manifest__.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
"name": "Update sale quotation date when sent",
|
||||
"version": "15.0.0.0.1",
|
||||
"category": "Extra Tools",
|
||||
'summary': 'Update sale quotation date and validity when pressing send button',
|
||||
"description": """
|
||||
Update sale quotation date and validity when pressing send button
|
||||
""",
|
||||
"author": "Bemade",
|
||||
'website': 'https://www.bemade.org',
|
||||
"depends": [
|
||||
'sale_management'
|
||||
],
|
||||
"data": [
|
||||
],
|
||||
"auto_install": False,
|
||||
"installable": True,
|
||||
'license': 'OPL-1'
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
from . import sale_order
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from itertools import groupby
|
||||
import json
|
||||
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import AccessError, UserError, ValidationError
|
||||
from odoo.osv import expression
|
||||
from odoo.tools import float_is_zero, html_keep_url, is_html_empty
|
||||
|
||||
from odoo.addons.payment import utils as payment_utils
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
def action_quotation_send(self):
|
||||
self.ensure_one()
|
||||
self.date_order = datetime.now()
|
||||
self.validity_date = datetime.now() + timedelta(days=30)
|
||||
super(SaleOrder, self).action_quotation_send()
|
||||
|
||||
Loading…
Reference in a new issue