merge addons changes

bzr revid: mra@tinyerp.com-20080827052924-e70v2euqm2mu6q3s
bzr revid: mra@tinyerp.com-20080827094251-bstw4sb059m9hq1c
This commit is contained in:
Mustufa Rangwala 2008-08-27 15:12:51 +05:30
commit 6f3ea63d6a
17 changed files with 427 additions and 62 deletions

View File

@ -28,7 +28,7 @@
###############################################################################
{
"name" : "VAT",
"description": "Enable the VAT Number for the partner. Check the validity of that VAT Number (idea and code from Tryton (c2bk)).",
"description": "Enable the VAT Number for the partner. Check the validity of that VAT Number.",
"version" : "1.0",
"author" : "Tiny",
"category" : "Generic Modules/Base",

View File

@ -26,6 +26,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###############################################################################
#
# The methods "check_vat_[a-z]{2}" are copyrighted:
# - Cedric Krier.
# - Bertrand Chenal
# - B2CK
#
from osv import osv
@ -45,14 +51,16 @@ class res_partner(osv.osv):
continue #FIXME return False? empty vat numbre is invalid?
vat_country, vat_number = partner.vat[:2].lower(), partner.vat[2:]
if not getattr(self, 'check_vat_' + vat_country)(vat_number):
check = getattr(self, 'check_vat_' + vat_country, lambda vn: False)
if not check(vat_number):
return False
return True
_constraints = [(check_vat, "The VAT doesn't seem to be correct.", ["vat"])]
# code from the following methods come from Tryton (c2bk)
# code from the following methods come from Tryton (B2CK)
# http://www.tryton.org/hgwebdir.cgi/modules/relationship/file/544d1de586d9/party.py
def check_vat_at(self, vat):
'''

View File

@ -27,7 +27,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import profile_accounting
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -33,7 +33,7 @@
"category":"Profile",
"depends":["account","report_analytic","board_account","account_followup",'invoice_payment_tab'],
"demo_xml":[],
"update_xml":[],
"update_xml":["profile_accounting.xml"],
"active":False,
"installable":True,
}

View File

@ -0,0 +1,75 @@
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
#
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
#
# 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 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 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.
###############################################################################
from osv import fields, osv
import pooler
class config_install_extra_modules(osv.osv_memory):
_name='config.install_extra_modules'
_columns = {
'name':fields.char('Name', size=64),
'account_analytic_analysis':fields.boolean('Analytic Accounting'),
'account_analytic_plans':fields.boolean('Multiple Analytic Plans'),
'account_payment':fields.boolean('Suppliers Payment Management'),
'account_asset':fields.boolean('Asset Management'),
'hr_timesheet_invoice':fields.boolean('Invoice on Analytic Entries'),
'account_budget_crossover':fields.boolean('Analytic Budgets'),
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
ids += mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.action_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
config_install_extra_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<terp>
<data>
<record id="view_confirm_install_module_form" model="ir.ui.view">
<field name="name">Install extra modules</field>
<field name="model">config.install_extra_modules</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Accounting Management" colspan="4"/>
<field name="account_analytic_analysis"/>
<field name="account_analytic_plans"/>
<field name="account_payment"/>
<separator string="Resources Management" colspan="4"/>
<field name="account_budget_crossover"/>
<field name="account_asset"/>
<separator string="Services Management" colspan="4"/>
<field name="hr_timesheet_invoice"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_install_module" model="ir.actions.act_window">
<field name="name">Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">config.install_extra_modules</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.module.module.configuration.step"
id="config_install_module">
<field name="name">Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
<field name="state">open</field>
</record>
</data>
</terp>

View File

@ -26,5 +26,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import profile_association
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -6,7 +6,7 @@
"category":"Profile",
"depends":["membership", "event", "association_vertical", "board_association"],
"demo_xml":[],
"update_xml":[],
"update_xml":["profile_association.xml"],
"active":False,
"installable":True,
}

View File

@ -0,0 +1,73 @@
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
#
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
#
# 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 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 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.
###############################################################################
from osv import fields, osv
import pooler
class config_install_extra_modules(osv.osv_memory):
_name='config.install_extra_modules'
_columns = {
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
'project':fields.boolean('Project Management'),
'event' : fields.boolean('Events Organisation'),
'crm' : fields.boolean('Fund Raising'),
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.action_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
config_install_extra_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<terp>
<data>
<record id="view_confirm_install_module_form" model="ir.ui.view">
<field name="name">Install extra modules</field>
<field name="model">config.install_extra_modules</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Project Management" colspan="4"/>
<field name="project"/>
<field name="event"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_expense"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
<field name="crm"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_install_module" model="ir.actions.act_window">
<field name="name">Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">config.install_extra_modules</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.module.module.configuration.step"
id="config_install_module">
<field name="name">Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
<field name="state">open</field>
</record>
</data>
</terp>

View File

@ -27,7 +27,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import profile_manufacturing
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -33,7 +33,7 @@
"category":"Profile",
"depends":["mrp", "crm", "sale", "delivery","board_manufacturing"],
"demo_xml":[],
"update_xml":[],
"update_xml":["profile_manufacturing.xml"],
"active":False,
"installable":True,
}

View File

@ -0,0 +1,75 @@
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
#
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
#
# 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 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 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.
###############################################################################
from osv import fields, osv
import pooler
class config_install_extra_modules(osv.osv_memory):
_name='config.install_extra_modules'
_columns = {
'name':fields.char('Name', size=64),
'mrp_jit':fields.boolean('Just in Time Scheduling'),
'sale_margin':fields.boolean('Margins on Sales Order'),
'crm_configuration':fields.boolean('CRM & Calendars'),
'sale_journal':fields.boolean('Manage by Journals'),
'project':fields.boolean('Project Management'),
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.action_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
config_install_extra_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<terp>
<data>
<record id="view_confirm_install_module_form" model="ir.ui.view">
<field name="name">Install extra modules</field>
<field name="model">config.install_extra_modules</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Manufacturing Management" colspan="4"/>
<field name="mrp_jit"/>
<separator string="Sale Management" colspan="4"/>
<field name="sale_margin"/>
<field name="sale_journal"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
<separator string="Project Management" colspan="4"/>
<field name="project"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_install_module" model="ir.actions.act_window">
<field name="name">Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">config.install_extra_modules</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.module.module.configuration.step"
id="config_install_module">
<field name="name">Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
<field name="state">open</field>
</record>
</data>
</terp>

View File

@ -53,13 +53,15 @@ class config_install_extra_modules(osv.osv_memory):
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
res=self.read(cr,uid,ids)[0]
result=self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for r in res:
if r<>'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', res[r])])
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
for res in result:
for r in res:
if r<>'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.action_install(cr,uid,ids,context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',

View File

@ -1189,28 +1189,15 @@ product_product()
# get confirm or assign stock move lines of partner and put in current picking.
class stock_picking_move_wizard(osv.osv_memory):
_name='stock.picking.move.wizard'
def _get_picking(self,cr, uid, ctx):
if 'action_id' in ctx:
def _get_picking(self,cr, uid, ctx):
if ctx.get('action_id',False):
return ctx['action_id']
return False
def _get_move_lines(self,cr,uid,ctx):
move_obj=self.pool.get('stock.move')
picking_obj=self.pool.get('stock.picking')
if 'action_id' in ctx:
picking=picking_obj.browse(cr,uid,[ctx['action_id']])
if picking and len(picking):
move_line_ids=move_obj.search(cr,uid,[('state','in',['confirmed','assigned']),('address_id','=',picking[0].address_id.id)])
move_lines=move_obj.read(cr,uid,move_line_ids)
#res=[]
#for move_line in move_lines:
# res.append((0,0,move_line))
return [{'move_ids':(0,0,move_lines)}]
return []
return False
def _get_picking_address(self,cr,uid,ctx):
picking_obj=self.pool.get('stock.picking')
if 'action_id' in ctx:
picking=picking_obj.browse(cr,uid,[ctx['action_id']])[0]
return picking.address_id and picking.address_id.id
picking_obj=self.pool.get('stock.picking')
if ctx.get('action_id',False):
picking=picking_obj.browse(cr,uid,[ctx['action_id']])[0]
return picking.address_id and picking.address_id.id or False
return False

View File

@ -417,7 +417,39 @@
<field name="view_id" ref="view_warehouse_tree"/>
</record>
<menuitem action="action_warehouse_form" id="menu_action_warehouse_form" parent="menu_stock_configuration"/>
==============================
Wizard to Fill From Unreceived Products
===============================
<record id="stock_picking_move_wizard_form" model="ir.ui.view">
<field name="name">stock.picking.move.wizard.form</field>
<field name="model">stock.picking.move.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Move Lines">
<field name="address_id" invisible="True"/>
<field name="picking_id" invisible="True"/>
<field domain="[('picking_id','&lt;&gt;',picking_id),('state','in',['confirmed','assigned'])]" name="move_ids" select="1"/><newline/>
<group colspan="4">
<button special="cancel" string="Cancel"/>
<button name="action_move" string="Add" type="object"/>
</group>
</form>
</field>
</record>
<record id="act_stock_picking_move_wizard" model="ir.actions.act_window">
<field name="name">Fill From Unreceived Products</field>
<field name="res_model">stock.picking.move.wizard</field>
<field name="src_model">stock.picking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="auto_refresh" eval="1"/>
<field name="target">new</field>
<field name="context">{'action_id': active_id}</field>
</record>
=============================
Packing
=============================
@ -891,7 +923,7 @@
</field>
<group col="7" colspan="4">
<label colspan="5"/>
<button name="llk" string="Fill From Unreceived Products" type="action"/>
<button name="%(act_stock_picking_move_wizard)d" string="Fill From Unreceived Products" type="action"/>
</group>
<group col="8" colspan="4">
<field name="state" readonly="1"/>
@ -1179,32 +1211,7 @@
<field name="name">Products</field>
<field eval="'ir.actions.act_window,%d'%act_product_location_open" name="value"/>
<field eval="True" name="object"/>
</record>
<record id="stock_picking_move_wizard_form" model="ir.ui.view">
<field name="name">stock.picking.move.wizard.form</field>
<field name="model">stock.picking.move.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Move Lines">
<field name="address_id" invisible="True"/>
<field name="picking_id" invisible="True"/>
<field domain="[('picking_id','&lt;&gt;',picking_id),('address_id','=',address_id),('state','in',['confirmed','assigned'])]" name="move_ids" select="1"/><newline/>
<group colspan="4">
<button special="cancel" string="Cancel"/>
<button name="action_move" string="Add" type="object"/>
</group>
</form>
</field>
</record>
<act_window name="Get move lines"
context="{'action_id': active_id}"
res_model="stock.picking.move.wizard"
src_model="stock.picking"
view_mode="form"
target="new"
id="act_stock_picking_move_wizard"/>
</record>
</data>
</terp>