[MERGE] merge from trunk addons
bzr revid: mra@mra-laptop-20101027093700-qux86he71bccr7ly
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<field name="date"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
</record>
|
||||
|
||||
<menuitem name="Association" id="base.menu_association" icon="terp-calendar" sequence="9" groups="base.group_extended"/>
|
||||
<menuitem name="Events Organisation" id="base.menu_event_main" parent="base.menu_association" />
|
||||
<menuitem name="Configuration" id="base.menu_event_config" parent="base.menu_association" sequence="30" groups="base.group_extended"/>
|
||||
<menuitem name="Reporting" id="base.menu_report_association" parent="base.menu_association" sequence="20"/>
|
||||
</data>
|
||||
|
||||
@@ -44,7 +44,7 @@ class buyer_form_report(report_sxw.rml_parse):
|
||||
taxes.append(lot.author_right)
|
||||
if lot.auction_id:
|
||||
taxes += lot.auction_id.buyer_costs
|
||||
tax=self.pool.get('account.tax').compute(self.cr, self.uid, taxes, lot.obj_price, 1)
|
||||
tax=self.pool.get('account.tax').compute_all(self.cr, self.uid, taxes, lot.obj_price, 1)
|
||||
for t in tax:
|
||||
amount+=t['amount']
|
||||
return amount
|
||||
|
||||
@@ -35,7 +35,7 @@ class seller_form_report(report_sxw.rml_parse):
|
||||
'sum_taxes': self.sum_taxes,
|
||||
'sellerinfo' : self.seller_info,
|
||||
'grand_total' : self.grand_seller_total,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
def sum_taxes(self, lot):
|
||||
@@ -45,7 +45,7 @@ class seller_form_report(report_sxw.rml_parse):
|
||||
taxes.append(lot.bord_vnd_id.tax_id)
|
||||
elif lot.auction_id and lot.auction_id.seller_costs:
|
||||
taxes += lot.auction_id.seller_costs
|
||||
tax=self.pool.get('account.tax').compute(self.cr, self.uid, taxes, lot.obj_price, 1)
|
||||
tax=self.pool.get('account.tax').compute_all(self.cr, self.uid, taxes, lot.obj_price, 1)
|
||||
for t in tax:
|
||||
amount+=t['amount']
|
||||
return amount
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_auction_artists","auction.artists","model_auction_artists","group_auction_manager",1,1,1,1
|
||||
"access_auction_dates_user","auction.dates user","model_auction_dates","group_auction_user",1,0,0,0
|
||||
"access_auction_dates_manager","auction.dates manager","model_auction_dates","group_auction_manager",1,1,1,1
|
||||
"access_auction_deposit_manager","auction.deposit manager","model_auction_deposit","group_auction_manager",1,1,1,1
|
||||
"access_auction_deposit_user","auction.deposit user","model_auction_deposit","group_auction_user",1,0,0,0
|
||||
"access_auction_deposit_cost","auction.deposit.cost","model_auction_deposit_cost","group_auction_manager",1,1,1,1
|
||||
"access_auction_lot_category","auction.lot.category","model_auction_lot_category","group_auction_user",1,0,0,0
|
||||
"access_auction_lot_category_manager","auction.lot.category manager","model_auction_lot_category","group_auction_manager",1,1,1,1
|
||||
"access_auction_lots","auction.lots","model_auction_lots","group_auction_user",1,1,1,1
|
||||
"access_auction_lots","auction.lots","model_auction_lots","group_auction_user",1,1,1,0
|
||||
"access_auction_lots_manager","auction.lots manager","model_auction_lots","group_auction_manager",1,0,0,0
|
||||
"access_auction_bid","auction.bid","model_auction_bid","group_auction_user",1,1,1,1
|
||||
"access_auction_bid_manager","auction.bid manager","model_auction_bid","group_auction_manager",1,0,0,0
|
||||
@@ -18,6 +20,7 @@
|
||||
"access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","group_auction_manager",1,1,1,1
|
||||
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","group_auction_manager",1,1,1,1
|
||||
"access_aie_category","aie.category","model_aie_category","group_auction_manager",1,1,1,1
|
||||
"access_auction_account_tax_user","account.tax user","account.model_account_tax","group_auction_user",1,0,0,0
|
||||
"access_auction_account_tax","account.tax manager","account.model_account_tax","group_auction_manager",1,1,1,0
|
||||
"access_auction_account_fiscalyear","account.fiscalyear manager","account.model_account_fiscalyear","group_auction_manager",1,1,1,0
|
||||
"access_auction_account_journal","account.journal manager","account.model_account_journal","group_auction_manager",1,1,1,0
|
||||
|
||||
|
@@ -27,8 +27,8 @@
|
||||
I will search for one of the recurrent event and count the number of events
|
||||
-
|
||||
!python {model: calendar.event}: |
|
||||
ids = self.search(cr, uid, [('date', '>=', '2010-05-01 00:00:00'), ('date', '<=', '2010-05-31 00:00:00')] )
|
||||
assert len(ids) == 9
|
||||
ids = self.search(cr, uid, [('date', '>=', '2010-04-30 16:00:00'), ('date', '<=', '2010-05-31 00:00:00')] )
|
||||
assert len(ids) == 10
|
||||
- |
|
||||
Now I will make All day event and test it
|
||||
-
|
||||
|
||||
+111
-94
@@ -2,67 +2,65 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_calendar_collection_form">
|
||||
<field name="name">Calendar Collections : Form</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Calendar Collections">
|
||||
<field name="name" select="1" colspan="4"/>
|
||||
<field name="user_id"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="calendar_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_calendar_collection_tree">
|
||||
<field name="name">Calendar Collections : Tree</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendar Collections" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<field name="name">Calendar Collections : Form</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Calendar Collections">
|
||||
<field name="name" select="1" colspan="4"/>
|
||||
<field name="user_id"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="calendar_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_calendar_collection_form">
|
||||
<field name="name">Calendar Collections</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('calendar_collection','=',True)]</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_calendar_collection_tree">
|
||||
<field name="name">Calendar Collections : Tree</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendar Collections" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="document.action_document_directory_form">
|
||||
<field name="domain">[('calendar_collection','=',False)]</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_calendar_collection_form">
|
||||
<field name="name">Calendar Collections</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('calendar_collection','=',True)]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_dir_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_calendar_collection_tree"/>
|
||||
<field name="act_window_id" ref="action_calendar_collection_form"/>
|
||||
</record>
|
||||
<record id="action_dir_view2" model="ir.actions.act_window.view">
|
||||
<field eval="20" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_calendar_collection_form"/>
|
||||
<field name="act_window_id" ref="action_calendar_collection_form"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="document.action_document_directory_form">
|
||||
<field name="domain">[('calendar_collection','=',False)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="menu_calendar"
|
||||
name="Calendar"
|
||||
parent="knowledge.menu_document_configuration"/>
|
||||
<record id="action_dir_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_calendar_collection_tree"/>
|
||||
<field name="act_window_id" ref="action_calendar_collection_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_calendar_collection_form"
|
||||
id="menu_calendar_collection"
|
||||
parent="menu_calendar"/>
|
||||
<record id="action_dir_view2" model="ir.actions.act_window.view">
|
||||
<field eval="20" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_calendar_collection_form"/>
|
||||
<field name="act_window_id" ref="action_calendar_collection_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_calendar" name="Calendar"
|
||||
parent="knowledge.menu_document_configuration" />
|
||||
|
||||
<menuitem action="action_calendar_collection_form"
|
||||
id="menu_calendar_collection" parent="menu_calendar" />
|
||||
|
||||
<record model="ir.ui.view" id="view_caldav_form">
|
||||
<field name="name">Calendar : Form</field>
|
||||
@@ -100,7 +98,7 @@
|
||||
<separator string="Value Mapping" colspan="4" />
|
||||
<field name="mapping" select="1" colspan="4" nolabel="1" />
|
||||
</form>
|
||||
</field>
|
||||
</field>
|
||||
</form>
|
||||
<tree string="Calendar Lines" editable="bottom">
|
||||
<field name="name" select="1" />
|
||||
@@ -118,45 +116,64 @@
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_caldav_tree">
|
||||
<field name="name">Calendar : Tree</field>
|
||||
<field name="model">basic.calendar</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendars" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_caldav_tree">
|
||||
<field name="name">Calendar : Tree</field>
|
||||
<field name="model">basic.calendar</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Calendars" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_caldav_form">
|
||||
<field name="name">Calendars</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">basic.calendar</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_caldav_search">
|
||||
<field name="name">Calendar: Search</field>
|
||||
<field name="model">basic.calendar</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Calendars">
|
||||
<filter string="WebCal" icon="terp-calendar" domain="[('has_webcal', '=', True)]" help="Webcal Calendar"/>
|
||||
<filter string="Event" icon="terp-calendar" domain="[('type', '=', 'vevent')]"/>
|
||||
<filter string="Todo" icon="terp-calendar" domain="[('type', '=', 'vtodo')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-personal" domain="[('user_id', '=', uid)]" help="My Calendar(s)" string="MY"/>
|
||||
</field>
|
||||
<field name="collection_id" required="1"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_caldav_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_caldav_tree"/>
|
||||
<field name="act_window_id" ref="action_caldav_form"/>
|
||||
</record>
|
||||
<record id="action_caldav_view2" model="ir.actions.act_window.view">
|
||||
<field eval="20" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_caldav_form"/>
|
||||
<field name="act_window_id" ref="action_caldav_form"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_caldav_form">
|
||||
<field name="name">Calendars</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">basic.calendar</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="action_caldav_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_caldav_tree"/>
|
||||
<field name="act_window_id" ref="action_caldav_form"/>
|
||||
</record>
|
||||
<record id="action_caldav_view2" model="ir.actions.act_window.view">
|
||||
<field eval="20" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_caldav_form"/>
|
||||
<field name="act_window_id" ref="action_caldav_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_caldav_form"
|
||||
id="menu_caldav_directories" parent="menu_calendar" />
|
||||
|
||||
<menuitem
|
||||
action="action_caldav_form"
|
||||
id="menu_caldav_directories"
|
||||
parent="menu_calendar"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_opportunity_categ_graph"/>
|
||||
<field name="domain">[('state','!=','done'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_opportunity_stage">
|
||||
@@ -56,7 +56,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_opportunity_stage_graph"/>
|
||||
<field name="domain">[('state','!=','done'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_oppor_stage_user">
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
|
||||
<act_window
|
||||
domain="[('partner_address_id', '=', active_id)]"
|
||||
context="{'default_partner_address_id': active_id}"
|
||||
context="{'default_partner_id': partner_id}"
|
||||
id="act_claim_partner_address"
|
||||
name="Report a Claim"
|
||||
view_mode="form,tree"
|
||||
|
||||
@@ -3,3 +3,5 @@
|
||||
"access_crm_profiling_answer_manager","crm_profiling.answer manager","model_crm_profiling_answer","base.group_sale_manager",1,0,0,0
|
||||
"access_crm_profiling_question_manager","crm_profiling.question manager","model_crm_profiling_question","base.group_sale_salesman",1,1,1,0
|
||||
"access_crm_profiling_question_user","crm_profiling.question user","model_crm_profiling_question","base.group_sale_manager",1,0,0,0
|
||||
"access_crm_profiling_questionnarie_user","crm_profiling.questionnarie user","model_crm_profiling_questionnaire","base.group_sale_salesman",1,0,0,0
|
||||
"access_crm_profiling_questionnarie_manager","crm_profiling.questionnarie manager","model_crm_profiling_questionnaire","base.group_sale_manager",1,1,1,1
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
'partner_view.xml'
|
||||
],
|
||||
'demo_xml': ['delivery_demo.xml'],
|
||||
'test':['test/delivery_test.yml','test/delivery_report.yml'],
|
||||
'test':['test/delivery_report.yml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0033981912253',
|
||||
|
||||
@@ -732,6 +732,8 @@ class email_template_preview(osv.osv_memory):
|
||||
ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id['object_name'][0], ['model'], context)['model']
|
||||
model_obj = self.pool.get(ref_obj_name)
|
||||
ref_obj_ids = model_obj.search(cr, uid, [], 0, 20, 'id desc', context=context)
|
||||
if not ref_obj_ids:
|
||||
ref_obj_ids = []
|
||||
|
||||
# also add the default one if requested, otherwise it won't be available for selection:
|
||||
default_id = context.get('default_rel_model_ref')
|
||||
@@ -762,7 +764,7 @@ class email_template_preview(osv.osv_memory):
|
||||
user,
|
||||
context['template_id'],
|
||||
['object_name'],
|
||||
context)['object_name']
|
||||
context).get('object_name', False)
|
||||
|
||||
_columns = {
|
||||
'ref_template':fields.many2one(
|
||||
@@ -789,7 +791,7 @@ class email_template_preview(osv.osv_memory):
|
||||
'report':fields.char('Report Name', size=100, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'ref_template': lambda self, cr, uid, ctx:ctx['template_id'],
|
||||
'ref_template': lambda self, cr, uid, ctx:ctx['template_id'] or False,
|
||||
'rel_model': _default_model,
|
||||
}
|
||||
def on_change_ref(self, cr, uid, ids, rel_model_ref, context=None):
|
||||
|
||||
@@ -13,3 +13,4 @@
|
||||
"access_event_event_sale_salesman","event.event.sale","model_event_event","base.group_sale_salesman",1,0,0,0
|
||||
"access_account_account_invoice_manager","account.account.invoice","account.model_account_invoice","base.group_marketing_manager",1,0,0,0
|
||||
"access_event_registration_badge","event.registration.badge","model_event_registration_badge","marketing.group_marketing_user",1,0,0,0
|
||||
"access_event_registration_sale_user","event.registration.sale.user","model_event_registration","base.group_sale_salesman",1,0,0,0
|
||||
|
||||
|
@@ -86,7 +86,7 @@ class hr_payroll_structure(osv.osv):
|
||||
- Allowlance
|
||||
- Deductions
|
||||
"""
|
||||
|
||||
|
||||
_name = 'hr.payroll.structure'
|
||||
_description = 'Salary Structure'
|
||||
_columns = {
|
||||
@@ -130,14 +130,14 @@ class hr_contract(osv.osv):
|
||||
Employee contract based on the visa, work permits
|
||||
allowas to configure different Salary structure
|
||||
"""
|
||||
|
||||
|
||||
def compute_basic(self, cr, uid, ids, context={}):
|
||||
res = {}
|
||||
ids += context.get('employee_structure', [])
|
||||
|
||||
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
slip_line_pool = self.pool.get('hr.payslip.line')
|
||||
|
||||
|
||||
for contract in self.browse(cr, uid, ids, context):
|
||||
all_per = 0.0
|
||||
ded_per = 0.0
|
||||
@@ -154,20 +154,20 @@ class hr_contract(osv.osv):
|
||||
if contract.wage_type_id.type == 'basic':
|
||||
obj['basic'] = contract.wage
|
||||
update['basic'] = contract.wage
|
||||
|
||||
|
||||
sal_type = contract.wage_type_id.type
|
||||
function = contract.struct_id.id
|
||||
lines = contract.struct_id.line_ids
|
||||
if not contract.struct_id:
|
||||
res[contract.id] = obj['basic']
|
||||
continue
|
||||
|
||||
continue
|
||||
|
||||
ad = []
|
||||
c_type = {}
|
||||
for line in lines:
|
||||
cd = line.code.lower()
|
||||
obj[cd] = line.amount or 0.0
|
||||
|
||||
|
||||
for line in lines:
|
||||
if line.category_id.code in ad:
|
||||
continue
|
||||
@@ -237,16 +237,16 @@ class hr_contract(osv.osv):
|
||||
basic = (sal * 100) / final
|
||||
else:
|
||||
basic = contract.wage
|
||||
|
||||
|
||||
res[contract.id] = basic
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def check_vals(self, val1, val2):
|
||||
if val1 == val2 and val1 == 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _calculate_salary(self, cr, uid, ids, field_names, arg, context=None):
|
||||
res = self.compute_basic(cr, uid, ids, context)
|
||||
vals = {}
|
||||
@@ -259,7 +259,7 @@ class hr_contract(osv.osv):
|
||||
obj['gross'] = rs.wage
|
||||
if rs.wage_type_id.type == 'net':
|
||||
obj['net'] = rs.net
|
||||
|
||||
|
||||
if not rs.struct_id:
|
||||
if self.check_vals(obj['basic'], obj['gross']):
|
||||
obj['gross'] = obj['basic'] = obj['net']
|
||||
@@ -276,7 +276,7 @@ class hr_contract(osv.osv):
|
||||
}
|
||||
vals[rs.id] = record
|
||||
continue
|
||||
|
||||
|
||||
for line in rs.struct_id.line_ids:
|
||||
amount = 0.0
|
||||
if line.amount_type == 'per':
|
||||
@@ -288,7 +288,7 @@ class hr_contract(osv.osv):
|
||||
amount = line.amount
|
||||
cd = line.category_id.code.lower()
|
||||
obj[cd] = amount
|
||||
|
||||
|
||||
if line.type == 'allowance':
|
||||
allow += amount
|
||||
elif line.type == 'deduction':
|
||||
@@ -334,7 +334,7 @@ class payroll_register(osv.osv):
|
||||
"""
|
||||
Payroll Register
|
||||
"""
|
||||
|
||||
|
||||
_name = 'hr.payroll.register'
|
||||
_description = 'Payroll Register'
|
||||
|
||||
@@ -425,6 +425,18 @@ class payroll_register(osv.osv):
|
||||
self.write(cr, uid, ids, {'state':'draft', 'number':number}, context=context)
|
||||
return True
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
self.write(cr, uid, ids, {'state':'draft'}, context=context)
|
||||
return True
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -453,7 +465,7 @@ class payroll_register(osv.osv):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for sid in sids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
|
||||
|
||||
|
||||
company_name = users_pool.browse(cr, uid, uid, context=context).company_id.name
|
||||
for reg in self.browse(cr, uid, ids, context=context):
|
||||
advice = {
|
||||
@@ -462,7 +474,7 @@ class payroll_register(osv.osv):
|
||||
'register_id':reg.id
|
||||
}
|
||||
pid = advice_pool.create(cr, uid, advice, context=context)
|
||||
|
||||
|
||||
for slip in reg.line_ids:
|
||||
if not slip.employee_id.bank_account_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please define bank account for the %s employee' % (slip.employee_id.name)))
|
||||
@@ -495,7 +507,7 @@ class payroll_advice(osv.osv):
|
||||
'''
|
||||
Bank Advice Note
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.payroll.advice'
|
||||
_description = 'Bank Advice Note'
|
||||
_columns = {
|
||||
@@ -557,7 +569,7 @@ class payroll_advice_line(osv.osv):
|
||||
'''
|
||||
Bank Advice Lines
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.payroll.advice.line'
|
||||
_description = 'Bank Advice Lines'
|
||||
_columns = {
|
||||
@@ -595,7 +607,7 @@ class contrib_register(osv.osv):
|
||||
'''
|
||||
Contribution Register
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.contibution.register'
|
||||
_description = 'Contribution Register'
|
||||
|
||||
@@ -635,7 +647,7 @@ class contrib_register_line(osv.osv):
|
||||
'''
|
||||
Contribution Register Line
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.contibution.register.line'
|
||||
_description = 'Contribution Register Line'
|
||||
|
||||
@@ -745,7 +757,7 @@ class company_contribution(osv.osv):
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
}
|
||||
|
||||
|
||||
def _execute_function(self, cr, uid, id, value, context=None):
|
||||
"""
|
||||
self: pointer to self object
|
||||
@@ -764,7 +776,7 @@ class company_contribution(osv.osv):
|
||||
else:
|
||||
res = line_pool.browse(cr, uid, ids, context=context)[0].value
|
||||
return res
|
||||
|
||||
|
||||
def compute(self, cr, uid, id, value, context={}):
|
||||
contrib = self.browse(cr, uid, id, context)
|
||||
if contrib.amount_type == 'fix':
|
||||
@@ -798,7 +810,7 @@ class company_contribution_line(osv.osv):
|
||||
company_contribution_line()
|
||||
|
||||
class hr_holidays_status(osv.osv):
|
||||
|
||||
|
||||
_inherit = "hr.holidays.status"
|
||||
_columns = {
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
@@ -823,7 +835,7 @@ class hr_payslip(osv.osv):
|
||||
'''
|
||||
Pay Slip
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.payslip'
|
||||
_description = 'Pay Slip'
|
||||
|
||||
@@ -981,12 +993,12 @@ class hr_payslip(osv.osv):
|
||||
context = {}
|
||||
self.write(cr, uid, ids, {'paid':True, 'state':'done'}, context=context)
|
||||
return True
|
||||
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
payslip_pool = self.pool.get('hr.payslip.line')
|
||||
register_pool = self.pool.get('company.contribution')
|
||||
register_line_pool = self.pool.get('hr.contibution.register.line')
|
||||
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
base = {
|
||||
'basic':slip.basic,
|
||||
@@ -1009,7 +1021,7 @@ class hr_payslip(osv.osv):
|
||||
'total':line.total + line.total
|
||||
}
|
||||
register_line_pool.create(cr, uid, reg_line)
|
||||
|
||||
|
||||
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
return True
|
||||
|
||||
@@ -1084,7 +1096,7 @@ class hr_payslip(osv.osv):
|
||||
count += 1
|
||||
return count
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
old_slip_ids = slip_line_pool.search(cr, uid, [('slip_id','=',slip.id)], context=context)
|
||||
slip_line_pool.unlink(cr, uid, old_slip_ids, context=context)
|
||||
update = {}
|
||||
@@ -1224,7 +1236,7 @@ class hr_payslip(osv.osv):
|
||||
'contract_id':contract.id,
|
||||
'company_id':slip.employee_id.company_id.id
|
||||
})
|
||||
|
||||
|
||||
for line in slip.employee_id.line_ids:
|
||||
vals = {
|
||||
'amount':line.amount,
|
||||
@@ -1234,7 +1246,7 @@ class hr_payslip(osv.osv):
|
||||
'base':base
|
||||
}
|
||||
slip_line_pool.copy(cr, uid, line.id, vals, {})
|
||||
|
||||
|
||||
self.write(cr, uid, [slip.id], update, context=context)
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
@@ -1260,7 +1272,7 @@ class hr_payslip(osv.osv):
|
||||
for hday in holiday_pool.browse(cr, uid, leave_ids, context=context):
|
||||
if not hday.holiday_status_id.head_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please check configuration of %s, payroll head is missing' % (hday.holiday_status_id.name)))
|
||||
|
||||
|
||||
res = {
|
||||
'slip_id':slip.id,
|
||||
'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
|
||||
@@ -1281,7 +1293,7 @@ class hr_payslip(osv.osv):
|
||||
# res['type'] = 'allowance'
|
||||
# leave += days
|
||||
# total += perday * days
|
||||
|
||||
|
||||
elif hday.holiday_status_id.type == 'halfpaid':
|
||||
paid_leave += (days / 2)
|
||||
res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
|
||||
@@ -1315,7 +1327,7 @@ class hr_payslip_line(osv.osv):
|
||||
'''
|
||||
Payslip Line
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.payslip.line'
|
||||
_description = 'Payslip Line'
|
||||
|
||||
@@ -1346,7 +1358,7 @@ class hr_payslip_line(osv.osv):
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=False),
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'base':fields.char('Formula', size=1024, required=False, readonly=False),
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=True),
|
||||
'type':fields.selection([
|
||||
('allowance','Allowance'),
|
||||
@@ -1397,7 +1409,7 @@ class hr_payslip_line_line(osv.osv):
|
||||
'''
|
||||
Function Line
|
||||
'''
|
||||
|
||||
|
||||
_name = 'hr.payslip.line.line'
|
||||
_description = 'Function Line'
|
||||
_order = 'sequence'
|
||||
@@ -1418,28 +1430,28 @@ class hr_employee(osv.osv):
|
||||
'''
|
||||
Employee
|
||||
'''
|
||||
|
||||
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
|
||||
|
||||
def _calculate_salary(self, cr, uid, ids, field_names, arg, context=None):
|
||||
vals = {}
|
||||
slip_line_pool = self.pool.get('hr.payslip.line')
|
||||
|
||||
|
||||
for employee in self.browse(cr, uid, ids, context):
|
||||
if not employee.contract_id:
|
||||
vals[employee.id] = {'basic':0.0, 'gross':0.0, 'net':0.0, 'advantages_gross':0.0, 'advantages_net':0.0}
|
||||
continue
|
||||
|
||||
|
||||
basic = employee.contract_id.basic
|
||||
gross = employee.contract_id.gross
|
||||
net = employee.contract_id.net
|
||||
allowance = employee.contract_id.advantages_gross
|
||||
deduction = employee.contract_id.advantages_net
|
||||
|
||||
|
||||
obj = {
|
||||
'basic':basic,
|
||||
'gross':gross,
|
||||
'basic':basic,
|
||||
'gross':gross,
|
||||
'net':net
|
||||
}
|
||||
for line in employee.line_ids:
|
||||
@@ -1455,27 +1467,27 @@ class hr_employee(osv.osv):
|
||||
amount = slip_line_pool.execute_function(cr, uid, line.id, amt, context)
|
||||
elif line.amount_type == 'fix':
|
||||
amount = line.amount
|
||||
|
||||
|
||||
if line.type == 'allowance':
|
||||
allowance += amount
|
||||
elif line.type == 'deduction':
|
||||
deduction += amount
|
||||
|
||||
|
||||
vals[employee.id] = {
|
||||
'basic':basic,
|
||||
'advantages_gross':allowance,
|
||||
'gross':basic + allowance,
|
||||
'basic':basic,
|
||||
'advantages_gross':allowance,
|
||||
'gross':basic + allowance,
|
||||
'advantages_net':deduction,
|
||||
'net':basic + allowance - deduction
|
||||
}
|
||||
return vals
|
||||
|
||||
|
||||
_columns = {
|
||||
'passport_id':fields.many2one('hr.passport', 'Passport', required=False, domain="[('employee_id','=',active_id), ('address_id','=',address_home_id)]", help="Employee Passport Information"),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
|
||||
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
|
||||
'otherid': fields.char('Other Id', size=64),
|
||||
|
||||
|
||||
'basic': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)),
|
||||
'gross': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Gross Salary', digits=(14,2)),
|
||||
'net': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Net Salary', digits=(14,2)),
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
'init_xml': [
|
||||
],
|
||||
'update_xml': [
|
||||
"security/ir.model.access.csv",
|
||||
"hr_payroll_account_view.xml",
|
||||
],
|
||||
'demo_xml': [
|
||||
@@ -47,4 +48,4 @@
|
||||
'active': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_payslip_account_move_user","access.hr.payslip.account.move.user","model_hr_payslip_account_move","base.group_user",1,0,0,0
|
||||
|
@@ -127,9 +127,9 @@
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="state"/>
|
||||
<group col="4" colspan="2">
|
||||
<button name="button_confirm" states="draft" string="Close" type="object" icon="terp-check"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="state"/>
|
||||
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="terp-check"/>
|
||||
<button name="action_set_to_draft" states="done" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
<button name="cancel" states="confirm" string="Refuse" type="workflow" icon="gtk-cancel"/>
|
||||
<button name="done" states="confirm" string="Approve" type="workflow" icon="terp-camera_test"/>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"mail_gateway_mailgate_message","mail_gateway.mailgate.message","model_mailgate_message","base.group_system",1,1,1,1
|
||||
"mail_gateway_mailgate_thread","mail_gateway.mailgate.thread","model_mailgate_thread","base.group_system",1,1,1,1
|
||||
"mail_gateway_message_internal_user","mail_gateway.mailgate.message.internal","model_mailgate_message","base.group_user",1,0,0,0
|
||||
|
||||
|
@@ -40,7 +40,7 @@ class stock_production_lot(osv.osv):
|
||||
# set date to False when no expiry time specified on the product
|
||||
date = duration and (datetime.datetime.today()
|
||||
+ datetime.timedelta(days=duration))
|
||||
return date and date.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return date and date.strftime('%Y-%m-%d %H:%M:%S') or False
|
||||
return calc_date
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
<field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
|
||||
<field name="state" invisible="context.get('set_visible',False)"/>
|
||||
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
|
||||
<button name="do_open" states="pending,draft,done,cancel" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state" invisible="context.get('set_visible',False)"/>
|
||||
<button name="do_open" states="pending,draft,done,cancelled" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state" invisible="context.get('set_visible',False)"/>
|
||||
<button groups="base.group_extended" name="%(action_project_task_delegate)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-sort-descending" help="For changing to delegate state"/>
|
||||
<button name="action_close" states="draft,pending,open" string="Done" type="object" icon="terp-dialog-close" help="For changing to done state"/>
|
||||
</tree>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
<field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_tasks_config" name="Tasks" parent="project.menu_definitions" sequence="1"/>
|
||||
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report" groups="project.group_project_manager"/>
|
||||
|
||||
<!-- Views and action for project dashboard -->
|
||||
<record id="view_project_vs_remaining_hours_tree" model="ir.ui.view">
|
||||
|
||||
@@ -1,108 +1,108 @@
|
||||
-
|
||||
Test project template feature
|
||||
-
|
||||
-
|
||||
Create project 'OpenERP Training Programme'
|
||||
-
|
||||
-
|
||||
!record {model: project.project, id: project_project_openerptrainingprogramme0}:
|
||||
company_id: base.main_company
|
||||
name: OpenERP Training Programme
|
||||
-
|
||||
name: OpenERP Training Programme
|
||||
-
|
||||
Create task 'Technical Training' for this project
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
date_start: '2010-05-31 11:48:38'
|
||||
name: Technical Training
|
||||
planned_hours: 30.0
|
||||
project_id: project_project_openerptrainingprogramme0
|
||||
remaining_hours: 30.0
|
||||
state: draft
|
||||
-
|
||||
state: draft
|
||||
-
|
||||
Create task 'Functional Training' for this project
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_functionaltraining0}:
|
||||
date_start: '2010-05-31 11:49:11'
|
||||
name: Functional Training
|
||||
planned_hours: 30.0
|
||||
project_id: project_project_openerptrainingprogramme0
|
||||
remaining_hours: 30.0
|
||||
state: draft
|
||||
-
|
||||
state: draft
|
||||
-
|
||||
Set project as project template
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_template(cr, uid, [ref("project_project_openerptrainingprogramme0")],
|
||||
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")],
|
||||
"tz": False, "active_id": ref("project.menu_open_view_project_all"), })
|
||||
-
|
||||
-
|
||||
Check if project in template state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in template state}:
|
||||
- state == "template"
|
||||
-
|
||||
- state == "template"
|
||||
-
|
||||
Create new project based on this template
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
new_prj = self.duplicate_template(cr, uid, [ref("project_project_openerptrainingprogramme0")],
|
||||
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")],
|
||||
"tz": False, "active_id": ref("project.menu_open_view_project_all"), })
|
||||
if not new_prj:
|
||||
raise Exception( "New project based on template not created")
|
||||
raise Exception( "New project based on template not created")
|
||||
new_id = new_prj['res_id']
|
||||
new_prj = self.read(cr, uid, [new_id], ['name', 'state'])[0]
|
||||
state = new_prj['state']
|
||||
name = new_prj['name']
|
||||
assert state == 'open', "Project in %s state. Project created from template project must be in open state"%state
|
||||
-
|
||||
Reset project template to normal project
|
||||
-
|
||||
name = new_prj['name']
|
||||
assert state == 'open', "Project in %s state. Project created from template project must be in open state"%state
|
||||
-
|
||||
Reset project template to normal project
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.reset_project(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
|
||||
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
|
||||
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
|
||||
})
|
||||
-
|
||||
-
|
||||
Check if project in open state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}:
|
||||
- state == "open"
|
||||
-
|
||||
Test for different project-states
|
||||
-
|
||||
Test for different project-states
|
||||
-
|
||||
Keep project pending
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_pending(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
|
||||
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
|
||||
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
|
||||
})
|
||||
-
|
||||
-
|
||||
Check if project in pending state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in pending state}:
|
||||
- state == "pending"
|
||||
-
|
||||
- state == "pending"
|
||||
-
|
||||
Cancel the project
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_cancel(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
|
||||
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
|
||||
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
|
||||
})
|
||||
-
|
||||
-
|
||||
Check if project in cancel state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in cancel state}:
|
||||
- state == "cancelled"
|
||||
-
|
||||
-
|
||||
Re-open the project
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_open(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")],
|
||||
"tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id":
|
||||
ref("project.menu_open_view_project_all"), })
|
||||
-
|
||||
-
|
||||
Check if project in open state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}:
|
||||
- state == "open"
|
||||
-
|
||||
@@ -124,16 +124,16 @@
|
||||
self.compute_hours(cr, uid, [ref('project_task_technicaltraining_remainingwiz0')], {'active_id': ref("project_task_technicaltraining0"),'button_reactivate': True})
|
||||
- |
|
||||
Check if task 'Technical Training' in open state and for other initial values
|
||||
-
|
||||
-
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Project is in open state}:
|
||||
- state == "open"
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 30
|
||||
- delay_hours == 0.0
|
||||
- effective_hours == 0.0
|
||||
-
|
||||
- effective_hours == 0.0
|
||||
-
|
||||
Make a work task entry 'Training on OpenERP modules, models and classes' of 10 hours
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 15:04:22'
|
||||
@@ -146,9 +146,9 @@
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After work task of 10 hours effective_hours must be equal to 10}:
|
||||
- remaining_hours == 20
|
||||
- effective_hours == 10.0
|
||||
-
|
||||
-
|
||||
Make a work task entry 'Training on OpenERP xml views' of 10 hours
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
work_ids:
|
||||
- date: '2010-06-01 15:04:46'
|
||||
@@ -161,9 +161,9 @@
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 20}:
|
||||
- remaining_hours == 10
|
||||
- effective_hours == 20.0
|
||||
-
|
||||
Make a work task entry 'Training on workflows' of 10 hours
|
||||
-
|
||||
-
|
||||
Make a work task entry 'Training on workflows' of 10 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
work_ids:
|
||||
- date: '2010-06-02 15:05:24'
|
||||
@@ -176,20 +176,20 @@
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 30}:
|
||||
- remaining_hours == 0
|
||||
- effective_hours == 30.0
|
||||
-
|
||||
Set remaining hours of 10 hours for reevaluating the task
|
||||
-
|
||||
-
|
||||
Set remaining hours of 10 hours for reevaluating the task
|
||||
-
|
||||
!record {model: project.task.reevaluate, id: config_compute_remaining_0}:
|
||||
remaining_hours: 10.0
|
||||
-
|
||||
Reevaluate the task
|
||||
-
|
||||
-
|
||||
!python {model: project.task.reevaluate}: |
|
||||
self.compute_hours(cr, uid, [ref("config_compute_remaining_0")], {"lang": "en_US",
|
||||
"project_id": False, "tz": False, "active_model": "project.task", "search_default_project_id":
|
||||
False, "search_default_user_id": 1, "search_default_current": 1, "active_ids":
|
||||
[ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"), })
|
||||
|
||||
|
||||
-
|
||||
Check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30
|
||||
-
|
||||
@@ -197,9 +197,9 @@
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 10.0
|
||||
- effective_hours == 30.0
|
||||
-
|
||||
-
|
||||
Make a work task entry 'Training on reports and wizards' of 10 hours
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 15:08:40'
|
||||
@@ -213,28 +213,28 @@
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 0
|
||||
- effective_hours == 40.0
|
||||
-
|
||||
-
|
||||
Close the task
|
||||
-
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False})
|
||||
-
|
||||
-
|
||||
Check if task in done state
|
||||
-
|
||||
-
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in done state}:
|
||||
- state == "done"
|
||||
|
||||
|
||||
- state == "done"
|
||||
|
||||
|
||||
-
|
||||
Test for task reactivation
|
||||
Test for task reactivation
|
||||
-
|
||||
Reactivate task
|
||||
-
|
||||
Reactivate task
|
||||
-
|
||||
!record {model: project.task.reevaluate, id: config_compute_remaining_1}:
|
||||
remaining_hours: 10.0
|
||||
-
|
||||
remaining_hours: 10.0
|
||||
-
|
||||
Reevaluate the task with 10 hours remaining
|
||||
-
|
||||
-
|
||||
!python {model: project.task.reevaluate}: |
|
||||
self.compute_hours(cr, uid, [ref("config_compute_remaining_1")], {"lang": "en_US",
|
||||
"project_id": False, "tz": False, "button_reactivate": True, "active_model":
|
||||
@@ -248,9 +248,9 @@
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 10.0
|
||||
- effective_hours == 40.0
|
||||
-
|
||||
-
|
||||
Make a work task entry 'Training on yml' of 5 hours
|
||||
-
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 16:55:27'
|
||||
@@ -264,16 +264,16 @@
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 5.0
|
||||
- effective_hours == 45.0
|
||||
-
|
||||
-
|
||||
Close the task
|
||||
-
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False})
|
||||
-
|
||||
-
|
||||
Check if task in done state
|
||||
-
|
||||
-
|
||||
!assert {model: project.task, id: project_task_technicaltraining0, severity: error}:
|
||||
- state == "done"
|
||||
- state == "done"
|
||||
-
|
||||
Check for effective hours and remaining hours
|
||||
-
|
||||
@@ -281,16 +281,16 @@
|
||||
- planned_hours == 30
|
||||
- remaining_hours == 0.0
|
||||
- effective_hours == 45.0
|
||||
-
|
||||
-
|
||||
Close project 'OpenERP Training Programme'
|
||||
-
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")],
|
||||
"tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id":
|
||||
ref("project.menu_open_view_project_all"), })
|
||||
-
|
||||
-
|
||||
Check if project in close state
|
||||
-
|
||||
-
|
||||
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: "Project must be in closed state"}:
|
||||
- state == "close"
|
||||
|
||||
- state == "close"
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
<field name="model">project.task.close</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Send Email" >
|
||||
<form string="Send Email">
|
||||
<group colspan="4" col="4">
|
||||
<field name="manager_warn" invisible="1"/>
|
||||
<field name="manager_email" widget="email" attrs="{'invisible':[('manager_warn','=',False)], 'required':[('manager_warn','=',True)]}"/>
|
||||
<field name="manager_email" widget="email" attrs="{'invisible':[('manager_warn','=',False)], 'required':[('manager_warn','=',True)]}" width="250"/>
|
||||
<field name="partner_warn" invisible="1"/>
|
||||
<field name="partner_email" widget="email" attrs="{'invisible':[('partner_warn','=',False)], 'required':[('partner_warn','=',True)]}"/>
|
||||
<separator string="Warn Message" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4" width="200" height="150"/>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="2" col="2">
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<page string="History" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="Global CC" widget="url"/>
|
||||
</group>
|
||||
@@ -146,7 +146,7 @@
|
||||
context="{'mail':'new', 'model': 'project.issue'}"
|
||||
icon="terp-mail-message-new" type="action" />
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<page string="Extra Info" groups="base.group_extended">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Date"/>
|
||||
<field name="create_date"/>
|
||||
|
||||
@@ -346,6 +346,30 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_phase_task_search_form_group" model="ir.ui.view">
|
||||
<field name="name">phase.task.search.form.group</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">search</field>
|
||||
<field name="inherit_id" ref="project.view_task_search_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter string="Project" name="group_project_id" icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}" position="after">
|
||||
<filter string="Project Phase" name="group_project_id_phase" icon="terp-folder-violet" domain="[]" context="{'group_by':'phase_id'}" groups="base.group_extended"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_phase_task_search_form_tree" model="ir.ui.view">
|
||||
<field name="name">phase.task.search.form.tree</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="project.view_task_tree2"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="project_id" position="after">
|
||||
<field name="phase_id" invisible="1" groups="base.group_extended"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="project_phase_task_list"
|
||||
name="Related Tasks"
|
||||
|
||||
+3
-2
@@ -931,9 +931,10 @@ class sale_order_line(osv.osv):
|
||||
'for this product: "%s" (id:%d)') % \
|
||||
(line.product_id.name, line.product_id.id,))
|
||||
else:
|
||||
a = self.pool.get('ir.property').get(cr, uid,
|
||||
prop = self.pool.get('ir.property').get(cr, uid,
|
||||
'property_account_income_categ', 'product.category',
|
||||
context=context).id
|
||||
context=context)
|
||||
a = prop and prop.id or False
|
||||
uosqty = _get_line_qty(line)
|
||||
uos_id = _get_line_uom(line)
|
||||
pu = 0.0
|
||||
|
||||
@@ -292,6 +292,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="search_view_id" ref="view_sales_order_filter"/>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
<field name="help">Sales Orders helps you manage quotations and orders done with your customers. OpenERP suggests that you to start by creating a quotation. Once the order is confirmed, the quotation is converted into a Sale Order. OpenERP can handle several types of products so that a sales order can trigger tasks, delivery orders, manufacturing orders, purchases and so on. Based on the configuration of the sale order, a draft invoice will be generated so that you just have to confirm it when you want to bill your customer.</field>
|
||||
</record>
|
||||
<menuitem action="action_order_form" id="menu_sale_order" parent="base.menu_sales" sequence="3" groups="base.group_sale_salesman,base.group_sale_manager"/>
|
||||
|
||||
@@ -31,6 +31,19 @@
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="sale_order_personal_rule" model="ir.rule">
|
||||
<field name="name">Personal Orders</field>
|
||||
<field ref="model_sale_order" name="model_id"/>
|
||||
<field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="sale_order_line_personal_rule" model="ir.rule">
|
||||
<field name="name">Personal Order Lines</field>
|
||||
<field ref="model_sale_order_line" name="model_id"/>
|
||||
<field name="domain_force">['|',('order_id.user_id','=',user.id),('order_id.user_id','=',False)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<field name="inherit_id" ref="sale.view_order_line_form2"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/field[@name='name']" position="before">
|
||||
<xpath expr="/form/group/field[@name='name']" position="before">
|
||||
<field name="layout_type" select="1" on_change="onchange_sale_order_line_view(layout_type)" />
|
||||
<field name="sequence"/>
|
||||
</xpath>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
'website': 'http://www.openerp.com',
|
||||
'data': [
|
||||
'security/share_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'share_view.xml',
|
||||
'res_users_view.xml',
|
||||
'wizard/share_wizard_view.xml'
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_share_wizard_user","access_share_wizard_user","model_share_wizard","share.group_share_user",1,1,1,1
|
||||
|
@@ -201,11 +201,11 @@ class survey_browse_response(report_rml):
|
||||
for survey in surv_obj.browse(cr, uid, [response.survey_id.id]):
|
||||
tbl_width = float(_tbl_widths.replace('cm', ''))
|
||||
colwidth = "4.6cm,5cm," + str(tbl_width - 16.4) +"cm,4cm,3cm"
|
||||
resp_create = tools.ustr(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S')))
|
||||
rml += """<blockTable colWidths='""" + colwidth + """' style="Table_heading">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Answer Create Date:- </para></td>
|
||||
# *-* formatting hard coded, breaks with utf8
|
||||
<td><para style="terp_tblheader_General_Centre_simple">""" + to_xml(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S'))) + """</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre_simple">""" + to_xml(resp_create) + """</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre"></para></td>
|
||||
<td><para style="terp_tblheader_General_right">Answer By:- </para></td>
|
||||
<td><para style="terp_tblheader_General_right_simple">""" + to_xml(response.user_id.login or '') + """</para></td>
|
||||
|
||||
@@ -77,31 +77,42 @@ class survey_question_wiz(osv.osv_memory):
|
||||
sur_name_rec = surv_name_wiz.browse(cr, uid, wiz_id)
|
||||
context.update({'sur_name_id' :wiz_id})
|
||||
else:
|
||||
sur_name_rec = surv_name_wiz.browse(cr, uid, context.get('sur_name_id', False))
|
||||
sur_name_rec = surv_name_wiz.browse(cr, uid, context['sur_name_id'])
|
||||
|
||||
if context.has_key('active_id'):
|
||||
context.pop('active_id')
|
||||
|
||||
survey_id = context.get('survey_id', False)
|
||||
if not survey_id:
|
||||
return {}
|
||||
# Try one more time to find it
|
||||
if sur_name_rec.survey_id:
|
||||
survey_id = sur_name_rec.survey_id[0]
|
||||
else:
|
||||
# raise osv.except_osv(_('Error!'), _("Cannot locate survey for the question wizard!"))
|
||||
# If this function is called without a survey_id in
|
||||
# its context, it makes no sense to return any view.
|
||||
# Just return the default, empty view for this object,
|
||||
# in order to please random calls to this fn().
|
||||
return super(survey_question_wiz, self).\
|
||||
fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context,
|
||||
toolbar=toolbar, submenu=submenu)
|
||||
sur_rec = survey_obj.browse(cr, uid, survey_id)
|
||||
p_id = map(lambda x:x.id, sur_rec.page_ids)
|
||||
total_pages = len(p_id)
|
||||
pre_button = False
|
||||
readonly = 0
|
||||
|
||||
if context.has_key('response_id') and context.get('response_id', False) \
|
||||
if context.get('response_id', False) \
|
||||
and int(context['response_id'][0]) > 0:
|
||||
readonly = 1
|
||||
|
||||
if not sur_name_rec.page_no + 1 :
|
||||
surv_name_wiz.write(cr, uid, [context.get('sur_name_id',False)], {'store_ans':{}})
|
||||
surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'store_ans':{}})
|
||||
|
||||
sur_name_read = surv_name_wiz.browse(cr, uid, context.get('sur_name_id',False))
|
||||
sur_name_read = surv_name_wiz.browse(cr, uid, context['sur_name_id'])
|
||||
page_number = int(sur_name_rec.page_no)
|
||||
if sur_name_read.transfer or not sur_name_rec.page_no + 1:
|
||||
surv_name_wiz.write(cr, uid, [context.get('sur_name_id', False)], {'transfer':False})
|
||||
surv_name_wiz.write(cr, uid, [context['sur_name_id']], {'transfer':False})
|
||||
flag = False
|
||||
fields = {}
|
||||
if sur_name_read.page == "next" or sur_name_rec.page_no == -1:
|
||||
@@ -122,7 +133,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
survey_obj.write(cr, uid, survey_id, {'state':'close', 'date_close':strftime("%Y-%m-%d %H:%M:%S")})
|
||||
|
||||
p_id = p_id[sur_name_rec.page_no + 1]
|
||||
surv_name_wiz.write(cr, uid, [context.get('sur_name_id', False)], {'page_no' : sur_name_rec.page_no + 1})
|
||||
surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'page_no' : sur_name_rec.page_no + 1})
|
||||
flag = True
|
||||
page_number += 1
|
||||
if sur_name_rec.page_no > - 1:
|
||||
@@ -130,7 +141,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
else:
|
||||
if sur_name_rec.page_no != 0:
|
||||
p_id = p_id[sur_name_rec.page_no - 1]
|
||||
surv_name_wiz.write(cr, uid, [context.get('sur_name_id', False)],\
|
||||
surv_name_wiz.write(cr, uid, [context['sur_name_id'],],\
|
||||
{'page_no' : sur_name_rec.page_no - 1})
|
||||
flag = True
|
||||
page_number -= 1
|
||||
@@ -143,6 +154,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
xml_group = etree.SubElement(xml_form, 'group', {'col': '1', 'colspan': '4'})
|
||||
if context.has_key('response_id') and context.get('response_id', False) \
|
||||
and int(context.get('response_id',0)[0]) > 0:
|
||||
# TODO: l10n, cleanup this code to make it readable. Or template?
|
||||
xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'})
|
||||
record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']])
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"})
|
||||
|
||||
@@ -27,7 +27,7 @@ from tools.translate import _
|
||||
class survey_name_wiz(osv.osv_memory):
|
||||
_name = 'survey.name.wiz'
|
||||
|
||||
def default_get(self, cr, uid, fields, context={}):
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
Set the default value in survey_id field. if open this wizard in survey form then set the default value in survey_id = active survey id.
|
||||
|
||||
@@ -38,7 +38,7 @@ class survey_name_wiz(osv.osv_memory):
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return : Dictionary value for created survey statistics report
|
||||
"""
|
||||
if not context:
|
||||
if context is None:
|
||||
context = {}
|
||||
data = super(survey_name_wiz, self).default_get(cr, uid, fields, context)
|
||||
if context.has_key('survey_id'):
|
||||
@@ -75,7 +75,7 @@ class survey_name_wiz(osv.osv_memory):
|
||||
u_list.append(use.id)
|
||||
if uid in u_list:
|
||||
result.append((sur.id, sur.title))
|
||||
return result
|
||||
return result
|
||||
for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
|
||||
if sur.state == 'open':
|
||||
res = False
|
||||
|
||||
Reference in New Issue
Block a user