From c6eae9c717bf0560e33cb81d5becd4f4a193ce04 Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Tue, 15 Jun 2010 14:41:14 +0200 Subject: [PATCH] [IMP] claim bzr revid: nel@tinyerp.com-20100615124114-b3l2s343ueiz883e --- addons/claim_from_delivery/__init__.py | 2 +- addons/claim_from_delivery/claim_delivery.py | 29 +++++++++++++++++++ .../claim_delivery_view.xml | 24 +++++++++++++-- addons/crm_claim/crm_claim.py | 3 +- addons/product_expiry/product_expiry.py | 1 + addons/product_expiry/wizard/stock_partial.py | 8 +++++ .../wizard/stock_partial_view.xml | 3 ++ 7 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 addons/claim_from_delivery/claim_delivery.py diff --git a/addons/claim_from_delivery/__init__.py b/addons/claim_from_delivery/__init__.py index 6f95fbf0fbc..b10828031a8 100644 --- a/addons/claim_from_delivery/__init__.py +++ b/addons/claim_from_delivery/__init__.py @@ -17,6 +17,6 @@ # along with this program. If not, see . # ############################################################################## - +import claim_delivery # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/claim_from_delivery/claim_delivery.py b/addons/claim_from_delivery/claim_delivery.py new file mode 100644 index 00000000000..4e81a0a3067 --- /dev/null +++ b/addons/claim_from_delivery/claim_delivery.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv + +class stock_picking(osv.osv): + _inherit = "stock.picking" + _columns = { + 'partner_id': fields.related('address_id','partner_id',type='many2one', relation="res.partner", string="Partner"), + } +stock_picking() diff --git a/addons/claim_from_delivery/claim_delivery_view.xml b/addons/claim_from_delivery/claim_delivery_view.xml index a1c8be870e2..7fb68cc6348 100644 --- a/addons/claim_from_delivery/claim_delivery_view.xml +++ b/addons/claim_from_delivery/claim_delivery_view.xml @@ -1,12 +1,32 @@ - + + + stock.picking.delivery.form20 + stock.picking + form + + + + + + + + + + + + + {'default_partner_address_id': address_id, 'default_partner_id': partner_id} + + diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index d9a7a2b34c0..e8a14df42a8 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -74,7 +74,8 @@ class crm_claim(osv.osv, crm.crm_case): 'company_id': fields.many2one('res.company', 'Company'), 'partner_id': fields.many2one('res.partner', 'Partner'), 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \ - domain="[('partner_id','=',partner_id)]"), + # domain="[('partner_id','=',partner_id)]" + ), 'email_cc': fields.text('Watchers Emails', size=252, help="These people will receive a copy of the future communication between partner and users by email"), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'partner_name': fields.char("Employee's Name", size=64), diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py index fdc63d28afe..fd22ecff8b6 100644 --- a/addons/product_expiry/product_expiry.py +++ b/addons/product_expiry/product_expiry.py @@ -21,6 +21,7 @@ import datetime from osv import fields, osv import pooler +import time class stock_production_lot(osv.osv): _name = 'stock.production.lot' diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py index bc44628078c..e893b36c3cf 100644 --- a/addons/product_expiry/wizard/stock_partial.py +++ b/addons/product_expiry/wizard/stock_partial.py @@ -68,5 +68,13 @@ class stock_move_split_lines_exist(osv.osv_memory): _columns = { 'date': fields.date('Date'), } + def on_change_product(self, cr, uid, ids, product_id): + if not product_id: + return {'value':{'date': False}} + day_life = self.pool.get('product.product').browse(cr, uid, product_id).life_time + date_life = (datetime.datetime.now() + datetime.timedelta(days=day_life)) + return {'value':{'date': date_life.strftime('%Y-%m-%d') +}} + stock_move_split_lines_exist() diff --git a/addons/product_expiry/wizard/stock_partial_view.xml b/addons/product_expiry/wizard/stock_partial_view.xml index fabc531cf14..ca3554ea900 100644 --- a/addons/product_expiry/wizard/stock_partial_view.xml +++ b/addons/product_expiry/wizard/stock_partial_view.xml @@ -9,6 +9,9 @@ + + +