From 4e0bc0926d677b278d807781977a9c5f3f38a550 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 08:29:32 +0100 Subject: [PATCH 01/12] [FIX] lp 703649 bzr revid: fp@tinyerp.com-20110117072932-4y3jmdgo2s9ushj6 --- bin/addons/base/res/res_company.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/addons/base/res/res_company.py b/bin/addons/base/res/res_company.py index 8cafa28ccff..ba4c0fabc83 100644 --- a/bin/addons/base/res/res_company.py +++ b/bin/addons/base/res/res_company.py @@ -81,9 +81,9 @@ class res_company(osv.osv): 'rml_header1': fields.char('Report Header', size=200), 'rml_footer1': fields.char('Report Footer 1', size=200), 'rml_footer2': fields.char('Report Footer 2', size=200), - 'rml_header' : fields.text('RML Header'), - 'rml_header2' : fields.text('RML Internal Header'), - 'rml_header3' : fields.text('RML Internal Header'), + 'rml_header' : fields.text('RML Header', required=True), + 'rml_header2' : fields.text('RML Internal Header', required=True), + 'rml_header3' : fields.text('RML Internal Header', required=True), 'logo' : fields.binary('Logo'), 'currency_id': fields.many2one('res.currency', 'Currency', required=True), 'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency'), From 948e9172ceab78d39594091071eed6be830f16bf Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 08:35:11 +0100 Subject: [PATCH 02/12] [FIX] lp 703088 bzr revid: fp@tinyerp.com-20110117073511-94kur7vzlhyfq9zt --- addons/crm/crm_meeting.py | 2 +- addons/purchase/wizard/purchase_line_invoice.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index cbc12cec248..2c4edc02df7 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -146,7 +146,7 @@ class res_users(osv.osv): 'user_id': user_id}, context=context) except: # Tolerate a missing shortcut. See product/product.py for similar code. - logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name',' Date: Mon, 17 Jan 2011 08:41:14 +0100 Subject: [PATCH 03/12] fix bzr revid: fp@tinyerp.com-20110117074114-48gyv2q01kx7for5 --- addons/project/project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index b2dedfd2e36..eb09586ba2c 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -126,7 +126,8 @@ class project(osv.osv): 'priority': fields.integer('Sequence', help="Gives the sequence order when displaying the list of projects"), 'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), - 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose, but a user has to be member of a project to add a the to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), + 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', + help="Project's members are users who can have an access to the tasks related to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'tasks': fields.one2many('project.task', 'project_id', "Project tasks"), 'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.", store = { From a25ec4025bc6dcfa78621787cc288336c7acc6ca Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 08:45:34 +0100 Subject: [PATCH 04/12] [FIX] lp 701067 from Xavier Alt bzr revid: fp@tinyerp.com-20110117074534-hwg1hwb0znv0dkaj --- addons/mail_gateway/mail_gateway.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index ed5489fda79..15c5bba7c64 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -25,6 +25,7 @@ import tools import binascii import email from email.header import decode_header +from email.utils import parsedate import base64 import re from tools.translate import _ @@ -111,6 +112,11 @@ class mailgate_thread(osv.osv): if attach is None: attach = [] + if email_date: + edate = parsedate(email_date) + if edate is not None: + email_date = time.strftime('%Y-%m-%d %H:%M:%S', edate) + # The mailgate sends the ids of the cases and not the object list if all(isinstance(case_id, (int, long)) for case_id in cases): From 77ca6ae2b023e561cad1fe45322fca6bc5510b18 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 08:55:59 +0100 Subject: [PATCH 05/12] [IMP] Add incoterm menu bzr revid: fp@tinyerp.com-20110117075559-ivjti3ke5wcx1on8 --- addons/stock/stock_view.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 4c7c6e56442..80e63ebef23 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1779,6 +1779,8 @@ tree,form + + Date: Mon, 17 Jan 2011 08:58:57 +0100 Subject: [PATCH 06/12] [IMP] add two incoterms from Alexis Delattre bzr revid: fp@tinyerp.com-20110117075857-gaulvotztcdbz753 --- addons/stock/stock_incoterms.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/stock/stock_incoterms.xml b/addons/stock/stock_incoterms.xml index 371b61055ba..fb9082161ba 100644 --- a/addons/stock/stock_incoterms.xml +++ b/addons/stock/stock_incoterms.xml @@ -49,5 +49,14 @@ DDU DELIVERED DUTY UNPAID + + DAT + Delivered At Terminal + + + DAP + Delivered At Place + + From a51ab821604a79dea61b1d8c06305d4f73fa7fe3 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 09:05:56 +0100 Subject: [PATCH 07/12] [fIX] lp 701480 bzr revid: fp@tinyerp.com-20110117080556-3i3d4z4gdktpmvpd --- addons/purchase/purchase.py | 4 ++-- addons/sale/sale.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index b0e8b9a6c62..d2c0c0238e4 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -363,7 +363,7 @@ class purchase_order(osv.osv): _('There is no purchase journal defined for this company: "%s" (id:%d)') % (o.company_id.name, o.company_id.id)) inv = { 'name': o.partner_ref or o.name, - 'reference': "P%dPO%d" % (o.partner_id.id, o.id), + 'reference': o.partner_ref or o.name, 'account_id': a, 'type': 'in_invoice', 'partner_id': o.partner_id.id, @@ -440,7 +440,7 @@ class purchase_order(osv.osv): if order_line.product_id.product_tmpl_id.type in ('product', 'consu'): dest = order.location_id.id move = self.pool.get('stock.move').create(cr, uid, { - 'name': 'PO:'+order_line.name, + 'name': order.name + ': ' +(order_line.name or ''), 'product_id': order_line.product_id.id, 'product_qty': order_line.product_qty, 'product_uos_qty': order_line.product_qty, diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 3ed49f44b74..cd9ae88292e 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -403,7 +403,7 @@ class sale_order(osv.osv): 'name': order.client_order_ref or '', 'origin': order.name, 'type': 'out_invoice', - 'reference': "P%dSO%d" % (order.partner_id.id, order.id), + 'reference': order.client_order_ref or order.name, 'account_id': a, 'partner_id': order.partner_id.id, 'journal_id': journal_ids[0], From 9d9719a6678f2e1fdee2f1571301bddbfb4affbb Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 09:15:42 +0100 Subject: [PATCH 08/12] [FIX] lp 696779 bzr revid: fp@tinyerp.com-20110117081542-qdk42pa95vctkqd0 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index ee21ce83a75..31a30d233cf 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -272,7 +272,7 @@ class stock_location(osv.osv): context['compute_child'] = False if not product_ids: - product_ids = product_obj.search(cr, uid, []) + product_ids = product_obj.search(cr, uid, [], context={'active_test': False}) products = product_obj.browse(cr, uid, product_ids, context=context) products_by_uom = {} From 4594829c2040719649d57739a2a6f3ffe5cb9064 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 09:28:47 +0100 Subject: [PATCH 09/12] [FIX] improvement in POS lp 702115 bzr revid: fp@tinyerp.com-20110117082847-n9evkxy2h8ceawiy --- addons/point_of_sale/point_of_sale.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index f359b8208d7..bdff54cd147 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -299,8 +299,11 @@ class pos_order(osv.osv): @param name: Names of fields. @return: pricelist ID """ - pricelist = self.pool.get('product.pricelist').search(cr, uid, [('name', '=', 'Public Pricelist')], context=context) - return pricelist and pricelist[0] or False + res = self.pool.get('sale.shop').search(cr, uid, [], context=context) + if res: + shop = self.pool.get('sale.shop').browse(cr, uid, res[0], context=context) + return shop.pricelist_id and shop.pricelist_id.id or False + return False def _journal_default(self, cr, uid, context=None): """ To get default pricelist for the order @@ -1246,4 +1249,4 @@ class stock_picking(osv.osv): stock_picking() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 7c95acb04ce4cdad92fc045ef54e0c06b8921537 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 17 Jan 2011 09:31:22 +0100 Subject: [PATCH 10/12] [FIX] lp 701017 bzr revid: fp@tinyerp.com-20110117083122-aed5jqigyt1vq677 --- addons/mrp/product.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/mrp/product.py b/addons/mrp/product.py index bb9bc27625f..7301527f68e 100644 --- a/addons/mrp/product.py +++ b/addons/mrp/product.py @@ -90,4 +90,13 @@ class product_product(osv.osv): for bom in bom_obj.browse(cr, uid, bom_ids, context=context): _compute_price(bom) + def copy(self, cr, uid, id, default=None, context=None): + if not default: + default = {} + default.update({ + 'bom_ids': [] + }) + return super(product_product, self).copy(cr, uid, id, default, context=context) + + product_product() From 814c4af299192cb34ae6aec81aad8fc963ba8d44 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Mon, 17 Jan 2011 10:47:50 +0100 Subject: [PATCH 11/12] [FIX] osv: _constraints can be inherited by redefining a constraint with the same name Indeed, when we define an expression like class bar(osv.osv): _inherit = 'bar.bar' def _check_foo(self, cr, uid, ids, context): return True _constraints = [ (_check_foo, "Foo failed!", ['foo']) ] ... it means that _check_foo will be passed as an *object* to the model's structure of _constraints. Therefore, it would be unequal and just append the list of any existing constraints. So, an older (_check_foo, , ['foo']) would always remain active using the previous code. This has to do with the _check_foo being an unbound (ie. not inheritable) function. Now, we check the /string name/ of the function, too. We say that if the inherited class's constraint function has the same name "_check_foo", the old ones shall be replaced. Note: this MAY introduce unpredictable results, if several modules try to override the same inherited constraint. There is no guaranteed order of inheritance. Please avoid using this feature unless necessary. lp bug: https://launchpad.net/bugs/700451 fixed bzr revid: odo@openerp.com-20110117094750-4lyzx165f1z1zgl4 --- bin/osv/osv.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/osv/osv.py b/bin/osv/osv.py index 5a798e7dcaf..138e8c8daab 100644 --- a/bin/osv/osv.py +++ b/bin/osv/osv.py @@ -340,7 +340,12 @@ class osv(osv_base, orm.orm): exist = False for c2 in range(len(new)): #For _constraints, we should check field and methods as well - if new[c2][2]==c[2] and new[c2][0]==c[0]: + if new[c2][2]==c[2] and (new[c2][0] == c[0] \ + or getattr(new[c2][0],'__name__', True) == \ + getattr(c[0],'__name__', False)): + # If new class defines a constraint with + # same function name, we let it override + # the old one. new[c2] = c exist = True break From 5b2e2371ca3b72c451d8d7aeb441147d768c616d Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 17 Jan 2011 11:04:48 +0100 Subject: [PATCH 12/12] [FIX] res.partner: reverted incorrect patch for Addresses action, until a proper fix is done Reverted revision: 3152.1.1 fde@openerp.com-20101222154236-vpuqk0ou0svugwkg lp bug: https://launchpad.net/bugs/703226 fixed bzr revid: odo@openerp.com-20110117100448-eba1mhz3gt45mu69 --- bin/addons/base/res/partner/partner_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index 8c949a7f410..cf1d36cbaec 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -108,7 +108,7 @@ ir.actions.act_window res.partner.address form - {"search_default_customer":1,"search_default_partner_id":self} + {"search_default_customer":1} Customers (also called Partners in other areas of the system) helps you manage your address book of companies whether they are prospects, customers and/or suppliers. The partner form allows you to track and record all the necessary information to interact with your partners from the company address to their contacts as well as pricelists, and much more. If you installed the CRM, with the history tab, you can track all the interactions with a partner such as opportunities, emails, or sales orders issued.