[MERGE/IMP]:merged from trunk and improved the purchase order report

bzr revid: apa@tinyerp.com-20100903124551-u45rj2cwgs45rpw1
This commit is contained in:
apa-tiny
2010-09-03 18:15:51 +05:30
38 changed files with 110 additions and 146 deletions
+1 -1
View File
@@ -2039,7 +2039,7 @@ class account_model_line(osv.osv):
'currency_id': fields.many2one('res.currency', 'Currency'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Maturity date', help="The maturity date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Due date', help="The due date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
'date': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Current Date', required=True, help="The date of the generated entries"),
}
_defaults = {
+1
View File
@@ -123,6 +123,7 @@
<field name="action_id" ref="action_account_installer"/>
<field name="sequence">5</field>
<field name="restart">always</field>
<field eval="[(6,0,[ref('base.group_extended')])]" name="groups_id"/>
</record>
</data>
+1 -1
View File
@@ -439,7 +439,7 @@ class account_move_line(osv.osv):
'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
'partner_id': fields.many2one('res.partner', 'Partner'),
'date_maturity': fields.date('Maturity date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
'date_maturity': fields.date('Due date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
'date': fields.related('move_id','date', string='Effective date', type='date', required=True,
store={
'account.move': (_get_move_lines, ['date'], 20)
+1 -1
View File
@@ -1857,7 +1857,7 @@
<act_window domain="[('journal_id', '=', active_id)]" id="act_account_journal_2_account_move_line" name="Journal Items" res_model="account.move.line" src_model="account.journal"/>
<act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>
<act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>
<act_window context="{'search_default_partner_id':[active_id]}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner"/>
+2 -2
View File
@@ -295,7 +295,7 @@
</record>
<record id="sp_journal_col7" model="account.journal.column">
<field name="view_id" ref="account_sp_journal_view"/>
<field name="name">Maturity Date</field>
<field name="name">Due Date</field>
<field name="field">date_maturity</field>
<field eval="7" name="sequence"/>
</record>
@@ -393,7 +393,7 @@
</record>
<record id="sp_refund_journal_col7" model="account.journal.column">
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="name">Maturity Date</field>
<field name="name">Due Date</field>
<field name="field">date_maturity</field>
<field eval="7" name="sequence"/>
</record>
+4 -3
View File
@@ -76,13 +76,13 @@
<page string="Accounting">
<group col="2" colspan="2">
<separator string="Customer Accounting Properties" colspan="2"/>
<field name="property_account_receivable" groups="account.group_account_user" />
<field name="property_account_receivable" groups="base.group_extended" />
<field name="property_account_position" widget="selection"/>
<field name="property_payment_term" widget="selection"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Accounting Properties" colspan="2"/>
<field name="property_account_payable" groups="account.group_account_user"/>
<field name="property_account_payable" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator string="Customer Credit" colspan="2"/>
@@ -134,7 +134,8 @@
context="{'search_default_partner_id':[active_id]}"
src_model="res.partner"
view_type="form"
view_mode="tree,form,graph,calendar"/>
view_mode="tree,form,graph,calendar"
groups="base.group_extended"/>
<record id="view_res_partner_reconcile" model="ir.ui.view">
<field name="name">res.partner.form.reconcile</field>
+1 -1
View File
@@ -147,7 +147,7 @@
<para style="terp_tblheader_Details_Centre">Ref</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Maturity date</para>
<para style="terp_tblheader_Details_Centre">Due date</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Due</para>
@@ -136,7 +136,7 @@
<para style="terp_tblheader_Details_Centre">Ref</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Maturity Date</para>
<para style="terp_tblheader_Details_Centre">Due Date</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Amount In Currency</para>
@@ -209,7 +209,7 @@ class account_followup_print_all(osv.osv_memory):
subtotal_maturity = 0.0
balance = 0.0
l = '--------------------------------------------------------------------------------------------------------------------------'
head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Maturity date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l
head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Due date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l
for i in data_lines:
maturity = 0.00
if i.date_maturity < time.strftime('%Y-%m-%d') and (i.debit - i.credit):
+1 -1
View File
@@ -319,7 +319,7 @@ class payment_line(osv.osv):
help='Payment amount in the company currency'),
'ml_date_created': fields.function(_get_ml_created_date, string="Effective Date",
method=True, type='date', help="Invoice Effective Date"),
'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Maturity Date'),
'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Due Date'),
'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref.'),
'info_owner': fields.function(info_owner, string="Owner Account", method=True, type="text", help='Address of the Main Partner'),
'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text", help='Address of the Ordering Customer.'),
@@ -26,6 +26,7 @@ import tools
from tools import config
from tools.translate import _
from osv import osv, fields
import logging
class abstract_quality_check(object):
'''
@@ -80,6 +81,7 @@ class abstract_quality_check(object):
#This variable used to give message if test result is good or not
self.message = ''
self.log = logging.getLogger('module.quality')
#The tests have to subscribe itselfs in this list, that contains
#all the test that have to be performed.
@@ -111,9 +113,11 @@ class abstract_quality_check(object):
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
for model in model_data:
model_list.append(model.res_id)
self.log.debug('get_objects() model_list: %s', ','.join(map(str, model_list)))
obj_list = []
for mod in pool.get('ir.model').browse(cr, uid, model_list):
obj_list.append(str(mod.model))
self.log.debug('get_objects() obj_list: %s', ','.join(obj_list))
return obj_list
def get_model_ids(self, cr, uid, models=[]):
@@ -121,6 +125,7 @@ class abstract_quality_check(object):
if not models:
return []
pool = pooler.get_pool(cr.dbname)
self.log.debug('get_model_ids([%s])', ', '.join(models))
return pool.get('ir.model').search(cr, uid, [('model', 'in', models)])
def get_ids(self, cr, uid, object_list):
@@ -287,4 +292,4 @@ class module_quality_detail(osv.osv):
module_quality_detail()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -74,9 +74,14 @@ class quality_test(base_module_quality.abstract_quality_check):
wkf_ids = map(lambda x:x['id'], wkfs)
if not wkf_ids:
result_dict[module_name] = [module_name, 'No workflow defined on module']
#Activity of workflow checking...
activity_ids = wkf_activity_obj.search(cr, uid, [('wkf_id', 'in', wkf_ids)])
activities = wkf_activity_obj.browse(cr, uid, activity_ids)
activity_ids = []
activities = []
else:
#Activity of workflow checking...
activity_ids = wkf_activity_obj.search(cr, uid, [('wkf_id', 'in', wkf_ids)])
activities = wkf_activity_obj.browse(cr, uid, activity_ids)
self.log.debug("quality test: wkf_ids = %r", wkf_ids)
self.log.debug("quality test: activity_ids = %r", activity_ids)
for activity in activities:
if activity.flow_start:
activity_chk[activity.wkf_id.osv]['start'] = 'ok'
+1 -1
View File
@@ -28,7 +28,7 @@
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)" groups="base.group_extended"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<separator string="Install Specific Business Modules" colspan="4"/>
<field name="association" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
+4 -4
View File
@@ -36,10 +36,10 @@
<field name="currency" widget="selection"/>
</group>
<newline/>
<group colspan="2" groups="base.group_extended" >
<field name="rml_header1" colspan="5" invisible="1"/>
<field name="rml_footer1" colspan="5" invisible="1"/>
<field name="rml_footer2" colspan="5" invisible="1"/>
<group colspan="2">
<field name="rml_header1" colspan="5" invisible="1" groups="base.group_extended"/>
<field name="rml_footer1" colspan="5" invisible="1" groups="base.group_extended"/>
<field name="rml_footer2" colspan="5" invisible="1" groups="base.group_extended"/>
<separator colspan="4"
string="Your Logo - Use a size of about 450x150 pixels."/>
+12
View File
@@ -104,6 +104,18 @@ class base_setup_installer(osv.osv_memory):
return ['document_ftp']
return None
def _if_misc_tools(self, cr, uid, ids, context=None):
interface = self.pool.get('res.users').browse(cr, uid, uid, context=context).view
if interface == 'simple' or interface =='extended' :
return ['lunch','idea','survey']
return None
def _if_account(self, cr, uid, ids, context=None):
if self.pool.get('res.users').browse(cr, uid, uid, context=context)\
.view == 'simple':
return ['account_voucher']
return None
def onchange_moduleselection(self, cr, uid, ids, *args):
closed, total = self.get_current_progress(cr, uid)
+1
View File
@@ -61,6 +61,7 @@
<record id="crm_installer_todo" model="ir.actions.todo">
<field name="action_id" ref="action_crm_installer"/>
<field name="sequence">3</field>
<field eval="[(6,0,[ref('base.group_extended')])]" name="groups_id"/>
</record>
</data>
</openerp>
+1
View File
@@ -5,6 +5,7 @@
<act_window
id="act_crm_opportunity_crm_phonecall_new"
name="Phone calls"
groups="base.group_extended"
res_model="crm.phonecall"
src_model="crm.lead"
view_mode="tree,calendar,form"
+1 -1
View File
@@ -31,7 +31,7 @@
<field name="probability"/>
<field name="date_deadline" string="Expected Closing"/>
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" />
name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
<newline/>
<field name="date_action"/>
<field name="title_action"/>
@@ -50,9 +50,6 @@ class crm_helpdesk_report(osv.osv):
('07', 'July'), ('08', 'August'),\
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
@@ -40,7 +40,6 @@ class report_document_user(osv.osv):
'file_size': fields.integer('File Size', readonly=True),
'nbr':fields.integer('# of Files', readonly=True),
'type':fields.char('Directory Type',size=64,readonly=True),
'partner':fields.char('Partner',size=64,readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_document_user')
+1 -1
View File
@@ -76,7 +76,7 @@
</record>
<menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6"/>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6" groups="base.group_extended"/>
<record model="ir.ui.view" id="view_users_form_inherit">
<field name="name">res.users.form</field>
+2 -2
View File
@@ -29,8 +29,8 @@
<field name="hr_contract"/>
<field name="hr_evaluation"/>
<field name="hr_attendance"/>
<field name="hr_payroll"/>
<field name="hr_payroll_account"/>
<field name="hr_payroll" groups="base.group_extended"/>
<field name="hr_payroll_account" groups="base.group_extended"/>
</group>
<xpath expr="//button[@string='Install Modules']" position="attributes">
<attribute name="string">Configure</attribute>
+5 -6
View File
@@ -102,7 +102,7 @@
<separator orientation="vertical" />
<field name="name"/>
<field name="department_id" widget="selection">
<filter icon="terp-personal+" domain="[('department_id','=',context.get('department_id',False))]" help="My Departments Employee"/>
<filter icon="terp-personal+" domain="[('department_id','=',context.get('department_id',False))]" string="My Departments Employee"/>
</field>
<field name="job_id" widget="selection"/>
<field name="parent_id"/>
@@ -189,7 +189,7 @@
</record>
<menuitem action="action_hr_marital_status" id="hr_menu_marital_status"
parent="hr.menu_view_employee_category_configuration_form" sequence="3"/>
parent="hr.menu_view_employee_category_configuration_form" sequence="3" groups="base.group_extended"/>
<!--
=======================
@@ -320,7 +320,6 @@
<group col="6" colspan="4">
<field name="name" />
<field name="department_id" />
<newline/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="expected_employees"/>
<field name="no_of_employee"/>
@@ -355,6 +354,7 @@
<tree string="Job">
<field name="name" />
<field name="department_id" />
<field name="company_id" groups="base.group_multi_company"/>
<field name="expected_employees"/>
<field name="no_of_employee"/>
<field name="state"/>
@@ -370,10 +370,8 @@
<search string="Jobs">
<filter icon="terp-check" domain="[('state','in',('open','recruit'))]" string="Current"
name="Current" help="Open and in recruitment positions"/>
<filter icon="terp-camera_test" domain="[('state','=','open')]" string="Open"
help="Open Positions"/>
<separator orientation="vertical"/>
<filter icon="terp-personal+" domain="[('state','=','recruit')]" string="Recruitment"
<filter icon="terp-personal+" domain="[('state','=','recruit')]" string="In Recruitment"
help="In Recruitment"/>
<separator orientation="vertical"/>
<field name="name"/>
@@ -383,6 +381,7 @@
<newline />
<group expand="0" string="Group By...">
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
+3 -1
View File
@@ -98,6 +98,8 @@ class hr_employee(osv.osv):
if context is None:
context = {}
result = {}
if not ids:
return result
for id in ids:
result[id] = 'absent'
cr.execute('SELECT hr_attendance.action, hr_attendance.employee_id \
@@ -156,4 +158,4 @@ class hr_employee(osv.osv):
hr_employee()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -93,7 +93,6 @@ class hr_recruitment_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'date': fields.date('Date', readonly=True),
'opening_date': fields.date('Date of Opening', readonly=True),
'date_closed': fields.date('Closed', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
@@ -163,4 +162,4 @@ class hr_recruitment_report(osv.osv):
""")
hr_recruitment_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -38,7 +38,7 @@ class report_membership(osv.osv):
('07', 'July'), ('08', 'August'),\
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'date': fields.datetime('Create Date', readonly=True),
'canceled_number': fields.integer('Canceled', readonly=True),
'waiting_number': fields.integer('Waiting', readonly=True),
'invoiced_number': fields.integer('Invoiced', readonly=True),
@@ -78,7 +78,7 @@ class report_membership(osv.osv):
SUM(awaiting) as waiting_amount,
year,
month,
create_date,
date,
partner_id,
membership_id,
state,
@@ -104,7 +104,7 @@ class report_membership(osv.osv):
ELSE 0 END AS awaiting,
TO_CHAR(ml.date_from, 'YYYY') AS year,
TO_CHAR(ml.date_from, 'MM')as month,
TO_CHAR(ml.date_from, 'YYYY-MM-DD') as create_date,
TO_CHAR(ml.date_from, 'YYYY-MM-DD') as date,
ai.partner_id AS partner_id,
ai.currency_id AS currency,
ai.state as state,
@@ -119,7 +119,7 @@ class report_membership(osv.osv):
ON (ml.partner = p.id)
GROUP BY TO_CHAR(ml.date_from, 'YYYY'), TO_CHAR(ml.date_from, 'MM'), TO_CHAR(ml.date_from, 'YYYY-MM-DD'), ai.state, ai.partner_id,
ai.currency_id, ml.id, ml.membership_id) AS foo
GROUP BY year, month, create_date, currency, partner_id, membership_id, state)
GROUP BY year, month, date, currency, partner_id, membership_id, state)
""")
report_membership()
@@ -31,9 +31,9 @@
<search string="Membership">
<group col="8" colspan="4">
<filter string="Last 365 Days" icon="terp-go-year"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
<filter string="Last 30 Days" icon="terp-go-month" name="month"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-camera_test"
string="Invoiced"
+2 -1
View File
@@ -901,7 +901,8 @@
view_type="tree"
view_id="mrp_bom_tree_view"
res_model="mrp.bom"
src_model="product.product"/>
src_model="product.product"
groups="base.group_extended"/>
<act_window
domain="[('product_id', '=', active_id),('bom_id','=',False)]"
-27
View File
@@ -720,32 +720,5 @@ class pricelist_partnerinfo(osv.osv):
}
_order = 'min_quantity asc'
pricelist_partnerinfo()
class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
def create(self, cr, uid, data, context=None):
if context is None:
context = {}
user_id = super(res_users, self).create(cr, uid, data, context)
data_obj = self.pool.get('ir.model.data')
try:
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
'user_id': user_id}, context=context)
except ValueError:
# During a single install of multiple modules, the product_view.xml may
# be loaded after this python code is present in the server and called
# by other module's res_users.create() calls. So, we have to survive
# this and create the user.
# One more case is if some admin has deliberately removed this shortcut,
# users must still be able to create.
logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','<new'))
return user_id
res_users()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-8
View File
@@ -633,13 +633,5 @@
<field name="view_type">form</field>
<field name="view_id" ref="product_template_tree_view"/>
</record>
<record id="ir_ui_view_sc_product0" model="ir.ui.view_sc">
<field name="name">Products</field>
<field name="resource">ir.ui.menu</field>
<field name="user_id" ref="base.user_root"/>
<field name="res_id" ref="product.menu_products"/>
</record>
</data>
</openerp>
+2 -2
View File
@@ -26,13 +26,13 @@
<group colspan="8">
<field name="project_crm"/>
<field name="project_long_term" groups="base.group_extended"/>
<field name="project_wiki"/>
<field name="project_wiki" groups="base.group_extended"/>
<field name="hr_timesheet_sheet"/>
<field name="hr_timesheet_invoice"/>
<field name="account_budget" groups="base.group_extended"/>
<field name="project_messages" groups="base.group_extended"/>
<separator string="Methodologies" colspan="4"/>
<field name="scrum"/>
<field name="scrum" groups="base.group_extended"/>
<field name="project_gtd"/>
</group>
</data>
-1
View File
@@ -33,7 +33,6 @@ class report_project_task_user(osv.osv):
'user_id': fields.many2one('res.users', 'Assigned To', readonly=True),
'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('# of Days', size=128, readonly=True),
'description': fields.text('Description', readonly=True),
'date_end': fields.date('Ending Date', readonly=True),
'date_deadline': fields.date('Deadline', readonly=True),
'project_id': fields.many2one('project.project', 'Project', readonly=True),
@@ -35,7 +35,7 @@ class project_issue_report(osv.osv):
_name = "project.issue.report"
_auto = False
def _get_data(self, cr, uid, ids, field_name, arg, context=None):
def _get_data(self, cr, uid, ids, field_names, arg, context=None):
if context is None:
context = {}
""" @param cr: the current row, from the database cursor,
@@ -46,40 +46,24 @@ class project_issue_report(osv.osv):
res = {}
avg_ans = 0.0
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
cr.execute("select count(*) from crm_opportunity where \
section_id =%s and state='%s'"%(case.section_id.id, state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr)) * 100
res[case.id] = perc_state
else:
model_name = self._name.split('report.')
if len(model_name) < 2:
res[case.id] = 0.0
else:
model_name = model_name[1]
cr.execute("select count(*) from crm_case_log l, ir_model m \
where l.model_id=m.id and m.model = '%s'" , model_name)
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr
res[case.id] = avg_ans
for report in self.browse(cr, uid, ids, context):
res[report.id]= {
'avg_answers': 0.0,
'perc_done' : 0.0,
'perc_cancel': 0.0
}
#TODO: Calculate
return res
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'user_id2':fields.many2one('res.users', 'Assignee', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
'perc_cancel': fields.function(_get_data, string='%Cancel', method=True, type="float"),
'avg_answers': fields.function(_get_data, group_operator='avg', string='Avg. Answers', multi='avg_answers', method=True, type="integer"),
'perc_done': fields.function(_get_data, group_operator='avg', string='%Done', multi='perc_done', method=True, type="float"),
'perc_cancel': fields.function(_get_data, group_operator='avg', string='%Cancel', multi='perc_cancel', method=True, type="float"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@@ -104,7 +88,6 @@ class project_issue_report(osv.osv):
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'project_id':fields.many2one('project.project', 'Project',readonly=True),
'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"),
'user_id2losed': fields.date('Close Date', readonly=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True),
'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"),
'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True),
+13 -3
View File
@@ -145,6 +145,17 @@ class purchase_order(osv.osv):
res[purchase.id] = False
return res
STATE_SELECTION = [
('draft', 'Request for Quotation'),
('wait', 'Waiting'),
('confirmed', 'Waiting Supplier Ack'),
('approved', 'Approved'),
('except_picking', 'Shipping Exception'),
('except_invoice', 'Invoice Exception'),
('done', 'Done'),
('cancel', 'Cancelled')
]
_columns = {
'name': fields.char('Order Reference', size=64, required=True, select=True, help="unique number of the purchase order,computed automatically when the purchase order is created"),
'origin': fields.char('Source Document', size=64,
@@ -164,7 +175,7 @@ class purchase_order(osv.osv):
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]),
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True),
'state': fields.selection(STATE_SELECTION, 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True),
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'notes': fields.text('Notes'),
@@ -220,8 +231,7 @@ class purchase_order(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
state_dict = {'wait':'Waiting','confirmed':'Confirmed','approved':'Approved','except_picking': 'Shipping Exception','except_invoice': 'Invoice Exception','done': 'Done'}
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!') %_(eval(s['state'],state_dict)))
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!') % _(dict(purchase_order.STATE_SELECTION).get(s['state'])))
# TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
# automatically sending subflow.delete upon deletion
+10 -21
View File
@@ -71,14 +71,12 @@
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_All_Total_Detail">
<blockAlignment value="LEFT"/>
@@ -151,12 +149,12 @@
<td>
<para style="terp_default_9">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
<para style="terp_default_Bold_9">Shipping address :</para>
<para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="terp_default_9">[[ addr.partner_id.title or '' ]] [[ addr.partner_id.name ]]</para>
<para style="terp_default_9">[[ addr.title or '' ]] [[ addr.name ]]</para>
<para style="terp_default_9">[[ addr.street ]]</para>
<para style="terp_default_9">[[ addr.street2 or '' ]]</para>
<para style="terp_default_9">[[ addr.street2 or removeParentNode('para') ]]</para>
<para style="terp_default_9">[[ addr.zip or '' ]] [[ addr.city or '' ]]</para>
<para style="terp_default_9">[[ addr.state_id and addr.state_id.name or '' ]]</para>
<para style="terp_default_9">[[ addr.state_id and addr.state_id.name or removeParentNode('para') ]]</para>
<para style="terp_default_9">[[ addr.country_id and addr.country_id.name or '' ]]</para>
</td>
</tr>
@@ -172,11 +170,10 @@
</td>
<td>
<para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.street ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.street2 or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.street2 or removeParentNode('para') ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or removeParentNode('para')]]</para>
<para style="terp_default_9">[[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]]</para>
<para style="terp_default_9">
<font color="white"> </font>
@@ -260,7 +257,7 @@
</blockTable>
<section>
<para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para>
<blockTable colWidths="179.0,82.0,73.0,44.0,20.0,58.0,79.0" style="Table_Order_Pur_line_Content">
<blockTable colWidths="179.0,82.0,73.0,64.0,57.0,79.0" style="Table_Order_Pur_line_Content">
<tr>
<td>
<para style="terp_default_9">[[ line.name ]]</para>
@@ -272,10 +269,7 @@
<para style="terp_default_Centre_9">[[ formatLang( line.date_planned, date=True) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ line.product_uom.name ]]</para>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.price_unit ) ]]</para>
@@ -313,11 +307,6 @@
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Right_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
</section>
@@ -332,7 +321,7 @@
<para style="terp_default_9">Net Total :</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
</td>
</tr>
<tr>
@@ -345,7 +334,7 @@
<para style="terp_default_9">Taxes :</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
</td>
</tr>
<tr>
@@ -358,7 +347,7 @@
<para style="terp_default_Bold_9">Total :</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(o.amount_total ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
<para style="terp_default_Bold_9_Right">[[ formatLang(o.amount_total ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
</td>
</tr>
</blockTable>
-5
View File
@@ -31,18 +31,13 @@ class sale_report(osv.osv):
'date': fields.date('Date Order', readonly=True),
'date_confirm': fields.date('Date Confirm', readonly=True),
'shipped':fields.boolean('Shipped', readonly=True),
'paid':fields.float('Picked', readonly=True),
'shipped_qty_1':fields.integer('Shipped Qty', readonly=True),
'paid_qty':fields.float('Paid Qty', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'uom_id': fields.many2one('product.uom', 'Default Unit Of Measure', readonly=True),
'product_qty':fields.float('# of Qty', readonly=True),
'uom_name': fields.char('Default UoM', size=128, readonly=True),
'product_uom_qty':fields.float('# of Qty', readonly=True),
+4 -4
View File
@@ -111,8 +111,8 @@
<page string="Sale Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" required="1"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_order_id"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended"/>
<field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended"/>
<field name="project_id"
context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}"
@@ -387,13 +387,13 @@ to your configuration: from the sale order, from the pickings, etc.
<field name="invoiced"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
<separator colspan="4" string="Manual Designation"/>
<field colspan="4" name="name"/>
<field colspan="4" name="name" groups="base.group_extended"/>
<field name="price_unit"/>
<field name="discount"/>
<field name="type" groups="base.group_extended"/>
<field name="delay" groups="base.group_extended"/>
<field name="price_subtotal"/>
<field name="th_weight"/>
<field name="th_weight" groups="base.group_extended"/>
<separator colspan="4" string="Taxes"/>
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]" nolabel="1"/>
<separator colspan="4" string="States"/>
+2 -2
View File
@@ -3,7 +3,7 @@
<data>
<menuitem icon="terp-stock" id="menu_stock_root" name="Warehouse" sequence="5"/>
<menuitem id="menu_stock_warehouse_mgmt" name="Warehouse Management" parent="menu_stock_root" sequence="1"/>
<menuitem id="menu_stock_warehouse_mgmt" name="Warehouse Management" parent="menu_stock_root" sequence="1" groups="base.group_extended"/>
<menuitem id="menu_stock_products_moves" name="Products Moves" parent="menu_stock_root" sequence="2"/>
<menuitem id="menu_stock_product" name="Product" parent="menu_stock_root" sequence="6"/>
<menuitem action="product.product_normal_action" id="menu_stock_products_menu" parent="menu_stock_product" sequence="1"/>
@@ -1523,7 +1523,7 @@
<button name="%(stock.move_scrap)d"
string="Scrap Products" type="action"
icon="gtk-convert" context="{'scrap': True}"
states="draft,waiting,confirmed,assigned" />
states="draft,waiting,confirmed,assigned" groups="base.group_extended"/>
<field name="prodlot_id" groups="base.group_extended"/>
<button name="%(track_line)d" string="Split in production lots" type="action"
icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}"