bzr revid: hmo@tinyerp.com-20100820114728-3drnkvurtazbee6a
This commit is contained in:
Harry (OpenERP)
2010-08-20 17:17:28 +05:30
26 changed files with 229 additions and 132 deletions
+1 -1
View File
@@ -52,6 +52,7 @@ module named account_voucher.
'wizard/account_statement_from_invoice_view.xml',
'wizard/account_move_bank_reconcile_view.xml',
'wizard/account_use_model_view.xml',
'account_installer.xml',
'account_view.xml',
'account_report.xml',
'wizard/account_report_common_view.xml',
@@ -108,7 +109,6 @@ module named account_voucher.
'process/supplier_invoice_process.xml',
'sequence_view.xml',
'company_view.xml',
'account_installer.xml',
'report/account_invoice_report_view.xml',
'report/account_entries_report_view.xml',
'report/account_report_view.xml',
+2
View File
@@ -1949,12 +1949,14 @@ class account_model(osv.osv):
'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"),
'ref': fields.char('Reference', size=64),
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'),
'legend' :fields.text('Legend', readonly=True, size=100),
}
_defaults = {
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
}
def generate(self, cr, uid, ids, datas={}, context={}):
move_ids = []
+3 -1
View File
@@ -1551,6 +1551,7 @@
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="journal_id" select="1"/>
<field name="company_id" select="1" widget='selection'/>
<field colspan="4" nolabel="1" name="lines_id" height="250" widget="one2many_list"/>
<separator string="Legend" colspan="4"/>
<field name="legend" colspan="4" nolabel="1"/>
@@ -1568,6 +1569,7 @@
<tree string="Entry Model">
<field name="name"/>
<field name="journal_id"/>
<field name="company_id"/>
</tree>
</field>
</record>
@@ -2234,7 +2236,7 @@
<field name="target">new</field>
</record>
<menuitem parent="account.account_template_folder" action="action_wizard_multi_chart" id="menu_wizard"/>
<menuitem name="New Company Financial Setting" parent="account.account_template_folder" action="account.action_account_configuration_installer" id="menu_wizard"/>
<record id="account_account_graph" model="ir.ui.view">
<field name="name">account.account.graph</field>
@@ -222,4 +222,18 @@
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="account_fiscal_position_comp_rule" model="ir.rule">
<field name="name">Account fiscal position company rule</field>
<field model="ir.model" name="model_id" ref="model_account_fiscal_position"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
<record id="account_model_comp_rule" model="ir.rule">
<field name="name">Account model company rule</field>
<field model="ir.model" name="model_id" ref="model_account_model"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
</data></openerp>
+4 -1
View File
@@ -46,9 +46,12 @@ class payment_mode(osv.osv):
required=True,help='Bank Account for the Payment Mode'),
'journal': fields.many2one('account.journal', 'Journal', required=True,
domain=[('type', '=', 'cash')], help='Cash Journal for the Payment Mode'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'type': fields.many2one('payment.type', 'Payment type', required=True, help='Select the Payment Type for the Payment Mode.'),
}
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
}
def suitable_bank_types(self, cr, uid, payment_code=None, context={}):
"""Return the codes of the bank type that are suitable
for the given payment type code"""
@@ -69,6 +69,7 @@
<tree string="Payment Mode">
<field name="name"/>
<field name="journal"/>
<field name="company_id"/>
</tree>
</field>
</record>
@@ -82,6 +83,7 @@
<field name="type"/>
<field name="journal"/>
<field name="bank_id"/>
<field name="company_id" select="1" widget='selection'/>
</form>
</field>
</record>
@@ -6,5 +6,12 @@
<field name="name">Accounting / Payments</field>
</record>
<record id="payment_mode_comp_rule" model="ir.rule">
<field name="name">Payment Mode company rule</field>
<field model="ir.model" name="model_id" ref="model_payment_mode"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
</data>
</openerp>
+2 -1
View File
@@ -29,7 +29,8 @@
"description": """Module for defining analytic accounting object.
""",
"init_xml" : [],
"update_xml": ["security/ir.model.access.csv",
"update_xml": ['security/analytic_security.xml',
"security/ir.model.access.csv",
],
'demo_xml': [
],
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp><data>
<record id="analytic_comp_rule" model="ir.rule">
<field name="name">analytic company rule</field>
<field model="ir.model" name="model_id" ref="model_account_analytic_account"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
</data></openerp>
+30 -11
View File
@@ -962,6 +962,19 @@ class calendar_event(osv.osv):
return {'value': value}
def unlink_events(self, cr, uid, ids, context=None):
"""
This function deletes event which are linked with the event with recurrent_uid
(Removes the events which refers to the same UID value)
"""
if not context:
context = {}
for event_id in ids:
cr.execute('select id from %s where recurrent_uid=%s' % (self._table, event_id))
r_ids = map(lambda x: x[0], cr.fetchall())
self.unlink(cr, uid, r_ids, context=context)
return True
def _set_rrulestring(self, cr, uid, id, name, value, arg, context=None):
"""
Sets values of fields that defines event recurrence from the value of rrule string
@@ -1074,6 +1087,10 @@ class calendar_event(osv.osv):
else:
result[event] = self.compute_rule_string(cr, uid, {'freq': datas.get('rrule_type').upper(), 'interval': 1}, context=context)
for id, myrule in result.items():
#Remove the events generated from recurrent event
if not myrule:
self.unlink_events(cr, uid, [id], context=context)
return result
_columns = {
@@ -1545,23 +1562,25 @@ true, it will allow you to hide the event alarm information without removing it.
@return: True
"""
res = False
for event_id in ids:
for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate'], context=context):
event_id = event_datas['id']
if isinstance(event_id, (int, long)):
res = super(calendar_event, self).unlink(cr, uid, event_id)
res = super(calendar_event, self).unlink(cr, uid, event_id, context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
continue
event_id, date_new = event_id.split('-')
event_id = [int(event_id)]
for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context):
if record['rrule']:
self.unlink_events(cr, uid, [event_id], context=context)
else:
str_event, date_new = event_id.split('-')
event_id = int(str_event)
if event_datas['rrule']:
# Remove one of the recurrent event
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (record['exdate'] and (record['exdate'] + ',') or '') + date_new
res = self.write(cr, uid, event_id, {'exdate': exdate})
exdate = (event_datas['exdate'] and (event_datas['exdate'] + ',') or '') + date_new
res = self.write(cr, uid, [event_id], {'exdate': exdate})
else:
res = super(calendar_event, self).unlink(cr, uid, event_id)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name)
res = super(calendar_event, self).unlink(cr, uid, [event_id], context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
self.unlink_events(cr, uid, [event_id], context=context)
return res
def create(self, cr, uid, vals, context=None):
+2 -2
View File
@@ -22,7 +22,7 @@
{
'name': 'Integrated Document Management System',
'version': '1.99',
'version': '1.1',
'category': 'Generic Modules/Others',
'description': """This is a complete document management system:
* User Authentication
@@ -57,7 +57,7 @@
],
'installable': True,
'active': False,
'certificate': None,
'certificate': '0070515416461',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -1
View File
@@ -72,10 +72,11 @@
<field name="res_model">hr.department</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_department_filter"/>
<field name="help">Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc.</field>
</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="menu_hr_main" sequence="5"/>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6"/>
<record model="ir.ui.view" id="view_users_form_inherit">
<field name="name">res.users.form</field>
+2
View File
@@ -145,6 +145,7 @@
<field name="domain">[]</field>
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
<field name="help">The employee directory contains all data related to your employees: from their photo up to their hourly estimated costs for the timesheets. Employees are managed by departments and can be linked to users to manage their access rights.</field>
</record>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>
@@ -394,6 +395,7 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_job_filter"/>
<field name="context">{'search_default_Current':1}</field>
<field name="help">Job Positions are used to define the jobs, the requirements. You can attach a survey to a job position. This survey will be used in the recruitement process to evaluate the applicants for this job position.</field>
</record>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root" groups="base.group_hr_manager,base.group_system"/>
@@ -72,6 +72,7 @@
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_employee":1}</field>
<field name="search_view_id" ref="view_hr_attendance_filter" />
<field name="help">Time Tracking functionality aims to manage employee's attendances on the basis of the actions (Sign in/Sign out) performed by them. You can also link this to an attendance machine using OpenERP's webservices features.</field>
</record>
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="3"/>
@@ -19,7 +19,7 @@
</record>
<record id="action_hr_attendance_month" model="ir.actions.act_window">
<field name="name">Attendances by month</field>
<field name="name">Attendances By Month</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.attendance.month</field>
<field name="view_type">form</field>
@@ -30,7 +30,7 @@
<record model="ir.values" id="hr_attendance_month_values">
<field name="model_id" ref="hr.model_hr_employee" />
<field name="object" eval="1" />
<field name="name">Attendances by month</field>
<field name="name">Attendances By Month</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_attendance_month'))" />
<field name="key">action</field>
+6 -6
View File
@@ -36,11 +36,11 @@ class hr_evaluation_plan(osv.osv):
'month_first': fields.integer('First Evaluation After'),
'month_next': fields.integer('Next Evaluation After'),
'active': fields.boolean('Active')
}
}
_defaults = {
'active': True,
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
}
}
hr_evaluation_plan()
class hr_evaluation_plan_phase(osv.osv):
@@ -131,7 +131,7 @@ class hr_employee(osv.osv):
evaluation_date=(dt.ISO.ParseAny(evaluation_date)+ dt.RelativeDateTime(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d')
flag = True
if ids and flag:
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context)
obj_evaluation.create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context)
return {'value': {'evaluation_date': evaluation_date}}
def create(self, cr, uid, vals, context=None):
@@ -139,7 +139,7 @@ class hr_employee(osv.osv):
context = {}
id = super(hr_employee, self).create(cr, uid, vals, context=context)
if vals.get('evaluation_plan_id', False):
obj_evaluation.create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
self.pool.get('hr_evaluation.evaluation').create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
return id
hr_employee()
@@ -289,10 +289,10 @@ class hr_evaluation_interview(osv.osv):
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True),
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
}
}
_defaults = {
'is_evaluation': True,
}
}
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
if context is None:
@@ -260,6 +260,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
<field name="help">Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evalautions. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.</field>
</record>
<menuitem name="Evaluation" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
@@ -343,6 +344,7 @@
<field name="domain">[('is_evaluation' ,'=', True)]</field>
<field name="context">{"search_default_todo":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
<field name="help">Interview Requests are generated automatically by OpenERP according to employees evaluation plan. Each user receives automatic emails and requests to perform evaluation of their collegues periodically.</field>
</record>
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"
+1
View File
@@ -164,6 +164,7 @@
<field name="view_type">form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
<field name="help">The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.</field>
</record>
<menuitem id="next_id_49" name="Expenses" sequence="4" parent="hr.menu_hr_root"/>
+42 -42
View File
@@ -1,52 +1,52 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<!-- Casual leave -->
<record model="hr.holidays.status" id="holiday_status_cl">
<field name="name">Casual Leave</field>
<field name="double_validation">True</field>
<field name="color_name">black</field>
</record>
<!-- Casual leave -->
<record model="hr.holidays.status" id="holiday_status_cl">
<field name="name">Casual Leave</field>
<field name="double_validation">True</field>
<field name="color_name">black</field>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_allocation_cl">
<field name="name">Casual Leave for Fabien Pinckaers</field>
<field name="holiday_status_id" ref="holiday_status_cl"/>
<field name="type">add</field>
<field name="number_of_days_temp">12</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_allocation_cl">
<field name="name">Casual Leave for Fabien Pinckaers</field>
<field name="holiday_status_id" ref="holiday_status_cl"/>
<field name="type">add</field>
<field name="number_of_days_temp">12</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_cl">
<field name="name">Trip with Family</field>
<field name="holiday_status_id" ref="holiday_status_cl"/>
<field name="date_from">2010-01-04 08:00</field>
<field name="date_to">2010-01-06 18:00</field>
<field name="type">remove</field>
<field name="number_of_days_temp">3</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_cl">
<field name="name">Trip with Family</field>
<field name="holiday_status_id" ref="holiday_status_cl"/>
<field eval="time.strftime('%Y-%m-01')" name="date_from"/>
<field eval="time.strftime('%Y-%m-03')" name="date_to"/>
<field name="type">remove</field>
<field name="number_of_days_temp">3</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<!-- Sick leave -->
<record model="hr.holidays.status" id="holiday_status_sl">
<field name="name">Sick Leave</field>
<field name="limit">True</field>
<field name="color_name">red</field>
</record>
<!-- Sick leave -->
<record model="hr.holidays.status" id="holiday_status_sl">
<field name="name">Sick Leave</field>
<field name="limit">True</field>
<field name="color_name">red</field>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_sl">
<field name="name">Doctor Appointment</field>
<field name="holiday_status_id" ref="holiday_status_sl"/>
<field name="date_from">2010-02-01 00:00</field>
<field name="date_to">2010-02-03 08:00</field>
<field name="type">remove</field>
<field name="state">draft</field>
<field name="number_of_days_temp">3</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_sl">
<field name="name">Doctor Appointment</field>
<field name="holiday_status_id" ref="holiday_status_sl"/>
<field eval="time.strftime('%Y-%m-20')" name="date_from"/>
<field eval="time.strftime('%Y-%m-22')" name="date_to"/>
<field name="type">remove</field>
<field name="state">draft</field>
<field name="number_of_days_temp">3</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<workflow action="confirm" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<workflow action="validate" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<workflow action="confirm" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<workflow action="validate" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
</data>
</data>
</openerp>
+1
View File
@@ -247,6 +247,7 @@
<field name="domain">[('type','=','remove')]</field>
<field name="context">{'search_default_user_id':uid}</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
<field name="help">Leaves requests can be recorded by employees and validated by their managers. Once a leave request is validated it appears automatically in the agenda of the employee. You can define several allowance types (paid holidays, sickness, etc) and manage allowances per type.</field>
</record>
<record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
@@ -9,6 +9,15 @@
partner_id: base.res_partner_desertic_hispafuentes
timesheet_max_difference: 1.0
-
I assign this company to Admin user
-
!record {model: res.users, id: base.user_root}:
company_id: res_company_openERP
company_ids:
- base.main_company
- res_company_openERP
-
I create a new employee “Mark Johnson”.
-
@@ -81,7 +90,7 @@
I create Timesheet Entry for time spend on today work.
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}:
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
timesheet_ids:
- account_id: account.analytic_sednacom
date: '05/26/2010'
@@ -98,20 +107,21 @@
if the difference between timesheet hour and attendance hour is more than 1 hour it will give message.
-
!python {model: hr_timesheet_sheet.sheet}: |
uid = ref('base.user_root')
import netsvc
for sheet in self.browse(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')]):
di = sheet.user_id.company_id.timesheet_max_difference
if (abs(sheet.total_difference) < di) or not di:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
else:
print "Please verify that the total difference of the sheet is lower than %.2f" %di
uid = ref('base.user_root')
import netsvc
try:
self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"lang": 'en_US', "active_ids":
[ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")], "tz": False, "active_model":
"ir.ui.menu", "department_id": False, "section_id": False, "search_default_my_timesheet":
1, "search_default_user_id": 1, "project_id": False, "active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"),
})
except:
pass
-
I Modified the timesheet record.
I Modified the timesheet record and make the difference less than 1 hour.
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}:
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
timesheet_ids:
- account_id: account.analytic_sednacom
date: '05/26/2010'
+35 -34
View File
@@ -69,10 +69,10 @@ class report_custom(report_rml):
xml += "<col para='yes'>" + prod_name + '</col>'
xml += "<col para='yes'>" + main_sp_name + sellers + '</col>'
xml += "<col para='yes'>" + str(prod_qtty) + '</col>'
xml += "<col para='yes'>" + product_uom.name + '</col>'
xml += "<col para='yes'>" + main_strd_price + '</col>'
xml += "<col para='yes'>" + main_sp_price + sellers_price + '</col>'
xml += "<col f='yes'>" + str(prod_qtty) + '</col>'
xml += "<col f='yes'>" + product_uom.name + '</col>'
xml += "<col f='yes'>" + main_strd_price + '</col>'
xml += "<col f='yes'>" + main_sp_price + sellers_price + '</col>'
xml += '</row>'
@@ -87,9 +87,9 @@ class report_custom(report_rml):
xml += "<col para='yes'>" + workcenter.name + '</col>'
xml += "<col/>"
xml += "<col/>"
xml += "<col para='yes'>" + str(cost_cycle) + '</col>'
xml += "<col para='yes'>" + str(cost_hour) + '</col>'
xml += "<col para='yes'>" + str(cost_hour + cost_cycle) + '</col>'
xml += "<col f='yes'>" + str(cost_cycle) + '</col>'
xml += "<col f='yes'>" + str(cost_hour) + '</col>'
xml += "<col f='yes'>" + str(cost_hour + cost_cycle) + '</col>'
xml += '</row>'
return xml, total
@@ -102,7 +102,7 @@ class report_custom(report_rml):
<PageSize>210.00mm,297.00mm</PageSize>
<PageWidth>595.27</PageWidth>
<PageHeight>841.88</PageHeight>
<tableSize>60.00mm,60.00mm, 20.00mm, 20.00mm, 20.00mm, 20.00mm</tableSize>
<tableSize>55.00mm,55.00mm, 20.00mm, 22.00mm, 22.00mm, 25.00mm</tableSize>
"""
config_stop = """
<report-footer>Generated by OpenERP</report-footer>
@@ -114,30 +114,30 @@ class report_custom(report_rml):
<row>
<col>%s</col>
<col/>
<col/>
<col>%s</col>
<col>%s</col>
<col>%s</col>
<col t='yes'/>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
</row>
</lines>
""" % (_('Work Center name'), _('Cycles Cost'), _('Hourly Cost'),_('Work Cost'))
prod_header = """
<row>
<col para='yes'>%s</col>
<col para='yes'>%s</col>
<col para='yes'>%s</col>
<col para='yes'>%s</col>
<col para='yes'>%s</col>
<col para='yes'>%s</col>
<col>%s</col>
<col>%s</col>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
</row>
""" % (_('Componet'), _('Componet suppliers'), _('Quantity'), _('Uom'), _('Cost Unit Price per Uom'), _('Supplier Unit Price per Uom'))
""" % (_('Componet'), _('Componet suppliers'), _('Quantity'), _('Uom'), _('Cost Price per Uom'), _('Supplier Price per Uom'))
company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id.id
for product in product_pool.browse(cr, uid, ids, context=context):
bom_id = bom_pool._bom_find(cr, uid, product.id, product.uom_id.id)
title = "<title>%s</title>" %(_("Cost Structure"))
title += "<title>%s</title>" %product.name
xml += "<lines style='header'>" + title + prod_header + "</lines>"
xml += "<lines style='header'>" + title + prod_header + "</lines>"
if not bom_id:
total_strd = number * product.standard_price
total = number * product_pool.price_get(cr, uid, [product.id], 'standard_price')[product.id]
@@ -153,9 +153,9 @@ class report_custom(report_rml):
<col>%s %s %s %s : </col>
<col/>
<col/>
<col/>
<col>%s</col>
<col>%s</col>
<col f='yes'/>
<col f='yes'>%s</col>
<col f='yes'>%s</col>
</row></lines>'"""%(_('Total Cost'), _('of'), str(number), product.uom_id.name, str(total_strd), str(total))
else:
bom = bom_pool.browse(cr, uid, bom_id, context=context)
@@ -164,9 +164,9 @@ class report_custom(report_rml):
total = 0
total_strd = 0
parent_bom = {
'product_qty': bom.product_qty,
'name': bom.product_id.name,
'product_uom': bom.product_uom.id,
'product_qty': bom.product_qty,
'name': bom.product_id.name,
'product_uom': bom.product_uom.id,
'product_id': bom.product_id.id
}
xml_tmp = ''
@@ -175,15 +175,15 @@ class report_custom(report_rml):
xml_tmp += txt
total += sum
total_strd += sum_strd
xml += "<lines style='lines'>" + xml_tmp + '</lines>'
xml += """<lines style='sub_total'> <row>
<col>%s %s %s %s : </col>
<col/>
<col/>
<col/>
<col>%s</col>
<col>%s</col>
<col t='yes'/>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
</row></lines>'"""%(_('Cost'), _('of'), str(number), product.uom_id.name, str(total_strd), str(total))
total2 = 0
@@ -201,18 +201,19 @@ class report_custom(report_rml):
<col/>
<col/>
<col/>
<col>%s</col>
<col t='yes'>%s</col>
</row></lines>'"""%(_('Work Cost'), _('of'), str(number), product.uom_id.name, str(total2))
xml += """<lines style='total'> <row>
<col>%s %s %s %s : </col>
<col/>
<col/>
<col/>
<col>%s</col>
<col>%s</col>
<col t='yes'/>
<col t='yes'>%s</col>
<col t='yes'>%s</col>
</row></lines>'"""%(_('Total Cost'), _('of'), str(number), product.uom_id.name, str(total_strd+total2), str(total+total2))
xml = '<?xml version="1.0" ?><report>' + config_start + config_stop + xml + '</report>'
return xml
report_custom('report.product.price', 'product.product', '', 'addons/mrp/report/price.xsl')
+33 -15
View File
@@ -3,7 +3,7 @@
<xsl:import href="custom_default.xsl"/>
<xsl:import href="custom_rml.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml"/>
</xsl:template>
@@ -12,35 +12,37 @@
<xsl:template name="stylesheet">
<paraStyle name="title" fontName="Helvetica-Bold" fontSize="22" alignment="center"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
<paraStyle name="terp_tblheader_Details_Right_bold" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
<blockTableStyle id="header">
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="GRID" colorName="black"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="lines">
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="GRID" colorName="black"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="total">
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="GRID" colorName="black"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="sub_total">
<blockBackground colorName="lightgrey" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<xsl:apply-templates select="report"/>
</xsl:template>
<xsl:template match="report">
<xsl:apply-templates select="config"/>
<xsl:apply-templates select="title"/>
@@ -66,7 +68,7 @@
<tr>
<xsl:for-each select="field">
<td>
<para>
<para style="terp_tblheader_General">
<xsl:value-of select="."/>
</para>
</td>
@@ -75,22 +77,28 @@
</xsl:template>
<xsl:template match="lines">
<xsl:apply-templates select="title"/>
<blockTable>
<xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
<xsl:attribute name="colWidths">
<xsl:value-of select="../config/tableSize"/>
</xsl:attribute>
<xsl:apply-templates select="row"/>
</blockTable>
<xsl:if test="@style!='header'">
<spacer length="2mm" width="2mm"/>
</xsl:if>
<xsl:if test="@style='total'">
<xsl:if test="position() &lt; last()">
<pageBreak/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="row">
@@ -105,22 +113,32 @@
<xsl:when test="@para='yes'">
<xsl:choose>
<xsl:when test="@tree='yes'">
<para>
<para style="terp_default_8">
<xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
<xsl:value-of select="."/>
</para>
</xsl:when>
<xsl:otherwise>
<para>
<para style="terp_default_8">
<xsl:value-of select="."/>
</para>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xpre>
<xsl:when test="@f='yes'">
<para style="terp_tblheader_Details_Right">
<xsl:value-of select="."/>
</xpre>
</para>
</xsl:when>
<xsl:when test="@t='yes'">
<para style="terp_tblheader_Details_Right_bold">
<xsl:value-of select="."/>
</para>
</xsl:when>
<xsl:otherwise>
<para style="terp_tblheader_General">
<xsl:value-of select="."/>
</para>
</xsl:otherwise>
</xsl:choose>
</td>
-2
View File
@@ -67,12 +67,10 @@ Main features :
'report/report_pos_order_view.xml',
'report/report_cash_register_view.xml',
'pos_sequence.xml',
#'posrule_data.xml',
'pos_data.xml',
'pos_workflow.xml',
'statement_view.xml',
'statement_report.xml',
#'statement_data.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',],
'test':['test/pos_test.yml',],
+1 -1
View File
@@ -556,7 +556,7 @@ class pos_order(osv.osv):
@return: True
"""
self.write(cr, uid, ids, {'state': 'cancel'})
self.cancel_picking(cr, uid, ids, context=None)
self.cancel_picking(cr, uid, ids, context=context)
return True
def add_payment(self, cr, uid, order_id, data, context=None):
+1
View File
@@ -185,6 +185,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_wiki_tree"/>
<field name="search_view_id" ref="view_wiki_filter"/>
<field name="help">Wiki Pages allows you to share ideas and questions with your coworkers. You can create a new document that can be link to one or several applications (CRM, Sales, etc.). You can use keywords to ease access to your wiki pages. There is a basic wiki editing for text format.</field>
</record>
<menuitem parent="knowledge.menu_document2"