Skip to content

Commit

Permalink
[MOV] event,purchase: forgotten files in res_config_settings grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
rim-odoo committed Oct 11, 2017
1 parent 0be264b commit 9aa4695
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion addons/event/models/__init__.py
Expand Up @@ -3,5 +3,5 @@

from . import event
from . import event_mail
from . import event_config_settings
from . import res_config_settings
from . import res_partner
File renamed without changes.
1 change: 0 additions & 1 deletion addons/purchase/models/__init__.py
Expand Up @@ -7,4 +7,3 @@
from . import res_config_settings
from . import res_partner
from . import stock
from . import stock_config_settings
16 changes: 13 additions & 3 deletions addons/purchase/models/res_config_settings.py
Expand Up @@ -29,18 +29,28 @@ class ResConfigSettings(models.TransientModel):
is_installed_sale = fields.Boolean()
group_analytic_account_for_purchases = fields.Boolean('Analytic accounting for purchases',
implied_group='purchase.group_analytic_accounting')
po_lead = fields.Float(related='company_id.po_lead')
use_po_lead = fields.Boolean(
string="Security Lead Time for Purchase",
oldname='default_new_po_lead',
help="Margin of error for vendor lead times. When the system generates Purchase Orders for reordering products,they will be scheduled that many days earlier to cope with unexpected vendor delays.")

@api.onchange('use_po_lead')
def _onchange_use_po_lead(self):
if not self.use_po_lead:
self.po_lead = 0.0

@api.multi
def get_values(self):
res = super(ResConfigSettings, self).get_values()
res.update(
is_installed_sale=self.env['ir.module.module'].search([('name', '=', 'sale'), ('state', '=', 'installed')]).id
is_installed_sale=self.env['ir.module.module'].search([('name', '=', 'sale'), ('state', '=', 'installed')]).id,
use_po_lead=self.env['ir.config_parameter'].sudo().get_param('purchase.use_po_lead')
)
return res

def set_values(self):
super(ResConfigSettings, self).set_values()
self.po_lock = 'lock' if self.lock_confirmed_po else 'edit'
self.po_double_validation = 'two_step' if self.po_order_approval else 'one_step'


self.env['ir.config_parameter'].sudo().set_param('purchase.use_po_lead', self.use_po_lead)
30 changes: 0 additions & 30 deletions addons/purchase/models/stock_config_settings.py

This file was deleted.

0 comments on commit 9aa4695

Please sign in to comment.