From 539a790bfcc867518903bfe68b3839cef941e7f7 Mon Sep 17 00:00:00 2001 From: "KSA (OpenERP)" <> Date: Mon, 12 Jul 2010 10:47:33 +0530 Subject: [PATCH 1/9] [FIX] warning: put purchase module in dependency list in warning module bzr revid: hmo@tinyerp.com-20100712051733-gt575yliv64a321h --- addons/warning/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/warning/__openerp__.py b/addons/warning/__openerp__.py index 13db9c5da80..ccbd2db9772 100644 --- a/addons/warning/__openerp__.py +++ b/addons/warning/__openerp__.py @@ -26,7 +26,7 @@ 'category': 'Tools', 'description': """Module for Warnings form onchange Event.""", 'author': 'Tiny', - 'depends': ['base', 'sale'], + 'depends': ['base', 'sale', 'purchase'], 'update_xml': ['warning_view.xml'], 'demo_xml': [], 'installable': True, From cb796f35fa3672b519c082f923867b3cde84e849 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 12 Jul 2010 11:22:46 +0530 Subject: [PATCH 2/9] [IMP]:sale:improved sale order report. bzr revid: apa@tinyerp.com-20100712055246-emuzd6ls6ktgimwd --- addons/sale/report/order.rml | 41 ++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index 1b1256cee19..5f535a05371 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -68,6 +68,7 @@ + @@ -91,14 +92,14 @@ - - + + - - - - + + + + @@ -108,8 +109,8 @@ - - + + @@ -123,10 +124,10 @@ - + + - [[repeatIn(objects,'o')]] [[ setLang(o.partner_id.lang) ]] @@ -217,7 +218,7 @@ - + Description @@ -226,7 +227,7 @@ VAT - Quantity + Quantity Unit Price @@ -235,13 +236,13 @@ Disc.(%) - Price + Price
[[repeatIn(o.order_line,'line')]] - + [[ line.name ]] @@ -264,6 +265,9 @@ [[ formatLang(line.price_subtotal ) ]] + + [[ o.pricelist_id.currency_id.name ]] + @@ -299,10 +303,15 @@ + + + + +
- + @@ -371,4 +380,4 @@
- \ No newline at end of file + From 81af9372075fe709788080fe6f356ba4a96118a6 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 12 Jul 2010 12:00:24 +0530 Subject: [PATCH 3/9] [IMP]:purchase:improved purchase order report. bzr revid: apa@tinyerp.com-20100712063024-ue0xnz83hvdhtavc --- addons/purchase/report/order.rml | 64 ++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index cd3e0dfb8fa..51dc6941f3f 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -72,6 +72,7 @@ + @@ -79,6 +80,7 @@ +
@@ -98,18 +100,16 @@ - - - - + + - - - - - - - + + + + + + + @@ -132,8 +132,8 @@ + - [[repeatIn(objects,'o')]] [[ setLang(o.partner_id.lang) ]] @@ -155,13 +155,13 @@ [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] Shipping address : - [[ o.partner_id.name ]] [[ o.partner_id.title or '' ]] - [[ addr.title or '' ]] [[ addr.name ]] - [[ addr.street ]] - [[ addr.street2 or '' ]] - [[ addr.zip or '' ]] [[ addr.city or '' ]] - [[ addr.state_id and addr.state_id.name or '' ]] - [[ addr.country_id and addr.country_id.name or '' ]] + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ addr.title or '' ]] [[ addr.name ]] + [[ addr.street ]] + [[ addr.street2 or '' ]] + [[ addr.zip or '' ]] [[ addr.city or '' ]] + [[ addr.state_id and addr.state_id.name or '' ]] + [[ addr.country_id and addr.country_id.name or '' ]] @@ -175,19 +175,19 @@ - [[ o.partner_id.name ]] [[ o.partner_id.title or '' ]] + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] [[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]] [[ o.partner_address_id.street ]] [[ o.partner_address_id.street2 or '' ]] [[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]] [[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]] [[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]] - + - Tél. : [[ o.partner_address_id.phone or '' ]] - Fax : [[ o.partner_address_id.fax or '' ]] - TVA : [[ o.partner_id.vat or '' ]] + Tél. : [[ o.partner_address_id.phone or '' ]] + Fax : [[ o.partner_address_id.fax or '' ]] + TVA : [[ o.partner_id.vat or '' ]] @@ -240,7 +240,7 @@ - + Description @@ -258,13 +258,13 @@ Unit Price - Net Price + Net Price
[[repeatIn(o.order_line,'line')]] - + [[ line.name ]] @@ -287,6 +287,9 @@ [[ formatLang(line.price_subtotal ) ]] + + [[ o.pricelist_id.currency_id.name ]] + @@ -322,10 +325,15 @@ + + + + +
- + From 8efc31e57dd9032174278fb1e081533da1899c22 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Mon, 12 Jul 2010 12:09:51 +0530 Subject: [PATCH 4/9] [wiki] some improvement bzr revid: hmo@tinyerp.com-20100712063951-2jxybuidx49jw7o4 --- addons/wiki/security/ir.model.access.csv | 1 - addons/wiki/test/wiki_test00.yml | 25 +++-- addons/wiki/wiki.py | 94 +++++++++++-------- addons/wiki/wiki_view.xml | 13 ++- addons/wiki/wizard/wiki_create_menu.py | 66 ++++++++----- addons/wiki/wizard/wiki_create_menu_view.xml | 1 - addons/wiki/wizard/wiki_show_diff.py | 13 ++- addons/wiki/wizard/wiki_show_diff_view.xml | 4 +- .../wiki/wizard/wiki_wiki_page_open_view.xml | 7 -- 9 files changed, 136 insertions(+), 88 deletions(-) diff --git a/addons/wiki/security/ir.model.access.csv b/addons/wiki/security/ir.model.access.csv index 67c7bf7b4c3..a54122e0231 100644 --- a/addons/wiki/security/ir.model.access.csv +++ b/addons/wiki/security/ir.model.access.csv @@ -3,5 +3,4 @@ "wiki_groups_all","wiki.groups","model_wiki_groups",,1,0,0,0 "wiki_wiki","wiki.wiki","model_wiki_wiki","base.group_user",1,1,1,1 "wiki_groups","wiki.groups","model_wiki_groups","base.group_system",1,1,1,1 -"wiki_groups_link","wiki.groups.link","model_wiki_groups_link","base.group_system",1,1,1,1 "wiki_wiki_history","wiki.wiki.history","model_wiki_wiki_history","base.group_user",1,0,1,0 diff --git a/addons/wiki/test/wiki_test00.yml b/addons/wiki/test/wiki_test00.yml index e53871ed277..c77e714b961 100755 --- a/addons/wiki/test/wiki_test00.yml +++ b/addons/wiki/test/wiki_test00.yml @@ -21,16 +21,24 @@ FAQs, quality manuals, technical references, etc. ' - +- + Creating a wiki make index record +- + !record {model: wiki.make.index, id: wiki_make_index_1}: + {} - I create Index on this current page by clicking on "Create Index" wizard - !python {model: wiki.make.index}: | - ids = self.search(cr, uid, []) - self.wiki_do_index(cr, uid, ids , {'active_ids': [ref('wiki_wiki_openerpwikiediting0')]}) + self.wiki_do_index(cr, uid, [ref("wiki_make_index_1")], {"active_model": + wiki.wiki, "active_ids": [ref("wiki_wiki_openerpwikiediting0")], "tz": False, "active_id": + ref("wiki_wiki_openerpwikiediting0"), }) - - # Remaining Act window I check the page history for the current page by clicking on "Page History".After that find difference between history. +- + !python {model: wizard.wiki.history.show_diff}: | + ids = self.search(cr, uid, []) + self.get_diff(cr, uid, {'active_id': [ref('wiki_wiki_openerpwikiediting0')]}) - I create a new wiki group on the Given Home Page - @@ -38,13 +46,11 @@ name: Wiki Group Editing home: wiki.wiki_wiki_quickstart0 - - I open a wiki page on this given group and page by clicking on Open wiki Page wizard. + I Open the page for click on "Open Wiki Page" button. - - !python {model: wiki.wiki.page.open}: | - ids = self.search(cr, uid, []) - self.open_wiki_page(cr, uid, ids, {'active_ids': [ref('wiki_groups_wikigroupediting0')]}) + !python {model: wiki.groups}: | + self.open_wiki_page(cr, uid, [ref("wiki_groups_wikigroupediting0")], context) - - # Remaining beacuse of Act window (I search the page by clicking on the "search page".) In order to create a menu I will create wizard data - !record {model: wiki.groups, id: wiki.wiki_groups_wikiformatting0}: @@ -55,7 +61,6 @@ !record {model: wiki.create.menu, id: wiki_create_menu_0}: menu_name: Wiki Test menu menu_parent_id: base.menu_base_partner - page: wiki.wiki_wiki_openerpwikiediting0 - I fill in the form and create the menu - diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 3fe9d25fcc5..1f85f04afd2 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -1,31 +1,25 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2006 TINY SPRL. (http://axelor.com) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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. # -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 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 from tools.translate import _ import difflib @@ -53,30 +47,56 @@ class WikiGroup(osv.osv): 'method':fields.selection([('list', 'List'), ('page', 'Home Page'), \ ('tree', 'Tree')], 'Display Method'), 'home':fields.many2one('wiki.wiki', 'Home Page'), + 'menu_id': fields.many2one('ir.ui.menu', "Menu", readonly=True), } _defaults = { 'method': lambda *a: 'page', } + def open_wiki_page(self, cr, uid, ids, context): + + """ Opens Wiki Page of Group + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of open wiki group’s IDs + @return: dictionay of open wiki window on give group id + """ + if not context: + context = {} + if type(ids) in (int,long,): + ids = [ids] + group_id = False + if ids: + group_id = ids[0] + if not group_id: + return {} + value = { + 'name': 'Wiki Page', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'wiki.wiki', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'nodestroy': True, + } + group = self.browse(cr, uid, group_id, context=context) + value['domain'] = "[('group_id','=',%d)]" % (group.id) + if group.method == 'page': + value['res_id'] = group.home.id + elif group.method == 'list': + value['view_type'] = 'form' + value['view_mode'] = 'tree,form' + elif group.method == 'tree': + view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'wiki.wiki.tree.childs')]) + value['view_id'] = view_id + value['domain'] = [('group_id', '=', group.id), ('parent_id', '=', False)] + value['view_type'] = 'tree' + + return value WikiGroup() -class GroupLink(osv.osv): - """ Apply Group Link """ - - _name = "wiki.groups.link" - _description = "Wiki Groups Links" - _rec_name = 'action_id' - - _columns = { - 'group_id': fields.many2one('wiki.groups', 'Parent Group', ondelete='set null'), - 'action_id': fields.many2one('ir.ui.menu', 'Menu') - } - -GroupLink() - - class Wiki2(osv.osv): """ Wiki Page """ @@ -96,11 +116,11 @@ class Wiki2(osv.osv): 'minor_edit': fields.boolean('Minor edit', select=True), 'summary': fields.char('Summary', size=256), 'section': fields.char('Section', size=32, help="Use page section code like 1.2.1", select=True), - 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null', + 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null', help="Topic, also called Wiki Group"), - 'toc': fields.boolean('Table of Contents', + 'toc': fields.boolean('Table of Contents', help="Indicates that this pages is a table of contents (linking to other pages)"), - 'review': fields.boolean('Needs Review', select=True, + 'review': fields.boolean('Needs Review', select=True, help="Indicates that this page should be reviewed, raising the attention of other contributors"), 'parent_id': fields.many2one('wiki.wiki', 'Parent Page'), 'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'), diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 5a0a3d557bf..6e6d608855a 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -48,11 +48,18 @@ +