[MERGE] merge with main branch

bzr revid: mra@mra-laptop-20100712110215-e0kn984vlu548m5l
bzr revid: mra@mra-laptop-20100712121547-cjfukqlgx68wabs8
This commit is contained in:
Mustufa Rangwala 2010-07-12 17:45:47 +05:30
commit fa45f92f09
32 changed files with 315 additions and 236 deletions

View File

@ -55,7 +55,7 @@
Now I will check that the new job is assigned properly to contact or not
-
!assert {model: res.partner.contact, id: res_partner_contact_williams0}:
- len(job_ids) > 2
- len(job_ids) >= 2
- |
In order to check contacts working at several addresses for different partners
I will create contact with 2 different addresses

View File

@ -70,6 +70,20 @@ class crm_opportunity(osv.osv):
self.log(cr, uid, id, message)
return res
def case_mark_lost(self, cr, uid, ids, *args):
"""Mark the case as lost: state = done and probability = 0%
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case Ids
@param *args: Tuple Value for additional Params
"""
res = self.write(cr, uid, ids, {'probability' : 0.0, 'state': 'done'})
for (id, name) in self.name_get(cr, uid, ids):
message = _('Opportunity ') + " '" + name + "' "+ _("is Lost.")
self.log(cr, uid, id, message)
return res
def case_cancel(self, cr, uid, ids, *args):
"""Overrides cancel for crm_case for setting probability
@param self: The object pointer
@ -80,9 +94,6 @@ class crm_opportunity(osv.osv):
"""
res = super(crm_opportunity, self).case_cancel(cr, uid, ids, args)
self.write(cr, uid, ids, {'probability' : 0.0})
for (id, name) in self.name_get(cr, uid, ids):
message = _('Opportunity ') + " '" + name + "' "+ _("is Lost.")
self.log(cr, uid, id, message)
return res
def case_open(self, cr, uid, ids, *args):

View File

@ -65,8 +65,11 @@
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
<group col="10" colspan="4">
<field name="state"/>
<button name="case_reset" string="Reset to New"
states="done,cancel" type="object"
icon="gtk-convert" />
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
@ -74,18 +77,18 @@
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
states="open,pending" type="object"
groups="base.group_extended"
icon="gtk-go-up" />
<button name="case_cancel" string="Mark Lost"
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-close" />
<button name="case_mark_lost" string="Mark Lost"
states="open,pending" type="object"
icon="gtk-cancel" />
<button name="case_close" string="Mark Won"
states="open,draft,pending" type="object"
states="open,pending" type="object"
icon="gtk-apply" />
<button name="case_reset" string="Reset to New"
states="done,cancel" type="object"
icon="gtk-convert" />
</group>
</page>
<page string="Lead">
@ -224,15 +227,15 @@
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
<button name="case_pending" string="Pending"
states="open,draft" type="object"
icon="gtk-media-pause" />
<button name="case_cancel" string="Lost"
states="draft,open,pending" type="object"
<button name="case_mark_lost" string="Lost"
states="open,pending" type="object"
icon="gtk-cancel" />
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
</tree>
</field>
</record>

View File

@ -45,42 +45,6 @@ class crm_claim_report(osv.osv):
_name = "crm.claim.report"
_auto = False
_description = "CRM Claim Report"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
""" @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case and section Datas IDs
@param context: A standard dictionary for contextual values """
res = {}
state_perc = 0.0
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
return res
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
@ -88,9 +52,6 @@ class crm_claim_report(osv.osv):
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'nbr': fields.integer('# of Cases', 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"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -137,9 +98,6 @@ class crm_claim_report(osv.osv):
c.company_id,
c.categ_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
c.priority as priority,
c.type_id as type_id,
date_trunc('day',c.create_date) as create_date,

View File

@ -36,42 +36,6 @@ class crm_fundraising_report(osv.osv):
_name = "crm.fundraising.report"
_auto = False
_description = "CRM Fundraising Report"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
""" @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case and section Datas IDs
@param context: A standard dictionary for contextual values """
res = {}
state_perc = 0.0
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
return res
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
@ -79,9 +43,6 @@ class crm_fundraising_report(osv.osv):
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'nbr': fields.integer('# of Cases', 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"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -123,9 +84,6 @@ class crm_fundraising_report(osv.osv):
c.company_id,
c.partner_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,

View File

@ -1,6 +1,61 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<record id="crm_helpdesk_wheretodownloadopenerp0" model="crm.helpdesk">
<field model="res.partner.canal" name="canal_id" search="[('name', '=', u'E-mail')]"/>
<field name="som" ref="base.som_normal"/>
<field eval="1" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">3</field>
<field name="state">draft</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="date">2010-07-04 11:10:36</field>
<field name="name">Download old version of OpenERP? </field>
<field eval="&quot;Is there any link to download old versions of OpenERP?&quot;" name="description"/>
</record>
</data>
</openerp>
<record id="crm_helpdesk_cannotabletoconnecttoserver0" model="crm.helpdesk">
<field model="res.partner.canal" name="canal_id" search="[('name', '=', u'website')]"/>
<field name="som" ref="base.som_fury"/>
<field eval="1" name="active"/>
<field name="user_id" ref="base.user_demo"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">3</field>
<field name="state">draft</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="date">2010-07-12 11:12:09</field>
<field name="name">Can not able to connect to Server</field>
<field eval="&quot;I am not able to connect Server, Can anyone help?&quot;" name="description"/>
</record>
<record id="crm_helpdesk_documentationforcrm0" model="crm.helpdesk">
<field model="res.partner.canal" name="canal_id" search="[('name', '=', u'phone')]"/>
<field name="som" ref="base.som_happy"/>
<field eval="1" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="date">2010-07-12 11:13:10</field>
<field name="name">Documentation for CRM?</field>
<field eval="&quot;Can anyone give link of document for CRM&quot;" name="description"/>
</record>
<record id="crm_helpdesk_howtocreateanewmodule0" model="crm.helpdesk">
<field model="res.partner.canal" name="canal_id" search="[('name', '=', u'E-mail')]"/>
<field name="partner_address_id" ref="base.res_partner_address_9"/>
<field name="som" ref="base.som_normal"/>
<field eval="1" name="active"/>
<field name="partner_id" ref="base.res_partner_2"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">3</field>
<field name="state">draft</field>
<field name="date">2010-07-12 11:15:17</field>
<field name="name">How to create a new module</field>
<field eval="&quot;How can I create new module in OpenERP?&quot;" name="description"/>
</record>
</data>
</openerp>

View File

@ -66,8 +66,7 @@
</group>
<separator colspan="4" string="Notes"/>
<field name="description" colspan="4"
nolabel="1" widget="text_tag" readonly="1" />
<field name="description" colspan="4" nolabel="1" />
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1"/>

View File

@ -38,51 +38,12 @@ class crm_helpdesk_report(osv.osv):
_description = "Helpdesk report after Sales Services"
_auto = False
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
""" @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case and section Datas IDs
@param context: A standard dictionary for contextual values """
res = {}
state_perc = 0.0
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
return res
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'nbr': fields.integer('# of Cases', 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"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -122,9 +83,6 @@ class crm_helpdesk_report(osv.osv):
c.priority,
c.date_deadline,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_helpdesk c

View File

@ -33,6 +33,7 @@
'depends': ['base', 'hr'],
'update_xml': [
'security/hr_security.xml',
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_wizard.xml',
'hr_attendance_report.xml',

View File

@ -2,5 +2,5 @@
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr_attendance.group_hr_attendance",1,0,0,0
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_manager",1,1,1,1
"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr_attendance.group_hr_attendance",1,1,1,1
"access_hr_attendance_employee","hr employee attendance sign in out","hr.model_hr_employee","hr_attendance.group_hr_attendance",1,0,0,0
"access_hr_employee_attendance","hr employee attendance sign in out","hr.model_hr_employee","hr_attendance.group_hr_attendance",1,0,0,0
"access_hr_attendance_resource","hr resource attendance sign in out","resource.model_resource_resource","hr_attendance.group_hr_attendance",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_action_reason_employee hr action reason employee model_hr_action_reason hr_attendance.group_hr_attendance 1 0 0 0
3 access_hr_action_reason_employee hr action reason employee model_hr_action_reason hr.group_hr_manager 1 1 1 1
4 access_hr_attendance_employee hr attendance employee model_hr_attendance hr_attendance.group_hr_attendance 1 1 1 1
5 access_hr_attendance_employee access_hr_employee_attendance hr employee attendance sign in out hr.model_hr_employee hr_attendance.group_hr_attendance 1 0 0 0
6 access_hr_attendance_resource hr resource attendance sign in out resource.model_resource_resource hr_attendance.group_hr_attendance 1 0 0 0

View File

@ -50,7 +50,7 @@ class hr_recruitment_report(osv.osv):
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 \
cr.execute("select count(*) from crm_lead 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

View File

@ -2,3 +2,4 @@
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","hr.group_hr_user",1,1,1,1
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","hr.group_hr_user",1,1,1,0
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","hr.group_hr_user",1,0,0,0
"access_product_product_user","product.product user","product.model_product_product","hr.group_hr_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_analytic_timesheet hr.analytic.timesheet model_hr_analytic_timesheet hr.group_hr_user 1 1 1 1
3 access_hr_account_analytic_line account.account.analytic.line account.model_account_analytic_line hr.group_hr_user 1 1 1 0
4 access_account_analytic_journal account.account.analytic.journal account.model_account_analytic_journal hr.group_hr_user 1 0 0 0
5 access_product_product_user product.product user product.model_product_product hr.group_hr_user 1 0 0 0

View File

@ -99,25 +99,11 @@
self.check_state(cr, uid, [ref("hr_employee_fracline1")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]})
- |
I select start date and Perform start work on project.
-
!record {model: hr.sign.in.project, id: hr_sign_in_project_francline0}:
emp_id: 'hr_employee_fracline1'
name: Francline
server_date: '2010-06-08 19:50:54'
state: absent
- |
I click on "Start Working" button of this wizard to start work on Project.
-
!python {model: hr.sign.in.project}: |
uid = ref('res_users_user0')
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Francline")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_in_project_francline0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
#self.sign_in_result(cr, uid, [ref("hr_sign_in_project_francline0")], context)
new_id = self.create(cr, uid, {'emp_id': 'hr_employee_fracline1', 'name': 'Francline', 'server_date': '2010-06-08 19:50:54', 'state': 'absent'})
self.sign_in_result(cr, uid, [new_id], context)
- |
My work is done and I want to stop work.for that I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard.
@ -125,33 +111,31 @@
-
!python {model: hr.sign.in.project}: |
uid = ref('res_users_user0')
self.check_state(cr, uid, [ref("hr_sign_in_project_francline0")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
ids = self.search(cr, uid, [('emp_id', '=', ref('hr_employee_fracline1')),('name', '=', 'Francline')])
self.check_state(cr, uid, ids, {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
})
- |
This will Open "hr sign out project" form. I select analytical project2 development account.
-
!record {model: hr.sign.out.project, id: hr_sign_out_project_francline0}:
account_id: account.analytic_project_2_development
analytic_amount: 7.0
date: '2010-05-25 16:40:00'
date_start: '2010-06-05 16:37:00'
info: Create Yaml for hr module
name: Francline
server_date: '2010-06-09 16:40:15'
state: present
-
For that I Creating a analytic account.
-
!record {model: account.analytic.account, id: account_analytic_account_project0}:
company_id: base.main_company
name: Project2
parent_id: account.analytic_root
quantity_max: 0.0
state: open
- |
My work for this project is over and I stop work by click on "Stop Work" button of this wizard.
-
!python {model: hr.sign.out.project}: |
import time
from datetime import datetime, date, timedelta
uid = ref('res_users_user0')
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Francline")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_out_project_francline0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
#self.sign_out_result_end(cr, uid, [ref('hr_sign_out_project_francline0')])
new_id = self.create(cr, uid, {'account_id': ref('account_analytic_account_project0'), 'analytic_amount': 7.0, 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S'), 'date_start': '2010-06-05 16:37:00', 'info': 'Create Yaml for hr module', 'name': 'Francline', 'server_date': '2010-06-09 16:40:15', 'state': 'absent'})
self.sign_out_result_end(cr, uid, [new_id], context)
- |
I can see employee timesheet for particular month using "Employee Timesheet" report.

View File

@ -1,6 +1,26 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Idea Categories Search View-->
<record model="ir.ui.view" id="view_idea_category_search">
<field name="name">idea.category.search</field>
<field name="model">idea.category</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Ideas Categories">
<group col="10" colspan="4">
<field name="name" string="Category"/>
<field name="parent_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="14">
<filter string="Parent Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'parent_id'}"/>
</group>
</search>
</field>
</record>
<!-- Idea Category Form View -->
<menuitem name="Tools" id="base.menu_tools" icon="STOCK_PREFERENCES" sequence="28"/>
@ -41,6 +61,7 @@
<field name="res_model">idea.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_idea_category_search"/>
</record>
<menuitem name="Configuration" parent="base.menu_tools"

View File

@ -6,3 +6,4 @@
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1
"access_idea_comment_user","idea.comment","model_idea_comment","base.group_user",1,1,1,0
"access_report_vote","report.vote","model_report_vote","base.group_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
6 access_idea_category_system idea.category system model_idea_category base.group_system 1 1 1 1
7 access_idea_comment idea.comment model_idea_comment base.group_system 1 1 1 1
8 access_idea_comment_user idea.comment model_idea_comment base.group_user 1 1 1 0
9 access_report_vote report.vote model_report_vote base.group_user 1 1 1 1

View File

@ -69,6 +69,7 @@
'wizard/change_production_qty_view.xml',
'wizard/mrp_price_view.xml',
'wizard/mrp_workcenter_load_view.xml',
'wizard/mrp_change_standard_price_view.xml',
# 'wizard/mrp_track_prod_view.xml',
'mrp_view.xml',
'mrp_wizard.xml',

View File

@ -63,11 +63,12 @@ class product_product(osv.osv):
"""
res = super(product_product, self).do_change_standard_price(cr, uid, ids, datas, context=context)
bom_obj = self.pool.get('mrp.bom')
change = context.get('change_parent_price', False)
def _compute_price(bom):
price = 0.0
if bom.bom_id :
if bom.bom_id.bom_lines :
for bom_line in bom.bom_id.bom_lines :
if bom.bom_id and change:
if bom.bom_id.bom_lines:
for bom_line in bom.bom_id.bom_lines:
prod_price = self.read(cr, uid, bom_line.product_id.id, ['standard_price'])['standard_price']
price += bom_line.product_qty * prod_price

View File

@ -265,10 +265,10 @@
<para style="terp_default_Centre_8">[[ formatLang(o.date_planned, date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_ref or removeParentNode('para')]]</para>
<para style="terp_default_Centre_8">[[ 'sale_ref' in o._columns.keys() and o.sale_ref or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_name or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">[[ 'sale_name' in o._columns.keys() and o.sale_name or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -24,6 +24,7 @@ import mrp_price
import mrp_workcenter_load
#import mrp_track_prod
import change_production_qty
import mrp_change_standard_price
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 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.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class change_standard_price(osv.osv_memory):
_inherit = "stock.change.standard.price"
_description = "Change Standard Price"
_columns = {
'change_parent_price': fields.boolean('Change Parent Price'),
}
def change_price(self, cr, uid, ids, context):
""" Changes the Standard Price of Parent Product according to BoM
only when the field 'change_parent_price' is True.
And creates an account move accordingly.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return:
"""
res = self.browse(cr, uid, ids)
context.update({'change_parent_price': res[0].change_parent_price})
return super(change_standard_price, self).change_price(cr, uid, ids, context=context)
change_standard_price()

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_change_standard_price_inherit" model="ir.ui.view">
<field name="name">Change Standard Price (Inherit)</field>
<field name="model">stock.change.standard.price</field>
<field name="inherit_id" ref="stock.view_change_standard_price"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="new_price" position="after">
<field name="change_parent_price"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -4,6 +4,41 @@
<menuitem id="menu_mrp_planning" name="Planning"
parent="base.menu_mrp_root" sequence="2"
groups="base.group_extended"/>
<record id="mrp_production_form_inherit_view" model="ir.ui.view">
<field name="name">mrp.production.form.inherit</field>
<field name="model">mrp.production</field>
<field name="type">form</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='workcenter_lines']/form/field[@name='hour']" position="after">
<group colspan="8" col="8">
<field name="state"/>
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert"/>
<button name="button_start_working" string="Start" states="draft" icon="gtk-go-forward"/>
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause"/>
<button name="button_cancel" string="Cancel" states="draft,startworking" icon="gtk-cancel"/>
<button name="button_pause" string="Pause" states="startworking" icon="gtk-media-pause"/>
<button name="button_done" string="Finished" states="startworking" icon="gtk-ok"/>
</group>
</xpath>
</field>
</record>
<record id="mrp_production_form_inherit_view2" model="ir.ui.view">
<field name="name">mrp.production.form.inherit2</field>
<field name="model">mrp.production</field>
<field name="type">form</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='workcenter_lines']/tree/field[@name='hour']" position="after">
<field name="state"/>
<button name="button_start_working" string="Start working" states="draft,pause" icon="gtk-go-forward"/>
<button name="button_done" string="Finished" states="startworking" icon="gtk-jump-to"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="mrp_production_workcenter_tree_view_inherit">
<field name="name">mrp.production.workcenter.line.tree</field>
<field name="model">mrp.production.workcenter.line</field>
@ -150,7 +185,7 @@
</record>
<!-- Action for tree view of workcenter line -->
<!-- Action for All Operations -->
<record model="ir.actions.act_window" id="mrp_production_wc_action_form">
<field name="name">Work Orders</field>
@ -158,21 +193,9 @@
<field name="res_model">mrp.production.workcenter.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,gantt,calendar,graph</field>
<field name="domain">[('id','=',active_id)]</field>
<field name="search_view_id" ref="view_mrp_production_workcenter_form_view_filter"/>
</record>
<!-- Action for All Operations -->
<record model="ir.actions.act_window" id="mrp_production_wc_action">
<field name="name">All Work Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production.workcenter.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph,calendar,gantt</field>
</record>
<record model="ir.actions.act_window" id="mrp_production_wc_action_planning">
<field name="name">Work Orders Planning</field>
<field name="type">ir.actions.act_window</field>

View File

@ -50,7 +50,7 @@
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_testtender1}
-
I launch he scheduler to compute all procurements, and planify all requisitions orders.
I launch the scheduler to compute all procurements, and planify all requisitions orders.
-
!python {model: procurement.order.compute.all}: |
proc_obj = self.pool.get('procurement.order')
@ -109,4 +109,4 @@
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
state=self.browse(cr,uid,purchase_id).state
assert (state=='cancel')
assert (state=='cancel')

View File

@ -251,7 +251,7 @@ class sale_order(osv.osv):
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)]}),
'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."),
'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Picking', readonly=True, help="This is the list of picking list that have been generated for this invoice"),
'shipped': fields.boolean('Picked', readonly=True, help="It indicates that a picking has been done.It will set to True if the ordered quantities are available and the picking is done.If the ordered quantities are not available it generates a Purchase/Manufacturing order.Unless its Picking and Purchase/Manufacturing order are not in the done state it wont be set to True"),
'shipped': fields.boolean('Picked', readonly=True, help="It indicates that a picking has been done. It will be set to True if the ordered quantities are available and the picking is done. If the ordered quantities are not available it generates a Purchase/Manufacturing order. Unless its Picking and Purchase/Manufacturing order are not in the done state it wont be set to True"),
'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'),
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoiced': fields.function(_invoiced, method=True, string='Paid',
@ -1198,4 +1198,4 @@ class sale_config_picking_policy(osv.osv_memory):
self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
sale_config_picking_policy()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -87,4 +87,4 @@
!python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','=','exception'),('product_id','=',ref('sale.product_product_table0'))])
assert proc_ids, _('No Procurements are in exception state for the table!')
assert not proc_ids, _('There is no procurement in exception state!')

View File

@ -54,8 +54,8 @@
<hpaned>
<child1>
<action
string="My Opportunities"
name="%(crm.act_my_leads)d"
string="My Open Opportunities"
name="%(crm.act_my_oppor)d"
colspan="4"
height="150"
width="510"/>
@ -74,8 +74,8 @@
</child1>
<child2>
<action
string="Revenues by stage"
name="%(crm.act_my_leads_stage)d"
string="Revenue by stage"
name="%(crm.act_my_oppor_stage)d"
colspan="4"/>
<action
string="My Sales Pipeline"

View File

@ -48,14 +48,14 @@ class sale_journal(osv.osv):
'user_id': fields.many2one('res.users', 'Responsible', required=True),
'date': fields.date('Journal date', required=True),
'date_created': fields.date('Creation date', readonly=True, required=True),
'date_validation': fields.date('Validation date', readonly=True),
'sale_stats_ids': fields.one2many("sale.journal.report", "journal_id", 'Sale Stats', readonly=True),
'date_close': fields.date('Close date ', readonly=True),
'sale_stats_ids': fields.one2many("sale.journal.report", "journal_id", 'Sale stats', readonly=True),
'state': fields.selection([
('draft','Draft'),
('open','Open'),
('cancel','Cancel'),
('confirm','Confirm'),
('done','Done'),
('close','Close'),
], 'State', required=True, readonly=True),
'note': fields.text('Note'),
}
@ -105,12 +105,17 @@ class sale_journal(osv.osv):
return True
def button_close(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done', 'date_validation':time.strftime('%Y-%m-%d')})
self.write(cr, uid, ids, {'state':'close', 'date_close':time.strftime('%Y-%m-%d')})
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale orders of Journal') + " '" + name + "' "+ _("is closed")
self.log(cr, uid, id, message)
return True
def button_reset(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'draft'})
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale orders of Journal') + " '" + name + "' "+ _("is in draft state")
self.log(cr, uid, id, message)
return True
def copy(self, cr, uid, id, default=None, context=None):
"""Overrides orm copy method
@param self: The object pointer
@ -137,13 +142,14 @@ class picking_journal(osv.osv):
'user_id': fields.many2one('res.users', 'Responsible', required=True),
'date': fields.date('Journal date', required=True),
'date_created': fields.date('Creation date', readonly=True, required=True),
'date_validation': fields.date('Validation date', readonly=True),
'date_close': fields.date('Close date', readonly=True),
'picking_stats_ids': fields.one2many("sale.journal.picking.report", "journal_id", 'Journal Stats', readonly=True),
'state': fields.selection([
('draft','Draft'),
('open','Open'),
('cancel','Cancel'),
('done','Done'),
('close','Close'),
('confirm','Confirm'),
], 'Creation date', required=True, readonly=True),
'note': fields.text('Note'),
}
@ -171,7 +177,24 @@ class picking_journal(osv.osv):
return True
def button_close(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done', 'date_validation':time.strftime('%Y-%m-%d')})
self.write(cr, uid, ids, {'state':'close', 'date_close':time.strftime('%Y-%m-%d')})
return True
def button_reset(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'draft'})
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale orders of Journal') + " '" + name + "' "+ _("is in draft state")
self.log(cr, uid, id, message)
return True
def button_picking_confirm(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'confirm'})
for id in ids:
pick_ids = self.pool.get('stock.picking').search(cr, uid, [('journal_id','=',id)])
for pickid in pick_ids:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_confirm', cr)
return True
def copy(self, cr, uid, id, default=None, context=None):
@ -213,7 +236,7 @@ res_partner()
class picking(osv.osv):
_inherit = "stock.picking"
_columns = {
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', domain=[('state','!=', 'done')]),
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', domain=[('state','!=', 'close')],help="Picking Journal"),
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
}
@ -222,7 +245,7 @@ picking()
class sale(osv.osv):
_inherit = "sale.order"
_columns = {
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal', domain=[('state','!=', 'done')]),
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal', domain=[('state','not in', ('done', 'draft''cancel'))]),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
}
def action_ship_create(self, cr, uid, ids, *args):

View File

@ -56,7 +56,7 @@
<field name="user_id" select="1"/>
<field name="date" select="1"/>
<field name="date_created" select="1"/>
<field name="date_validation" select="1"/>
<field name="date_close" select="1"/>
</group>
<notebook colspan="4">
<page string="Sales">
@ -78,10 +78,10 @@
<field name="state"/>
<group col="6" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open,confirm" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open,cancel" type="object" icon="gtk-convert"/>
<button string="Confirm Sales" name="button_sale_confirm" states="draft,open" type="object" icon="gtk-execute"/>
<button string="Cancel Sales" name="button_sale_cancel" states="draft,open,confirm" type="object" icon="gtk-cancel"/>
<button string="Confirm Sales" name="button_sale_confirm" states="open" type="object" icon="gtk-execute"/>
<button name="button_close" string="Close Journal" states="confirm,open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="cancel" type="object" icon="gtk-convert"/>
<button string="Cancel Sales" name="button_sale_cancel" states="close,draft,open,confirm" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@ -378,7 +378,7 @@
<newline/>
<field name="date" select="1"/>
<field name="date_created" select="1"/>
<field name="date_validation" select="1"/>
<field name="date_close" select="1"/>
</group>
<notebook colspan="4">
<page string="Picking">
@ -391,9 +391,10 @@
<field name="state"/>
<group col="6" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open,cancel" type="object" icon="gtk-convert"/>
<button string="Cancel Picking" name="button_picking_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
<button string="Confirm Picking" name="button_picking_confirm" states="open" type="object" icon="gtk-execute"/>
<button name="button_reset" string="Set to Draft" states="cancel" type="object" icon="gtk-convert"/>
<button name="button_close" string="Close Journal" states="confirm,open" type="object" icon="gtk-close"/>
<button string="Cancel Picking" name="button_picking_cancel" states="close,draft,open,confirm" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@ -474,5 +475,19 @@
<field name="object" eval="True"/>
</record>
<record id="view_sale_journal_search_form" model="ir.ui.view">
<field name="name">sale.order.journal.search</field>
<field name="model">sale.order</field>
<field name="type">search</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<xpath expr="/search/group[@string='Group By...']/filter[@string='Salesman']" position="after">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -276,9 +276,9 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_5cm_Above_Space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( line.state == 'assigned' or line.state == 'done' or line.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_5cm_Above_Space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="197.0,68.0,61.0,57,46.0,26.0,74.0" style="Move_Line_Content_Other_State">

View File

@ -268,9 +268,9 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_5cm_Above_Space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( line.state == 'assigned' or line.state == 'done' or line.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_5cm_Above_Space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="257.0,57.0,62.0,46.0,26.0,74.0" style="Move_Line_Content_Other_State">

View File

@ -43,7 +43,7 @@ This module may be useful for different purposes:
'demo_xml': [],
'installable': True,
'test':[
# 'test/stock_location.yml'
'test/stock_location.yml'
],
'active': False,
'certificate': '0046505115101',

View File

@ -159,7 +159,7 @@
country_id: base.in
partner_id: res_partner_microlinktechnologies0
street: Ash House, Ash Road
title: Ms.
title: base.res_partner_title_miss
-