new module

This commit is contained in:
Benoît Vézina 2023-11-01 15:16:27 -04:00
parent db8fc59689
commit efe612789a
5 changed files with 47 additions and 0 deletions

View file

@ -1,5 +1,6 @@
from odoo import api, fields, models, Command
class Partner(models.Model):
_inherit = 'res.partner'

View file

@ -0,0 +1 @@
from . import models

View 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'
}

View file

@ -0,0 +1 @@
from . import sale_order

View file

@ -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()