bzr revid: pso@tinyerp.com-20081226115025-npblp1a580od5ddw
This commit is contained in:
pso (tiny) 2008-12-26 17:20:25 +05:30
commit d8b7f467d7
31 changed files with 169 additions and 90 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<wizard string="Invoice + Message"
<wizard string="Invoices with Layout and Message"
model="account.invoice"
name="wizard.notify_message"
id="wizard_notify_message"
@ -9,7 +9,7 @@
/>
<report id="account_invoices_1"
string="Invoice"
string="Invoices with Layout"
model="account.invoice"
name="account.invoice.layout"
rml="account_invoice_layout/report/report_account_invoice_layout.rml"

View File

@ -97,7 +97,7 @@ class account_invoice_with_message(report_sxw.rml_parse):
def spcl_msg(self, form):
account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, form['message'])
msg = account_msg_data.msg
msg = account_msg_data.msg
return msg

View File

@ -292,9 +292,10 @@
<font color="white"> </font>
</para>
<para style="P19">[[ format((o.payment_term and o.payment_term.note) or '') ]]</para>
<section>
<para style="P19">[[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]]</para>
<para style="P19">[[ note or removeParentNode('table') ]]</para>
<para style="P19">[[ note or removeParentNode('para') ]]</para>
</section>
</story>
</document>

View File

@ -22,8 +22,14 @@
{
"name" : "Auction module",
"version" : "1.0",
"author" : "Tiny",
"category" : "Generic Modules/Auction",
"depends" : ["base","account","hr_attendance"],
"description": '''This module provides functionality to
manage artists, articles, sellers, buyers and auction.
Manage bids, track of sold, paid and unpaid objects.
Delivery Management.
''',
"update_xml" : [
# FIXME: review security rules...
"security/ir.model.access.csv",

View File

@ -34,7 +34,7 @@ This module's aim is to check the quality of other modules.
""",
"init_xml" : [],
"update_xml" : ["base_module_quality_wizard.xml"],
"update_xml" : ["base_module_quality_wizard.xml", "security/ir.model.access.csv",],
"category" : "Tiny Specific Modules/Base module quality",
"active": False,
"installable": True

View File

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
class abstract_quality_check(object):
'''
@ -41,11 +41,11 @@ class abstract_quality_check(object):
#This bool defines if the test can be run only if the module is installed.
#True => the module have to be installed.
#False => the module can be uninstalled.
bool_installed_only = True
bool_installed_only = True
def __init__(self):
'''
this method should initialize the var
this method should initialize the var
'''
raise 'Not Implemented'
@ -55,7 +55,27 @@ class abstract_quality_check(object):
'''
raise 'Not Implemented'
def get_objects(self, cr, uid, module):
# This function returns all object of the given module..
pool = pooler.get_pool(cr.dbname)
ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module), ('model','=','ir.model')])
model_list = []
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
for model in model_data:
model_list.append(model.res_id)
obj_list = []
for mod in pool.get('ir.model').browse(cr, uid, model_list):
obj_list.append(str(mod.model))
return obj_list
def get_ids(self, cr, uid, object_list):
#This method return dictionary with ids of records of object for module
pool = pooler.get_pool(cr.dbname)
result_ids = {}
for obj in object_list:
ids = pool.get(obj).search(cr, uid, [])
result_ids[obj] = ids
return result_ids
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -16,7 +16,7 @@
</record>
<act_window
id="act_view_wiz_quality_check"
name="Wizard Quality Check"
name="Quality Check"
res_model="wizard.quality.check"
src_model="ir.module.module"
target="new"

View File

@ -42,15 +42,8 @@ This test checks if the module classes are raising exception when calling basic
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module_name), ('model','=','ir.model')])
model_list = []
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
for model in model_data:
model_list.append(model.res_id)
obj_list = []
for mod in pool.get('ir.model').browse(cr, uid, model_list):
obj_list.append(str(mod.model))
result={}
obj_list = self.get_objects(cr, uid, module_name)
result = {}
ok_count = 0
ex_count = 0

View File

@ -0,0 +1,2 @@
"id","name","model_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_wizard_quality_check","wizard.quality.check","model_wizard_quality_check",1,1,1,1
1 id name model_id:id perm_read perm_write perm_create perm_unlink
2 access_wizard_quality_check wizard.quality.check model_wizard_quality_check 1 1 1 1

View File

@ -47,20 +47,13 @@ This test checks the speed of the module.
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
self.result+=('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % ('Object Name'.ljust(40), 'Size (S)'.ljust(10), '1'.ljust(10), 'S/2'.ljust(10), 'S'.ljust(10), 'Complexity'.ljust(20))
ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module_name), ('model','=','ir.model')])
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
model_list = []
for model in model_data:
model_list.append(model.res_id)
obj_list = []
for mod in pool.get('ir.model').browse(cr, uid, model_list):
obj_list.append(str(mod.model))
obj_list = self.get_objects(cr, uid, module_name)
obj_counter = 0
score = 0
for obj in obj_list:
obj_ids = self.get_ids(cr, uid, obj_list)
for obj in obj_ids:
obj_counter += 1
ids = pool.get(obj).search(cr, uid, [])
ids = obj_ids[obj]
ids = ids[:100]
size = len(ids)
if size:
@ -68,12 +61,10 @@ This test checks the speed of the module.
pool.get(obj).read(cr, uid, ids[0])
c2 = time.time()
base_time = c2 - c1
c1 = time.time()
pool.get(obj).read(cr, uid, ids[:size/2])
c2 = time.time()
halfsize_time = c2 - c1
c1 = time.time()
pool.get(obj).read(cr, uid, ids)
c2 = time.time()

View File

@ -31,13 +31,18 @@ import tools
class report_xml(osv.osv):
_inherit = 'ir.actions.report.xml'
def sxwtorml(self,cr, uid, file_sxw):
def sxwtorml(self,cr, uid, file_sxw,file_type):
'''
The use of this function is to get rml file from sxw file.
'''
sxwval = StringIO(base64.decodestring(file_sxw))
fp = tools.file_open('normalized_odt2rml.xsl',
subdir='/home/dsh/my-work/bazaar/odt-sxw2ml')
if file_type=='sxw':
fp = tools.file_open('normalized_oo2rml.xsl',
subdir='addons/base_report_designer/wizard/tiny_sxw2rml')
if file_type=='odt':
fp = tools.file_open('normalized_odt2rml.xsl',
subdir='addons/base_report_designer/wizard/tiny_sxw2rml')
return {'report_rml_content': str(sxw2rml(sxwval, xsl=fp.read()))}
def upload_report(self, cr, uid, report_id, file_sxw,file_type, context):
@ -46,11 +51,12 @@ class report_xml(osv.osv):
'''
pool = pooler.get_pool(cr.dbname)
sxwval = StringIO(base64.decodestring(file_sxw))
fp = tools.file_open('normalized_oo2rml.xsl',
subdir='addons/base_report_designer/wizard/tiny_sxw2rml')
if file_type=='sxw':
fp = tools.file_open('normalized_oo2rml.xsl',
subdir='addons/base_report_designer/wizard/tiny_sxw2rml')
if file_type=='odt':
fp = tools.file_open('normalized_odt2rml.xsl',
subdir='/home/dsh/my-work/bazaar/odt-sxw2ml')
subdir='addons/base_report_designer/wizard/tiny_sxw2rml')
report = pool.get('ir.actions.report.xml').write(cr, uid, [report_id], {
'report_sxw_content': base64.decodestring(file_sxw),
'report_rml_content': str(sxw2rml(sxwval, xsl=fp.read())),

View File

@ -63,6 +63,7 @@
"author" : "Seath Solutions Ltd",
"website": "http://www.seathsolutions.com",
"category" : "Localisation/Account Charts",
"description": "This is the base module to manage the accounting chart for United Kingdom in Open ERP.",
"depends" : ["base", "account", "base_iban", "base_vat", "account_chart"],
"init_xml" : [],
"demo_xml" : [],

View File

@ -31,6 +31,18 @@
#"demo_data.xml",
"membership_demo.xml"
],
"description": """
This module allows you to manage all operations for managing memberships.
It supports different kind of members:
* Free member
* Associated member (ex: a group subscribe for a membership for all
subsidiaries)
* Paid members,
* Special member prices, ...
It is integrated with sales and accounting to allow you to automatically
invoice and send propositions for membership renewal.
""",
"init_xml" : [
"membership_data.xml",
],

View File

@ -27,6 +27,14 @@
"depends" : ["base","mrp"],
"category" : "Generic Modules/Production",
"init_xml" : [],
"description": """
This module allows you to produce several products from one production order.
You can configure sub-products in the bill of material.
Without this module:
A + B + C -> D
With this module:
A + B + C -> D + E
""",
"demo_xml" : [],
"update_xml" : [
"mrp_subproduct_view.xml",

View File

@ -60,15 +60,13 @@ class process_process(osv.osv):
def search_by_model(self, cr, uid, res_model, context):
pool = pooler.get_pool(cr.dbname)
model_ids = (res_model or None) and pool.get('ir.model').search(cr, uid, [('model', '=', res_model)])
model_ids = pool.get('ir.model').search(cr, uid, [('model', '=', res_model)])
if not model_ids:
return []
domain = (model_ids or []) and [('model_id', 'in', model_ids)]
result = []
# search all processes
res = pool.get('process.process').search(cr, uid, [('model_id', 'in', model_ids)])
res = pool.get('process.process').search(cr, uid, domain)
if res:
res = pool.get('process.process').browse(cr, uid, res, context)
for process in res:
@ -76,9 +74,9 @@ class process_process(osv.osv):
return result
# else search process nodes
res = pool.get('process.node').search(cr, uid, [('model_id', 'in', model_ids)])
res = pool.get('process.node').search(cr, uid, domain)
if res:
res = pool.get('process.node').browse(cr, uid, res, context)
res = pool.get('process.node').browse(cr, uid, res, context)
for node in res:
if (node.process_id.id, node.process_id.name) not in result:
result.append((node.process_id.id, node.process_id.name))
@ -92,13 +90,15 @@ class process_process(osv.osv):
pool = pooler.get_pool(cr.dbname)
process = pool.get('process.process').browse(cr, uid, [id])[0]
states = dict(pool.get(res_model).fields_get(cr, uid, context=context).get('state', {}).get('selection', {}))
title = process.name
expr_context = {}
states = {}
perm = None
if res_model:
states = dict(pool.get(res_model).fields_get(cr, uid, context=context).get('state', {}).get('selection', {}))
if res_id:
current_object = pool.get(res_model).browse(cr, uid, [res_id], context)[0]
current_user = pool.get('res.users').browse(cr, uid, [uid], context)[0]

View File

@ -91,6 +91,16 @@ class product_pricelist(osv.osv):
'version_id': fields.one2many('product.pricelist.version', 'pricelist_id', 'Pricelist Versions'),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
}
def name_get(self, cr, uid, ids, context={}):
result= []
for pl in self.browse(cr, uid, ids, context):
name = str(pl.name) + ' ('+ str(pl.currency_id.name) + ')'
result.append((pl.id,name))
return result
def _get_currency(self, cr, uid, ctx):
comp = self.pool.get('res.users').browse(cr,uid,uid).company_id
if not comp:

View File

@ -24,6 +24,11 @@
"version":"1.0",
"author":"Tiny",
"category":"Custom",
"description": """
Adds a reporting menu in products that computes sales, purchases, margins
and others interresting indicators based on invoices. The wizard to launch
the report has several options to help you get the data you need.
""",
"depends":["base","product","account"],
"demo_xml":[],
"update_xml":["product_margin_view.xml"],

View File

@ -24,6 +24,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Profile",
"description": "Profile for Accounting",
"depends":["account","report_analytic","board_account","account_followup"],
"demo_xml":[],
"update_xml":[

View File

@ -24,6 +24,7 @@
"version":"0.1",
"author":"Tiny",
"category":"Profile",
"description": "Profile for Associates",
"depends":["membership", "board_association"],
"demo_xml":[],
"update_xml":[

View File

@ -24,6 +24,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Profile",
"description": "Profile for Auction house",
"depends":["auction", "board_auction","account","hr_timesheet_sheet"],
"demo_xml":[],
"update_xml":[],

View File

@ -24,6 +24,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Profile",
"description": "Profile for CRM",
"depends":[
"crm_vertical", "board_crm_configuration",
],

View File

@ -24,6 +24,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Profile",
"description": "Profile for manufacturing industries",
"depends":["mrp", "sale", "delivery","board_manufacturing","product_margin"],
"demo_xml":[],
"update_xml":[

View File

@ -24,6 +24,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Profile",
"description": "Profile for service companies",
"depends":[
"hr",
"project",

View File

@ -25,7 +25,19 @@
"author" : "Tiny",
"category" : "Generic Modules/Projects & Services",
"depends" : ["project"],
"description": "",
"description": """
This module implements all concepts defined by the Getting Things Done
methodology. This world-wide used methodology is used for personnal
time management improvement.
Getting Things Done (commonly abbreviated as GTD) is an action management
method created by David Allen, and described in a book of the same name.
GTD rests on the principle that a person needs to move tasks out of the mind by
recording them externally. That way, the mind is freed from the job of
remembering everything that needs to be done, and can concentrate on actually
performing those tasks.
""",
"init_xml" : [],
"demo_xml" : ["project_gtd_demo.xml"],
"update_xml": [

View File

@ -26,6 +26,7 @@
"website" : "http://www.openerp.com",
"depends" : ["base", "account", "stock", "process"],
"category" : "Generic Modules/Sales & Purchases",
"description": "Module for purchase management",
"init_xml" : [],
"demo_xml" : ["purchase_demo.xml",
#"purchase_unit_test.xml"

View File

@ -43,39 +43,24 @@ class purchase_order(osv.osv):
res[order.id] += oline.price_unit * oline.product_qty
return res
def _amount_untaxed(self, cr, uid, ids, field_name, arg, context):
res = {}
cur_obj=self.pool.get('res.currency')
for purchase in self.browse(cr, uid, ids):
res[purchase.id] = 0.0
for line in purchase.order_line:
res[purchase.id] += line.price_subtotal
cur = purchase.pricelist_id.currency_id
res[purchase.id] = cur_obj.round(cr, uid, cur, res[purchase.id])
return res
def _amount_tax(self, cr, uid, ids, field_name, arg, context):
def _amount_all(self, cr, uid, ids, field_name, arg, context):
res = {}
cur_obj=self.pool.get('res.currency')
for order in self.browse(cr, uid, ids):
val = 0.0
res[order.id] = {
'amount_untaxed': 0.0,
'amount_tax': 0.0,
'amount_total': 0.0,
}
val = val1 = 0.0
cur=order.pricelist_id.currency_id
for line in order.order_line:
for c in self.pool.get('account.tax').compute(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id, order.partner_id):
val+= c['amount']
res[order.id]=cur_obj.round(cr, uid, cur, val)
return res
def _amount_total(self, cr, uid, ids, field_name, arg, context):
res = {}
untax = self._amount_untaxed(cr, uid, ids, field_name, arg, context)
tax = self._amount_tax(cr, uid, ids, field_name, arg, context)
cur_obj=self.pool.get('res.currency')
for id in ids:
order=self.browse(cr, uid, [id])[0]
cur=order.pricelist_id.currency_id
res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0))
val1 += line.price_subtotal
res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val)
res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
return res
def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context):
@ -144,6 +129,12 @@ class purchase_order(osv.osv):
res[r] = 100.0 * res[r][0] / res[r][1]
return res
def _get_order(self, cr, uid, ids, context={}):
result = {}
for line in self.pool.get('purchase.order.line').browse(cr, uid, ids, context=context):
result[line.order_id.id] = True
return result.keys()
_columns = {
'name': fields.char('Order Reference', size=64, required=True, select=True),
'origin': fields.char('Origin', size=64,
@ -181,9 +172,18 @@ class purchase_order(osv.osv):
"Manual: no invoice will be pre-generated. The accountant will have to encode manually."
),
'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True,store=True, string='Planned Date', type='datetime', help="This is computed as the minimum scheduled date of all purchase order lines' products."),
'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount'),
'amount_tax': fields.function(_amount_tax, method=True, string='Taxes'),
'amount_total': fields.function(_amount_total, method=True, string='Total'),
'amount_untaxed': fields.function(_amount_all, method=True, string='Untaxed Amount',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums"),
'amount_tax': fields.function(_amount_all, method=True, string='Taxes',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums"),
'amount_total': fields.function(_amount_all, method=True, string='Total',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums"),
}
_defaults = {
'date_order': lambda *a: time.strftime('%Y-%m-%d'),

View File

@ -20,12 +20,14 @@
#
##############################################################################
{
"name" : "Sales Management - Reporting",
"name" : "Purchase Management - Reporting",
"version" : "1.0",
"author" : "Tiny",
"website" : "http://www.openerp.com",
"depends" : ["purchase"],
"category" : "Generic Modules/Sales & Purchases",
"description": '''Module to add views like
Purchase By Product, Purchase By Category of Product, All Months, Current Month.''',
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [

View File

@ -24,6 +24,8 @@
"version" : "1.0",
"author" : "Tiny",
"website" : "http://www.openerp.com",
"description": '''Module to add timesheet views like
All Month, Timesheet By User, Timesheet Of Month, Timesheet By Account''',
"depends" : ["hr_timesheet",'hr_timesheet_invoice'],
"category" : "Generic Modules/Human Resources",
"init_xml" : [],

View File

@ -26,6 +26,10 @@
"website" : "http://www.openerp.com",
"depends" : ["product", "account"],
"category" : "Generic Modules/Inventory Control",
"description": '''Module provides Inventory Management, define warehouse, stock location, Pickings,
Incoming products, Outgoing products, Internal movements of product, Traceability.
Reports for stock like lots by location, Stock Forecast, Item Labels, Picking List etc..
''',
"init_xml" : [],
"demo_xml" : ["stock_demo.xml"],
"update_xml" : [

View File

@ -1062,20 +1062,16 @@ class stock_move(osv.osv):
if move.state in ('confirmed','waiting','assigned','draft'):
if move.picking_id:
pickings[move.picking_id.id] = True
if move.move_dest_id and move.move_dest_id.state=='waiting':
self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'})
if move.move_dest_id.picking_id:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
if move.move_dest_id and move.move_dest_id.state=='waiting':
self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'})
if move.move_dest_id.picking_id:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
self.write(cr, uid, ids, {'state':'cancel', 'move_dest_id': False})
#for pick_id in pickings:
# wf_service = netsvc.LocalService("workflow")
# wf_service.trg_validate(uid, 'stock.picking', pick_id, 'button_cancel', cr)
#ids2 = []
#for res in self.read(cr, uid, ids, ['move_dest_id']):
# if res['move_dest_id']:
# ids2.append(res['move_dest_id'][0])
for pick in self.pool.get('stock.picking').browse(cr,uid,pickings.keys()):
if all(move.state == 'cancle' for move in pick.move_lines):
self.pool.get('stock.picking').write(cr,uid,[pick.id],{'state':'cancel'})
wf_service = netsvc.LocalService("workflow")
for id in ids:

View File

@ -24,6 +24,7 @@
"version" : "1.0",
"author" : "Tiny",
"category" : "Generic Modules/Others",
"description": '''Module allows to create new documents and add subscription on that document.''',
"depends" : ["base"],
"init_xml" : [],
"demo_xml" : [],