commit
dcb0870abe
|
@ -1349,7 +1349,7 @@
|
|||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.config.fiscalyear</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
@ -1357,8 +1357,8 @@
|
|||
<!-- register configuration wizard -->
|
||||
|
||||
<record id="config_fiscalyear" model="ir.module.module.configuration.step">
|
||||
<field name="name">Define fiscal years</field>
|
||||
<field name="note">Define fiscal years</field>
|
||||
<field name="name">Define Fiscal Years</field>
|
||||
<field name="note">Define Fiscal Years</field>
|
||||
<field name="action_id" ref="action_config_fiscalyear_form"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
@ -1525,13 +1525,13 @@
|
|||
</field>
|
||||
</record>
|
||||
<record id="action_account_tax_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Account Tax Templates</field>
|
||||
<field name="name">Tax Templates</field>
|
||||
<field name="res_model">account.tax.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="next_id_27"/>
|
||||
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="next_id_27" sequence="13"/>
|
||||
|
||||
<!-- Account Tax Code Templates -->
|
||||
<record id="view_tax_code_template_tree" model="ir.ui.view">
|
||||
|
@ -1565,12 +1565,12 @@
|
|||
</record>
|
||||
|
||||
<record id="action_account_tax_code_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Account Tax Code Templates</field>
|
||||
<field name="name">Tax Code Templates</field>
|
||||
<field name="res_model">account.tax.code.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="next_id_27"/>
|
||||
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="next_id_27" sequence="14"/>
|
||||
|
||||
|
||||
<!-- Wizard for Multi Charts of Accounts -->
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<!--
|
||||
Partners Extension
|
||||
-->
|
||||
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.property.form.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<separator string="Supplier Debit" colspan="2"/>
|
||||
<field name="debit" select="2"/>
|
||||
</group>
|
||||
<field colspan="4" context="address=address" name="bank_ids" nolabel="1">
|
||||
<field colspan="4" context="address=address" name="bank_ids" nolabel="1" select="2">
|
||||
<form string="Bank account">
|
||||
<field name="state" select="2"/>
|
||||
<newline/>
|
||||
|
|
|
@ -109,7 +109,7 @@ class general_ledger(report_sxw.rml_parse):
|
|||
res = []
|
||||
return res
|
||||
|
||||
def lines(self, account, form):
|
||||
def lines(self, account, form, history=False):
|
||||
self.ids +=[account.id]
|
||||
if not account.check_history and not history:
|
||||
return []
|
||||
|
|
|
@ -69,7 +69,8 @@ class wizard_account_chart(wizard.interface):
|
|||
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
|
||||
result = act_obj.read(cr, uid, [id])[0]
|
||||
result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']})
|
||||
result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
|
||||
if data['form']['fiscalyear']:
|
||||
result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
|
||||
return result
|
||||
|
||||
states = {
|
||||
|
|
|
@ -147,7 +147,7 @@ class PopulateStatementFromInv(wizard.interface):
|
|||
'fields':START_FIELD,
|
||||
'state': [
|
||||
('end', '_Cancel'),
|
||||
('customer', 'C_ustomer invoices', '', True),
|
||||
('customer', '_Customer invoices', '', True),
|
||||
('supplier', '_Supplier invoices', '', True)
|
||||
]
|
||||
},
|
||||
|
|
|
@ -396,7 +396,7 @@ class account_balance(report_sxw.rml_parse):
|
|||
|
||||
ctx['fiscalyear'] = id
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
ctx['period_manner']=form['select_periods']
|
||||
ctx['period_manner']=form['period_manner']
|
||||
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
|
||||
|
||||
if len(tmp):
|
||||
|
@ -454,7 +454,7 @@ class account_balance(report_sxw.rml_parse):
|
|||
|
||||
ctx['fiscalyear'] = id
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
ctx['period_manner']=form['select_periods']
|
||||
ctx['period_manner']=form['period_manner']
|
||||
|
||||
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy())
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ dates_form = '''<?xml version="1.0"?>
|
|||
</page>
|
||||
|
||||
<page string="Select Period">
|
||||
<field name="select_periods" colspan="4"/>
|
||||
<field name="period_manner" colspan="4"/>
|
||||
<separator string="Select Period(s)" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
@ -70,18 +70,18 @@ dates_fields = {
|
|||
'landscape': {'string': 'Show Report in Landscape Form', 'type': 'boolean'},
|
||||
'format_perc': {'string': 'Show Comparision in %', 'type': 'boolean'},
|
||||
'compare_pattern':{'string':"Compare Selected Years In Terms Of",'type':'selection','selection':[('bal_cash','Cash'),('bal_perc','Percentage'),('none','Don'+ "'" +'t Compare')]},
|
||||
'select_periods':{'string':"Select Invoices Based on Their",'type':'selection','selection':[('actual','Actual Period (Duration)'),('created','Creation Date')]},
|
||||
'period_manner':{'string':"Entries Selection Based on",'type':'selection','selection':[('actual','Financial Period'),('created','Creation Date')]},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}
|
||||
}
|
||||
|
||||
back_form='''<?xml version="1.0"?>
|
||||
<form string="Notification">
|
||||
<separator string="You might have done following mistakes.Please correct them and try again." colspan="4"/>
|
||||
<separator string="You might have done following mistakes. Please correct them and try again." colspan="4"/>
|
||||
<separator string="1. You have selected more than 3 years in any case." colspan="4"/>
|
||||
<separator string="2. You have not selected 'Percentage' option,but you have selected more than 2 years." colspan="4"/>
|
||||
<label string="You can select maximum 3 years.Please check again." colspan="4"/>
|
||||
<separator string="3. You have selected 'Percentage' option with more than 2 years,but you have not selected landscape format." colspan="4"/>
|
||||
<label string="You have to select 'Landscape' option.Please Check it." colspan="4"/>
|
||||
<separator string="2. You have not selected 'Percentage' option, but you have selected more than 2 years." colspan="4"/>
|
||||
<label string="You can select maximum 3 years. Please check again." colspan="4"/>
|
||||
<separator string="3. You have selected 'Percentage' option with more than 2 years, but you have not selected landscape format." colspan="4"/>
|
||||
<label string="You have to select 'Landscape' option. Please Check it." colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
back_fields={
|
||||
|
@ -146,7 +146,7 @@ class wizard_report(wizard.interface):
|
|||
# data['form']['periods']=p_ids
|
||||
data['form']['compare_pattern']='none'
|
||||
data['form']['account_choice']='moves'
|
||||
data['form']['select_periods']='actual'
|
||||
data['form']['period_manner']='actual'
|
||||
return data['form']
|
||||
|
||||
|
||||
|
|
|
@ -104,11 +104,13 @@ class account_move_line(osv.osv):
|
|||
line2bank[line.id] = line.invoice.partner_bank.id
|
||||
elif line.partner_id:
|
||||
if not line.partner_id.bank_ids:
|
||||
raise osv.except_osv(_('Error !'), _('Partner '+ line.partner_id.name+ ' has no bank account defined'))
|
||||
for bank in line.partner_id.bank_ids:
|
||||
if bank.state in bank_type:
|
||||
line2bank[line.id] = bank.id
|
||||
break
|
||||
#raise osv.except_osv(_('Error !'), _('Partner '+ line.partner_id.name+ ' has no bank account defined'))
|
||||
line2bank[line.id] = False
|
||||
else:
|
||||
for bank in line.partner_id.bank_ids:
|
||||
if bank.state in bank_type:
|
||||
line2bank[line.id] = bank.id
|
||||
break
|
||||
if line.id not in line2bank and line.partner_id.bank_ids:
|
||||
line2bank[line.id] = line.partner_id.bank_ids[0].id
|
||||
else:
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
<field name="currency" nolabel="1"/>
|
||||
</group>
|
||||
<field name="partner_id" on_change="onchange_partner(partner_id,parent.mode)" select="1"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="bank_id" required="1"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="bank_id"/>
|
||||
<separator colspan="2" string="Owner Account"/>
|
||||
<separator colspan="2" string="Desitination Account"/>
|
||||
<field colspan="2" name="info_owner" nolabel="1"/>
|
||||
|
|
|
@ -75,7 +75,7 @@ def search_entries(self, cr, uid, data, context):
|
|||
<field name="entries" colspan="4" height="300" width="800" nolabel="1"
|
||||
domain="[('id', 'in', [%s])]" %s/>
|
||||
</form>''' % (','.join([str(x) for x in line_ids]), ctx)
|
||||
return {'entries': line_ids}
|
||||
return {}
|
||||
|
||||
def create_payment(self, cr, uid, data, context):
|
||||
line_ids= data['form']['entries'][0][2]
|
||||
|
@ -88,7 +88,7 @@ def create_payment(self, cr, uid, data, context):
|
|||
payment = order_obj.browse(cr, uid, data['id'],
|
||||
context=context)
|
||||
t = payment.mode and payment.mode.type.id or None
|
||||
line2bank= pool.get('account.move.line').line2bank(cr, uid,
|
||||
line2bank = pool.get('account.move.line').line2bank(cr, uid,
|
||||
line_ids, t, context)
|
||||
|
||||
## Finally populate the current payment with new lines:
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
<openerp>
|
||||
<data><!-- NoOne doesn't exist anymore
|
||||
<record id="hr.menu_hr_root" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="crm.menu_crm" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="product.menu_product_pricelist_main" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="product.menu_product_price_type_action" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="product.menu_product_pricelist_type_action" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="product.menu_product_variant_action" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
<record id="product.menu_product_template_action" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('base.noone')])]" name="groups_id"/>
|
||||
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
|
|
|
@ -6,22 +6,33 @@
|
|||
<field eval=""terp-calendar"" name="icon"/>
|
||||
<field eval="False" name="parent_id"/>
|
||||
</record>
|
||||
<record id="association_vertical.menu_crm_case_fund_raise" model="ir.ui.menu">
|
||||
<record id="association_vertical.menu_crm_case_fund_raise" model="ir.ui.menu">
|
||||
<field eval=""Fund Raising"" name="name"/>
|
||||
<field eval=""terp-account"" name="icon"/>
|
||||
<field eval="False" name="parent_id"/>
|
||||
</record>
|
||||
</record>
|
||||
<record id="product.menu_main_product" model="ir.ui.menu">
|
||||
<field model="ir.ui.menu" name="parent_id" search="[('name','=','Configuration'),('parent_id.name','=','Financial Management')]"/>
|
||||
</record>
|
||||
|
||||
<!-- For Shortcuts menu -->
|
||||
|
||||
<record id="ir_ui_view_sc_mymeetings1" model="ir.ui.view_sc">
|
||||
<field ref="crm_configuration.menu_crm_case_categ_meet_my" name="res_id"/>
|
||||
<field eval=""ir.ui.menu"" name="resource"/>
|
||||
<field eval=""My Meetings"" name="name"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<!-- For Shortcuts menu
|
||||
-->
|
||||
<!--
|
||||
<record model="ir.ui.view_sc" id="ir_ui_view_sc_mymeetings1">
|
||||
<field name="name">"My Meetings"</field>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="resource">ir.ui.menu</field>
|
||||
<field name="sequence">4</field>
|
||||
<field name="res_id" ref="crm_configuration.menu_crm_case_categ_meet_my"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view_sc" id="ir_ui_view_sc_myopenprojects1">
|
||||
<field name="name">"My Open Projects"</field>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="resource">ir.ui.menu</field>
|
||||
<field name="sequence">4</field>
|
||||
<field name="res_id" ref="project.menu_open_view_my_project_open"/>
|
||||
</record>
|
||||
|
||||
<record id="ir_ui_view_sc_myopenprojects1" model="ir.ui.view_sc">
|
||||
|
@ -44,6 +55,6 @@
|
|||
<field eval=""Events"" name="name"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -51,8 +51,9 @@
|
|||
<field name="section_id" ref="section_support4"/>
|
||||
</record>
|
||||
|
||||
<!-- MENU -->
|
||||
<menuitem name="CRM & SRM/Fund Raising" id="menu_crm_case_fund_raise"/>
|
||||
<!-- MENU -->
|
||||
<menuitem name="Fund Raising" id="menu_crm_case_fund_raise" parent="crm.menu_crm"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund1">
|
||||
<field name="name">Funds</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
|
@ -72,7 +73,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund1"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/New Fund Opportunity" id="menu_crm_case_categ0_act_fund" action="crm_case_category_act_fund1"/>
|
||||
<menuitem name="New Fund Opportunity" id="menu_crm_case_categ0_act_fund" action="crm_case_category_act_fund1" parent="menu_crm_case_fund_raise"/>
|
||||
|
||||
<!-- My Funds -->
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my1">
|
||||
|
@ -100,7 +101,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_my1"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/My Funds" id="menu_crm_case_category_act_fund_my1" action="crm_case_category_act_fund_my1"/>
|
||||
<menuitem name="My Funds" id="menu_crm_case_category_act_fund_my1" action="crm_case_category_act_fund_my1" parent="menu_crm_case_fund_raise"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my2">
|
||||
<field name="name">My Funds Waiting Validation</field>
|
||||
|
@ -127,7 +128,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_my2"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/My Funds/My Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_my2" action="crm_case_category_act_fund_my2"/>
|
||||
<menuitem name="My Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_my2" action="crm_case_category_act_fund_my2" parent="menu_crm_case_category_act_fund_my1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my3">
|
||||
<field name="name">My Funds To Be Processed</field>
|
||||
|
@ -154,7 +155,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_my3"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/My Funds/My Funds To Be Processed" id="menu_crm_case_categ0_act_fund_my3" action="crm_case_category_act_fund_my3"/>
|
||||
<menuitem name="My Funds To Be Processed" id="menu_crm_case_categ0_act_fund_my3" action="crm_case_category_act_fund_my3" parent="menu_crm_case_category_act_fund_my1"/>
|
||||
|
||||
<!-- All Funds -->
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all1">
|
||||
|
@ -182,7 +183,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_all1"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/All Funds" id="menu_crm_case_categ0_act_fund_all1" action="crm_case_category_act_fund_all1"/>
|
||||
<menuitem name="All Funds" id="menu_crm_case_categ0_act_fund_all1" action="crm_case_category_act_fund_all1" parent="menu_crm_case_fund_raise"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all2">
|
||||
<field name="name">All Funds Waiting Validation</field>
|
||||
|
@ -209,7 +210,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_all2"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/All Funds/All Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_all2" action="crm_case_category_act_fund_all2"/>
|
||||
<menuitem name="All Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_all2" action="crm_case_category_act_fund_all2" parent="menu_crm_case_categ0_act_fund_all1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all3">
|
||||
<field name="name">All Funds To Be Processed</field>
|
||||
|
@ -236,7 +237,7 @@
|
|||
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_fund_all3"/>
|
||||
</record>
|
||||
<menuitem name="CRM & SRM/Fund Raising/All Funds/All Funds To Be Processed" id="menu_crm_case_categ0_act_fund_all3" action="crm_case_category_act_fund_all3"/>
|
||||
<menuitem name="All Funds To Be Processed" id="menu_crm_case_categ0_act_fund_all3" action="crm_case_category_act_fund_all3" parent="menu_crm_case_categ0_act_fund_all1"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -92,7 +92,6 @@ class auction_dates(osv.osv):
|
|||
_order = "auction1 desc"
|
||||
|
||||
def close(self, cr, uid, ids, *args):
|
||||
print "GGGGGGGGGGGGGGGggg"
|
||||
"""
|
||||
Close an auction date.
|
||||
|
||||
|
@ -107,13 +106,11 @@ class auction_dates(osv.osv):
|
|||
ach_uids = {}
|
||||
cr.execute('select id from auction_lots where auction_id in ('+','.join(map(str,ids))+') and state=%s and obj_price>0', ('draft',))
|
||||
r=self.pool.get('auction.lots').lots_invoice(cr, uid, [x[0] for x in cr.fetchall()],{},None)
|
||||
print "RRRRRRRRRRRRRRRRrrrr",r
|
||||
cr.execute('select id from auction_lots where auction_id in ('+','.join(map(str,ids))+') and obj_price>0')
|
||||
ids2 = [x[0] for x in cr.fetchall()]
|
||||
# for auction in auction_ids:
|
||||
c=self.pool.get('auction.lots').seller_trans_create(cr, uid, ids2,{})
|
||||
self.write(cr, uid, ids, {'state':'closed'}) #close the auction
|
||||
print "jjjjjjjjjjjjjjjj"
|
||||
return True
|
||||
auction_dates()
|
||||
|
||||
|
@ -443,7 +440,7 @@ class auction_lots(osv.osv):
|
|||
'ach_login': fields.char('Buyer Username',size=64),
|
||||
'ach_uid': fields.many2one('res.partner', 'Buyer'),
|
||||
'ach_emp': fields.boolean('Taken Away'),
|
||||
'is_ok': fields.boolean('Buyer s payment'),
|
||||
'is_ok': fields.boolean('Buyer\'s payment'),
|
||||
'ach_inv_id': fields.many2one('account.invoice','Buyer Invoice', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'sel_inv_id': fields.many2one('account.invoice','Seller Invoice', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'vnd_lim': fields.float('Seller limit'),
|
||||
|
@ -644,6 +641,8 @@ class auction_lots(osv.osv):
|
|||
res = self.pool.get('res.partner').address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
|
||||
contact_addr_id = res['contact']
|
||||
invoice_addr_id = res['invoice']
|
||||
if not invoice_addr_id:
|
||||
raise orm.except_orm('No Invoice Address', 'The Buyer "%s" has no Invoice Address.' % (contact_addr_id,))
|
||||
inv = {
|
||||
'name': 'Auction proforma:' +lot.name,
|
||||
'journal_id': lot.auction_id.journal_id.id,
|
||||
|
@ -756,9 +755,7 @@ class auction_lots(osv.osv):
|
|||
dt = time.strftime('%Y-%m-%d')
|
||||
inv_ref=self.pool.get('account.invoice')
|
||||
invoices={}
|
||||
print "KKKKKKKKKKKKKKKKK"
|
||||
for lot in self.browse(cr, uid, ids,context):
|
||||
print "LLLLLLLLLLLLLLLL"
|
||||
# partner_ref = lot.ach_uid.id
|
||||
if not lot.auction_id.id:
|
||||
continue
|
||||
|
@ -768,6 +765,9 @@ class auction_lots(osv.osv):
|
|||
if (lot.auction_id.id,lot.ach_uid.id) in invoices:
|
||||
inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)]
|
||||
else:
|
||||
add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
|
||||
if not len(add):
|
||||
raise orm.except_orm('Missed Address !', 'The Buyer has no Invoice Address.')
|
||||
price = lot.obj_price or 0.0
|
||||
lot_name =lot.obj_num
|
||||
inv={
|
||||
|
@ -776,13 +776,13 @@ class auction_lots(osv.osv):
|
|||
'journal_id': lot.auction_id.journal_id.id,
|
||||
'partner_id': lot.ach_uid.id,
|
||||
'type': 'out_invoice',
|
||||
|
||||
}
|
||||
if invoice_number:
|
||||
inv['number'] = invoice_number
|
||||
inv.update(inv_ref.onchange_partner_id(cr,uid, [], 'out_invoice', lot.ach_uid.id)['value'])
|
||||
#inv['account_id'] = inv['account_id'] and inv['account_id'][0]
|
||||
inv_id = inv_ref.create(cr, uid, inv, context)
|
||||
print "IN>>>>>>>>>>>>ID",inv_id
|
||||
invoices[(lot.auction_id.id,lot.ach_uid.id)] = inv_id
|
||||
self.write(cr,uid,[lot.id],{'ach_inv_id':inv_id,'state':'sold'})
|
||||
#calcul des taxes
|
||||
|
@ -848,7 +848,10 @@ class auction_bid(osv.osv):
|
|||
if not partner_id:
|
||||
return {'value': {'contact_tel':False}}
|
||||
contact = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
v_contact=contact.address[0] and contact.address[0].phone or False
|
||||
if len(contact.address):
|
||||
v_contact=contact.address[0] and contact.address[0].phone
|
||||
else:
|
||||
v_contact = False
|
||||
return {'value': {'contact_tel': v_contact}}
|
||||
|
||||
auction_bid()
|
||||
|
@ -876,7 +879,6 @@ class auction_bid_lines(osv.osv):
|
|||
# lots=self.browse(cr,uid,ids)
|
||||
# for lot in lots:
|
||||
# res[lot.id] = lot.lot_id.auction_id.name
|
||||
# print lot.lot_id.auction_id.name
|
||||
# return res
|
||||
_columns = {
|
||||
'name': fields.char('Bid date',size=64),
|
||||
|
@ -1026,6 +1028,7 @@ class report_seller_auction2(osv.osv):
|
|||
_name = "report.seller.auction2"
|
||||
_description = "Auction Reporting on seller view2"
|
||||
_auto = False
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'seller': fields.many2one('res.partner','Seller',readonly=True, select=1),
|
||||
'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Auction Management" id="menu_root" icon="terp-purchase"/>
|
||||
<menuitem name="Auction Management/Configuration"/>
|
||||
<menuitem name="Auction Management" id="auction_menu_root" icon="terp-purchase"/>
|
||||
<menuitem name="Configuration" parent="auction_menu_root" id="auction_config_menu" sequence="1"/>
|
||||
|
||||
=======================================================
|
||||
Auction Management/Configuration/artist
|
||||
|
@ -39,7 +39,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_auction_artist_tree"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Configuration/Define Artists" action="action_auction_artist" id="menu_auction_artist"/>
|
||||
<menuitem name="Define Artists" parent="auction_config_menu" action="action_auction_artist" id="menu_auction_artist"/>
|
||||
|
||||
=======================================================
|
||||
Auction Management/Configuration/objectcategories
|
||||
|
@ -74,7 +74,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_auction_object_categories_tree"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Configuration/Object Categories" action="action_auction_object_categories" id="menu_auction_object_cat"/>
|
||||
<menuitem name="Object Categories" parent="auction_config_menu" action="action_auction_object_categories" id="menu_auction_object_cat"/>
|
||||
=======================================================
|
||||
Auction Management/Auction Dates/New Auction Dates
|
||||
=======================================================
|
||||
|
@ -126,7 +126,9 @@ Auction Management/Auction Dates/New Auction Dates
|
|||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Auction Dates/Next Auction Dates" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
|
||||
|
||||
<menuitem name="Auction Dates" parent="auction_menu_root" id="auction_date_menu"/>
|
||||
<menuitem name="Next Auction Dates" parent="auction_date_menu" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
|
||||
=======================================================
|
||||
Auction Management/Auction Dates/Old Auction Dates
|
||||
=======================================================
|
||||
|
@ -137,15 +139,14 @@ Auction Management/Auction Dates/New Auction Dates
|
|||
<field name="domain">[('state','=','closed')]</field>
|
||||
<field name="view_id" ref="view_auction_dates_tree"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Auction Dates/Old Auction Dates" id="menu_auction_dates_old" action="action_auction_dates_old"/>
|
||||
<menuitem parent="auction_date_menu" name="Old Auction Dates" id="menu_auction_dates_old" action="action_auction_dates_old"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_dates1">
|
||||
<field name="res_model">auction.dates</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_auction_dates_form"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Auction Dates"/>
|
||||
<menuitem name="Auction Management/Auction Dates/New Auction Dates" id="menu_auction_dates_new" action="action_auction_dates1"/>
|
||||
<menuitem name="New Auction Dates" parent="auction_date_menu" id="menu_auction_dates_new" action="action_auction_dates1"/>
|
||||
|
||||
|
||||
|
||||
|
@ -288,10 +289,9 @@ Auction Management/Auction Dates/Reporting
|
|||
<group col="4" colspan="2">
|
||||
<button name="button_bought" string="Sold" states="draft" type="object"/>
|
||||
<button name="button_not_bought" string="Not sold" states="draft" type="object"/>
|
||||
<button name="button_taken_away" string="Taken away" states="sold" type="object"/>
|
||||
<button name="button_draft" string="Set to draft" states="sold,unsold" type="object"/>
|
||||
<button name="button_unpaid" string="Set to draft" states="paid" type="object"/>
|
||||
<button name="button_taken_away" string="Taken away" states="sold" type="object"/>
|
||||
|
||||
</group>
|
||||
</page>
|
||||
|
||||
|
@ -359,16 +359,22 @@ Auction Management/Auction Dates/Reporting
|
|||
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects">
|
||||
<field name="res_model">auction.lots</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects_sold">
|
||||
<field name="res_model">auction.lots</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('state','=','sold')]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Auction Management/Objects/All objects/Sold Objects"
|
||||
action="action_all_objects_sold"
|
||||
id="menu_all_objects_sold1"/>
|
||||
|
||||
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu"/>
|
||||
<menuitem name="All objects" action="action_all_objects" parent="auction_objects_menu" id="auction_all_objects_menu"/>
|
||||
|
||||
<menuitem name="Sold Objects" parent="auction_all_objects_menu" action="action_all_objects_sold" id="menu_all_objects_sold1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects_to_sell">
|
||||
<field name="res_model">auction.lots</field>
|
||||
|
@ -376,7 +382,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','<>','sold')]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Objects/All objects/Objects to sell" action="action_all_objects_to_sell" id="menu_all_objects_to_sell"/>
|
||||
<menuitem name="Objects to sell" parent="auction_all_objects_menu" action="action_all_objects_to_sell" id="menu_all_objects_to_sell"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects_unplanned">
|
||||
<field name="res_model">auction.lots</field>
|
||||
|
@ -384,15 +390,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('auction_id','=', False),('state','=','draft')]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Objects/All objects/Unplanned objects" action="action_all_objects_unplanned" id="menu_all_objects_unplanned1"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects">
|
||||
<field name="res_model">auction.lots</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Objects/All objects" action="action_all_objects" id="menu_auction_all_objects" menu="menu_action_all_objects"/>
|
||||
<menuitem name="Unplanned objects" parent="auction_all_objects_menu" action="action_all_objects_unplanned" id="menu_all_objects_unplanned1"/>
|
||||
|
||||
|
||||
<!-- for the sold object start-->
|
||||
|
@ -404,7 +402,8 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="domain">[('state','=','unsold')]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Auction Management/Objects/All objects/Unsold Objects"
|
||||
name="Unsold Objects"
|
||||
parent="auction_all_objects_menu"
|
||||
action="action_all_objects_unsold"
|
||||
id="menu_all_objects_unsold"/>
|
||||
|
||||
|
@ -481,7 +480,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Objects/All objects/Unclassified objects" action="action_unclassified_objects" id="menu_all_objects_unclassified"/>
|
||||
<menuitem name="Unclassified objects" parent="auction_all_objects_menu" action="action_unclassified_objects" id="menu_all_objects_unclassified"/>
|
||||
|
||||
<record model="ir.ui.view" id="v12">
|
||||
<field name="name">Auction.deposit.tree</field>
|
||||
|
@ -599,8 +598,9 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_deposit_border_tree2"/>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Sellers"/>
|
||||
<menuitem name="Auction Management/Sellers/Deposit border" action="action_deposit_border" id="menu_auction_deposit_border"/>
|
||||
|
||||
<menuitem name="Sellers" id="auction_seller_menu" parent="auction_menu_root"/>
|
||||
<menuitem name="Deposit border" parent="auction_seller_menu" action="action_deposit_border" id="menu_auction_deposit_border"/>
|
||||
|
||||
=======================================================
|
||||
"Auction Management/Buyers/Bids
|
||||
|
@ -640,8 +640,6 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="res_model">auction.bid</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<!--<menuitem name="Auction Management/Buyers"/>-->
|
||||
<!--menuitem name="Auction Management/Buyers/Bids Form" action="b11"/>-->
|
||||
|
||||
|
||||
=======================================================
|
||||
|
@ -696,7 +694,9 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="res_model">auction.bid</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Buyers/Bids" action="action_bid_open" id="menu_action_bid_open"/>
|
||||
|
||||
<menuitem name="Buyers" id="auction_buyers_menu" parent="auction_menu_root"/>
|
||||
<menuitem name="Bids" parent="auction_buyers_menu" action="action_bid_open" id="menu_action_bid_open"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_bids_form">
|
||||
|
@ -705,7 +705,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Auction Management/Buyers/Bids/Bids line" action="action_bids_form" id="menu_action_bids_form"/>
|
||||
<menuitem name="Bids line" parent="menu_action_bid_open" action="action_bids_form" id="menu_action_bids_form"/>
|
||||
|
||||
|
||||
<!--start : creating auction Reporting menu for the auction by pmo-->
|
||||
|
@ -743,7 +743,8 @@ Auction Management/Auction Dates/Reporting
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting"/>
|
||||
|
||||
<menuitem name="Reporting" id="auction_report_menu" parent="auction_menu_root"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_report_allmonth_view1">
|
||||
|
@ -753,7 +754,8 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree</field>
|
||||
<!--field name="domain">[('auction_id','=', active_id)]</field-->
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Auction/Auction's summary" action="action_auction_report_allmonth_view1" id="menu_auction_allmonth_view1"/>
|
||||
<menuitem name="Auction" id="auction_report_auction_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Auction's Summary" parent="auction_report_auction_menu" action="action_auction_report_allmonth_view1" id="menu_auction_allmonth_view1"/>
|
||||
|
||||
|
||||
|
||||
|
@ -799,7 +801,9 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
<!-- <menuitem name="Auction Management/Reporting/Auction/This Month/Result of Auction" action="action_auction_report_thismonth_view2" id="menu_auction_thismonth_view2"/-->
|
||||
|
||||
<!-- <menuitem name="This Month" id="auction_report_thismonth_menu" parent="auction_report_menu"/> -->
|
||||
<!-- <menuitem name="Result of Auction" action="action_auction_report_thismonth_view2" id="menu_auction_thismonth_view2" parent="auction_report_thismonth_menu"/> -->
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_report_allmonth_view2">
|
||||
|
@ -808,7 +812,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Auction/Auction's revenues" action="action_auction_report_allmonth_view2" id="menu_auction_allmonth_view2"/>
|
||||
<menuitem name="Auction's Revenues" parent="auction_report_auction_menu" action="action_auction_report_allmonth_view2" id="menu_auction_allmonth_view2"/>
|
||||
|
||||
<!--start : creating seller Reporting menu for the selller by pmo-->
|
||||
|
||||
|
@ -865,14 +869,15 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree,graph</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
<!--menuitem name="Auction Management/Reporting/seller/This Month/Seller object details" action="action_auction_reporting1" id="menu_seller_thismonth_view1"/-->
|
||||
<record model="ir.actions.act_window" id="action_auction_reporting_all1">
|
||||
<field name="name">Seller's auction</field>
|
||||
<field name="res_model">report.seller.auction</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Seller/Seller's summary" action="action_auction_reporting_all1" id="menu_seller_allmonth_view1"/>
|
||||
<menuitem name="Sellers" id="auction_report_seller_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Seller's Summary" action="action_auction_reporting_all1" id="menu_seller_allmonth_view1" parent="auction_report_seller_menu"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_form2">
|
||||
<field name="name">Seller's auction</field>
|
||||
<field name="model">report.seller.auction2</field>
|
||||
|
@ -926,7 +931,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree,graph</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Seller/Seller's revenues" action="action_auction_reporting_all2" id="menu_seller_allmonth_view2"/>
|
||||
<menuitem name="Seller's Revenues" action="action_auction_reporting_all2" id="menu_seller_allmonth_view2" parent="auction_report_seller_menu"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_buyer_form">
|
||||
<field name="name">Buyer's auction</field>
|
||||
|
@ -964,7 +969,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
<!--menuitem name="Auction Management/Reporting/Buyer/This Month/Buyer's details " action="action_auction_buyer_reporting" id="menu_buyer_thismonth_view1"/-->
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_buyer_form2">
|
||||
<field name="name">Buyer's auction</field>
|
||||
<field name="model">report.buyer.auction2</field>
|
||||
|
@ -1003,7 +1008,6 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
<!--menuitem name="Auction Management/Reporting/Buyer/This Month/Buyer's results " action="action_auction_buyer_reporting2" id="menu_buyer_thismonth_view2"/-->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_buyer_reporting_all1">
|
||||
<field name="name">Buyer's auction</field>
|
||||
|
@ -1011,17 +1015,19 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Buyer/Buyer's summary" action="action_auction_buyer_reporting_all1" id="menu_buyer_allmonth_view1"/>
|
||||
<menuitem name="Buyer" id="auction_report_buyer_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Buyer's Summary" action="action_auction_buyer_reporting_all1" id="menu_buyer_allmonth_view1" parent="auction_report_buyer_menu"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_buyer_reporting_all2">
|
||||
<field name="name">Buyer's auction for all months</field>
|
||||
<field name="res_model">report.buyer.auction2</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Buyer/Buyer's revenues" action="action_auction_buyer_reporting_all2" id="menu_buyer_allmonth_view2"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<menuitem name="Buyer's Revenues" action="action_auction_buyer_reporting_all2" id="menu_buyer_allmonth_view2" parent="auction_report_buyer_menu"/>
|
||||
|
||||
<!--end : creating buyer Reporting menu for the buyer by pmo-->
|
||||
|
||||
|
@ -1126,13 +1132,16 @@ estimation.adj.category
|
|||
<field name="view_mode">graph,tree</field>
|
||||
<field name="domain">[('date','like',time.strftime('%Y-%m')),('user_id','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Employees/Comparison of estimations" action="action_report_auction_estimation_adj_category_member_tree" id="menu_report_auction_estimation_adj_category_member"/>
|
||||
<menuitem name="Auction Management/Reporting/Manager/Comparison of estimations" action="action_report_auction_estimation_adj_category_manager_tree" id="menu_report_auction_estimation_adj_category_manager"/>
|
||||
|
||||
<menuitem name="Employees" id="auction_report_employees_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Comparison of estimations" action="action_report_auction_estimation_adj_category_member_tree" id="menu_report_auction_estimation_adj_category_member" parent="auction_report_employees_menu"/>
|
||||
<menuitem name="Manager" id="auction_report_manager_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Comparison of estimations" action="action_report_auction_estimation_adj_category_manager_tree" id="menu_report_auction_estimation_adj_category_manager" parent="auction_report_manager_menu"/>
|
||||
|
||||
|
||||
=<!--=============================
|
||||
<!--=============================
|
||||
sign in sign out report by user
|
||||
==============================
|
||||
==============================
|
||||
|
||||
<record model="ir.ui.view" id="view_report_auction_sign_in_out_tree">
|
||||
<field name="name">report.auction.user.pointing.tree</field>
|
||||
|
@ -1170,12 +1179,10 @@ sign in sign out report by user
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Member/Summury of Sign_in Sign_out" action="action_report_auction_sign_in_out_member_tree" id="menu_report_auction_sign_in_out_member_tree"/>
|
||||
<menuitem name="Auction Management/Reporting/Manager/Summury of Sign_in Sign_out" action="action_report_auction_sign_in_out_manager_tree" id="menu_report_auction_sign_in_out_manager_tree"/>
|
||||
<menuitem name="Summury of Sign_in Sign_out" action="action_report_auction_sign_in_out_member_tree" id="menu_report_auction_sign_in_out_member_tree" parent="auction_report_manager_menu"/>
|
||||
<menuitem name="Summury of Sign_in Sign_out" action="action_report_auction_sign_in_out_manager_tree" id="menu_report_auction_sign_in_out_manager_tree" parent="auction_report_manager_menu"/>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_report_auction_sign_in_out_tree1">
|
||||
<field name="name">report attendance</field>
|
||||
<field name="model">report.attendance</field>
|
||||
|
@ -1212,7 +1219,7 @@ sign in sign out report by user
|
|||
<field name="domain"> [('employee_id','=',uid)]</field>
|
||||
<!--<field name="domain"> [('name','ilike',time.strftime('%Y-%m'))]</field>-->
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Employees/Attendance" action="action_report_auction_sign_in_out_member_tree1" id="menu_report_auction_sign_in_out_member_tree1"/>
|
||||
<menuitem name="Attendance" action="action_report_auction_sign_in_out_member_tree1" id="menu_report_auction_sign_in_out_member_tree1" parent="auction_report_employees_menu"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_auction_sign_in_out_manager_tree1">
|
||||
|
@ -1222,7 +1229,7 @@ sign in sign out report by user
|
|||
<field name="domain"> [('name','ilike',time.strftime('%Y-%m-%d'))]</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Auction Management/Reporting/Manager/Attendance" action="action_report_auction_sign_in_out_manager_tree1" id="menu_report_auction_sign_in_out_manager_tree1"/>
|
||||
<menuitem name="Attendance" action="action_report_auction_sign_in_out_manager_tree1" id="menu_report_auction_sign_in_out_manager_tree1" parent="auction_report_manager_menu"/>
|
||||
|
||||
==============================
|
||||
My Latest Objects
|
||||
|
@ -1233,7 +1240,7 @@ My Latest Objects
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('create_uid','=',uid)]</field>
|
||||
</record>
|
||||
<!--menuitem name="Auction Management/Reporting/Member/My Latest Objects" action="action_report_latest_objects_tree" id="menu_report_latest_objects_tree"/-->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_latest_objects_manager_tree">
|
||||
<field name="res_model">auction.lots</field>
|
||||
<field name="view_type">form</field>
|
||||
|
@ -1252,7 +1259,7 @@ My Latest Deposit
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('create_uid','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Employees/My Latest Deposits" action="action_report_latest_doposit_tree" id="menu_report_latest_doposit_tree"/>
|
||||
<menuitem name="My Latest Deposits" action="action_report_latest_doposit_tree" id="menu_report_latest_doposit_tree" parent="auction_report_employees_menu"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_latest_doposit_manager_tree">
|
||||
<field name="res_model">auction.deposit</field>
|
||||
|
@ -1260,7 +1267,7 @@ My Latest Deposit
|
|||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Auction Management/Reporting/Manager/Latest Deposits" action="action_report_latest_doposit_manager_tree" id="menu_report_latest_doposit_tree_manager"/>
|
||||
<menuitem name="Latest Deposits" action="action_report_latest_doposit_manager_tree" id="menu_report_latest_doposit_tree_manager" parent="auction_report_manager_menu"/>
|
||||
=============================
|
||||
Objects per Day
|
||||
==============================
|
||||
|
@ -1319,13 +1326,15 @@ Objects per Day
|
|||
<field name="domain">[('month','=',time.strftime('%Y-%m-01'))]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Auction Management/Reporting/Manager/Encoded Objects Per Day"
|
||||
name="Encoded Objects Per Day"
|
||||
action="action_report_auction_object_date_tree"
|
||||
id="menu_report_auction_object_date_tree"/>
|
||||
id="menu_report_auction_object_date_tree"
|
||||
parent="auction_report_manager_menu"/>
|
||||
<menuitem
|
||||
name="Auction Management/Reporting/Employees/My Encoded Objects Per Day"
|
||||
name="My Encoded Objects Per Day"
|
||||
action="action_report_auction_object_date_tree_my"
|
||||
id="menu_report_auction_object_date_tree1_my"/>
|
||||
id="menu_report_auction_object_date_tree1_my"
|
||||
parent="auction_report_employees_menu"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="view_report_object_by_auction">
|
||||
|
@ -1376,9 +1385,10 @@ Objects per Day
|
|||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('state','=', 'draft')]</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Objects/Objects by Auction"
|
||||
<menuitem name="Objects by Auction"
|
||||
parent="auction_objects_menu"
|
||||
id="menu_auction_dates_next_by_auction"
|
||||
action="action_report_object_by_auction"/>
|
||||
action="action_report_object_by_auction" sequence="11"/>
|
||||
|
||||
<act_window name="Open lots"
|
||||
domain="[('auction_id', '=', active_id)]"
|
||||
|
@ -1423,9 +1433,8 @@ Auction adjudication
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Manager/Adjudication by Auction" action="action_report_auction_adjudication_tree" id="menu_report_auction_adjudication_tree"/>
|
||||
<menuitem name="Adjudication by Auction" action="action_report_auction_adjudication_tree" id="menu_report_auction_adjudication_tree" parent="auction_report_manager_menu"/>
|
||||
|
||||
<!--menuitem name="Auction Management/Reporting/Member/Auction Adjudication" action="action_report_auction_adjudication_tree" id="menu_report_auction_adjudication_tree1"/-->
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_deposit_tree">
|
||||
<field name="name">Depositer's statistics</field>
|
||||
|
@ -1446,8 +1455,8 @@ Auction adjudication
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<menuitem name="Auction Management/Reporting/Manager/ Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_m"/>
|
||||
<menuitem name="Auction Management/Reporting/Employees/ Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_member"/>
|
||||
<menuitem name="Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_m" parent="auction_report_manager_menu"/>
|
||||
<menuitem name="Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_member" parent="auction_report_employees_menu"/>
|
||||
=============================
|
||||
Object encoded
|
||||
==============================
|
||||
|
@ -1521,8 +1530,6 @@ Object encoded
|
|||
<field name="domain"> [('user_id','=',uid),('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
|
||||
<!--menuitem name="Auction Management/Reporting/Member/Objects Statistics" action="action_report_object_encoded_member_tree" id="menu_report_objects_tree_member"/-->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_report_object_encoded_manager_tree">
|
||||
<field name="name">report.object.encoded.tree</field>
|
||||
|
@ -1567,7 +1574,6 @@ Object encoded
|
|||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
|
||||
<!--menuitem name="Auction Management/Reporting/Manager/Objects Statistics" action="action_report_object_encoded_manager_tree" id="menu_report_objects_tree_manager"/-->
|
||||
<record model="ir.ui.view" id="view_report_unclassified_objects">
|
||||
<field name="name">report.unclassified.objects</field>
|
||||
<field name="model">report.unclassified.objects</field>
|
||||
|
|
|
@ -41,10 +41,17 @@
|
|||
name="auction.taken"
|
||||
multi="1"
|
||||
id="wizard_emporte"/>
|
||||
<menuitem name="Auction Management/Outils Bar Codes/Gestion des livraisons"
|
||||
|
||||
<menuitem name="Tools Bar Codes"
|
||||
id="auction_outils_menu"
|
||||
parent="auction_menu_root"
|
||||
/>
|
||||
|
||||
<menuitem name="Deliveries Management"
|
||||
action="wizard_emporte"
|
||||
type="wizard"
|
||||
id="menu_wizard_emporte"
|
||||
parent="auction_outils_menu"
|
||||
/>
|
||||
|
||||
<!--wizard string="Cancel payment"
|
||||
|
|
|
@ -38,13 +38,11 @@ class report_artistlot(report_int):
|
|||
def create(self,cr, uid, ids, datas, context):
|
||||
service = netsvc.LocalService("object_proxy")
|
||||
lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', ids, ['artist_id'])
|
||||
print " THE VALUE GET BY THE ARTIST TABLE",lots;
|
||||
artists = []
|
||||
for lot in lots:
|
||||
if lot['artist_id'] and lot['artist_id'] not in artists:
|
||||
artists.append(lot['artist_id'][0])
|
||||
|
||||
print "THE VALUES OF ARTIST LIST",artists;
|
||||
if not len(artists):
|
||||
raise 'UserError', 'Objects '
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ from report import report_sxw
|
|||
|
||||
class auction_objects(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
print "int the report objects"
|
||||
super(auction_objects, self).__init__(cr, uid, name, context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
|
@ -41,16 +40,11 @@ class auction_objects(report_sxw.rml_parse):
|
|||
})
|
||||
|
||||
# def lines(self, auction_id):
|
||||
# print " in the lines fuction"
|
||||
# print "value of auction_id",auction_id.id,auction_id.name........................
|
||||
#
|
||||
# cr.execute('select ad.name from auction_dates ad, a1uction_lots al where ad.id=al.%d group by ad.name',(auction_id))
|
||||
# print "value of query",cr.fetchone()
|
||||
# return self.cr.fetchone()[0]
|
||||
# def get_data(self, auction_id):
|
||||
# res = self.pool.get('auction.bid.lines').read(self.cr,self.uid,[lot_id])
|
||||
# print res;
|
||||
# print "=================================================="
|
||||
# return True
|
||||
|
||||
|
||||
|
|
|
@ -75,12 +75,10 @@ class auction_total_rml(report_sxw.rml_parse):
|
|||
def sum_taxes(self,auction_id):
|
||||
self.cr.execute("select count(1) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%d group by auction_id "%(auction_id))
|
||||
res = self.cr.fetchone()
|
||||
print "GGGGGGGGGgg",res[0]
|
||||
return res[0]
|
||||
def sold_item(self, object_id):
|
||||
self.cr.execute("select count(1) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%d and state in ('unsold') "%(object_id,))
|
||||
res = self.cr.fetchone()
|
||||
print "SOLD" ,res
|
||||
return str(res[0])
|
||||
|
||||
|
||||
|
@ -110,15 +108,11 @@ class auction_total_rml(report_sxw.rml_parse):
|
|||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
def check_paid_seller(self,auction_id):
|
||||
print "hhhhhhh"
|
||||
self.cr.execute("select sum(seller_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%d and paid_vnd != 'T' "%(auction_id))
|
||||
res = self.cr.fetchone()
|
||||
print ">>>>>>>>>>>>>>",res
|
||||
return str(res[0]) or 0.0
|
||||
|
||||
def sum_credit(self,auction_id):
|
||||
print "object",auction_id
|
||||
|
||||
self.cr.execute("select sum(buyer_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%d "%(auction_id))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
@ -143,7 +137,6 @@ class auction_total_rml(report_sxw.rml_parse):
|
|||
def sum_minadj(self, auction_id):
|
||||
self.cr.execute('select sum(lot_est1) from auction_lots where id in ('+','.join(map(str,self.total_obj))+') and auction_id=%d '%(auction_id))
|
||||
res = self.cr.fetchone()
|
||||
print "min est",res[0]
|
||||
return str(res[0]) or 0
|
||||
|
||||
def sum_maxadj(self, auction_id):
|
||||
|
|
|
@ -59,28 +59,18 @@ class buyer_form_report(report_sxw.rml_parse):
|
|||
return amount
|
||||
def buyer_info(self):
|
||||
objects = [object for object in self.localcontext.get('objects')]
|
||||
print "OBJECTS",objects
|
||||
ret_dict = {}
|
||||
ret_list = []
|
||||
for object in objects:
|
||||
print "Object :",object
|
||||
# print ret_dict
|
||||
|
||||
partner = ret_dict.get(object.ach_uid.id,False)
|
||||
print "Partner :",partner
|
||||
if not partner:
|
||||
|
||||
ret_dict[object.ach_uid.id] = {'partner' : object.ach_uid or False,'lots':[object]}
|
||||
else:
|
||||
|
||||
lots = partner.get('lots')
|
||||
print "Lots :",lots
|
||||
lots.append(object)
|
||||
# print 'ret dict :',ret_dict
|
||||
# buyer_ids=self.pool.get(auction.lots).read(cr,uid,lot)
|
||||
|
||||
|
||||
print "Return ret_dict.values() :",ret_dict.values()
|
||||
return ret_dict.values()
|
||||
|
||||
def grand_buyer_total(self,o):
|
||||
|
|
|
@ -81,7 +81,6 @@ class buyer_list(report_sxw.rml_parse):
|
|||
# self.cr.execute('select ach_uid,count(1) as no_lot, sum(obj_price) as adj_price, sum(buyer_price)-sum(obj_price) as buyer_cost ,sum(buyer_price) as to_pay from auction_lots where id in ('+','.join(map(str,self.auc_lot_ids))+') and auction_id=%d and ach_uid is not null group by ach_uid '%(auc_date_ids[0]))
|
||||
self.cr.execute('select ach_login as ach_uid,count(1) as no_lot, sum(obj_price) as adj_price, sum(buyer_price)-sum(obj_price) as buyer_cost ,sum(buyer_price) as to_pay from auction_lots where id in ('+','.join(map(str,self.auc_lot_ids))+') and auction_id=%d and ach_login is not null group by ach_login order by ach_login'%(auc_date_ids[0]))
|
||||
res = self.cr.dictfetchall()
|
||||
print "ressssssssssss",res
|
||||
for r in res:
|
||||
# if r['ach_uid']:
|
||||
# tnm=self.pool.get('res.partner').read(self.cr,self.uid,[r['ach_uid']],['name'])#
|
||||
|
|
|
@ -41,6 +41,7 @@ import netsvc
|
|||
import base64
|
||||
import wizard
|
||||
import photo_shadow
|
||||
from tools import config
|
||||
|
||||
def escape(s):
|
||||
return str(s or '').replace('<br/>','').decode('latin1','replace').encode('utf-8')
|
||||
|
@ -91,15 +92,13 @@ class auction_catalog(report_rml):
|
|||
|
||||
# promotion element
|
||||
promo = doc.createElement('promotion1')
|
||||
|
||||
#fp = file('/home/tiny/terp/4.2/server/bin/addons/auction/report/images/flagey_logo.jpg','r')
|
||||
fp = file('/home/pinky/code/terp/branches/extra_addons/trunk/auction/report/images/flagey_logo.jpg','r')
|
||||
|
||||
fp = file(config['addons_path']+'/auction/report/images/flagey_logo.jpg','r')
|
||||
file_data = fp.read()
|
||||
promo.appendChild(doc.createTextNode(base64.encodestring(file_data)))
|
||||
catalog.appendChild(promo)
|
||||
promo = doc.createElement('promotion2')
|
||||
#fp = file('/home/tiny/terp/4.2/server/bin/addons/auction/report/images/aeko_logo.jpg','r')
|
||||
fp = file('/home/pinky/code/terp/branches/extra_addons/trunk/auction/report/images/flagey_logo.jpg','r')
|
||||
fp = file(config['addons_path']+'/auction/report/images/flagey_logo.jpg','r')
|
||||
file_data = fp.read()
|
||||
promo.appendChild(doc.createTextNode(base64.encodestring(file_data)))
|
||||
catalog.appendChild(promo)
|
||||
|
@ -132,12 +131,10 @@ class auction_catalog(report_rml):
|
|||
infos.appendChild(lnum)
|
||||
|
||||
dest = os.path.join('/tmp/pdf_catalog/',str(cwid),str(cat['obj_desc'])+'.jpg')
|
||||
print dest
|
||||
if not cat['image']:
|
||||
print "Cat wiht no Image "
|
||||
print "Cat with no Image "
|
||||
|
||||
else:
|
||||
print"in else "
|
||||
import random
|
||||
limg = doc.createElement('photo_small')
|
||||
file_name = '/tmp/image_%d.jpg' % (random.randint(1,1000),)
|
||||
|
|
|
@ -39,8 +39,6 @@ class lots_list(report_sxw.rml_parse):
|
|||
})
|
||||
def bid_line(self, lot_id):
|
||||
res = self.pool.get('auction.bid.lines').read(self.cr,self.uid,[lot_id])
|
||||
print res;
|
||||
print "=================================================="
|
||||
return True
|
||||
report_sxw.report_sxw('report.lots.list', 'auction.lots', 'addons/auction/report/lots_list.rml', parser=lots_list)
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@ class lots_list_inventory(report_sxw.rml_parse):
|
|||
})
|
||||
def bid_line(self, lot_id):
|
||||
res = self.pool.get('auction.bid.lines').read(self.cr,self.uid,[lot_id])
|
||||
print res;
|
||||
print "=================================================="
|
||||
return True
|
||||
report_sxw.report_sxw('report.lots.list.inventory', 'auction.lots', 'addons/auction/report/lots_list_inventory.rml', parser=lots_list_inventory)
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@ class seller_form_report(report_sxw.rml_parse):
|
|||
|
||||
def sum_taxes(self, lot):
|
||||
taxes=[]
|
||||
print lot.auction_id and lot.auction_id.seller_costs[0].amount or False
|
||||
|
||||
amount=0.0
|
||||
if lot.bord_vnd_id.tax_id:
|
||||
taxes.append(lot.bord_vnd_id.tax_id)
|
||||
|
@ -70,31 +68,21 @@ class seller_form_report(report_sxw.rml_parse):
|
|||
return amount
|
||||
def seller_info(self):
|
||||
objects = [object for object in self.localcontext.get('objects')]
|
||||
print "OBJECTS",objects
|
||||
ret_dict = {}
|
||||
ret_list = []
|
||||
for object in objects:
|
||||
print "Object :",object
|
||||
# print ret_dict
|
||||
|
||||
partner = ret_dict.get(object.bord_vnd_id.partner_id.id,False)
|
||||
print "seller :",partner
|
||||
if not partner:
|
||||
ret_dict[object.bord_vnd_id.partner_id.id] = {'partner' : object.bord_vnd_id.partner_id or False,'lots':[object]}
|
||||
else:
|
||||
lots = partner.get('lots')
|
||||
print "Lots :",lots
|
||||
lots.append(object)
|
||||
# print 'ret dict :',ret_dict
|
||||
# buyer_ids=self.pool.get(auction.lots).read(cr,uid,lot)
|
||||
print "Return ret_dict.values() :",ret_dict.values()
|
||||
return ret_dict.values()
|
||||
def grand_seller_total(self,o):
|
||||
grand_total = 0
|
||||
for oo in o:
|
||||
print "the value of grand totoal",grand_total
|
||||
print "the value of self.sum_taxes(oo)",self.sum_taxes(oo)
|
||||
print "the value of oo['obj_price']",oo['obj_price']
|
||||
grand_total =grand_total + oo['obj_price']+ self.sum_taxes(oo)
|
||||
return grand_total
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ def _wo_check(self, cr, uid, data, context):
|
|||
v_lots=pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)])
|
||||
v_ids=pool.get('auction.lots').browse(cr,uid,v_lots)
|
||||
for ab in v_ids:
|
||||
print ab.auction_id.id
|
||||
if not ab.auction_id :
|
||||
raise wizard.except_wizard('Error!','No Lots belong to this Auction Date')
|
||||
return 'report'
|
||||
|
|
|
@ -105,11 +105,9 @@ def _catalog_send(uname, passwd, lang, did, catalog):
|
|||
conn = httplib.HTTPConnection(host)
|
||||
conn.request("POST", '/bin/catalog.cgi', body, headers = headers)
|
||||
response = conn.getresponse()
|
||||
print response.read()
|
||||
val = response.status
|
||||
conn.close()
|
||||
return val
|
||||
print 'catalog_send !!'
|
||||
return post_multipart('auction-in-europe.com', "/bin/catalog.cgi", (('uname',uname),('password',passwd),('did',did),('lang',lang)),(('file',catalog),))
|
||||
|
||||
def _photo_bin_send(uname, passwd, ref, did, photo_name, photo_data):
|
||||
|
@ -150,8 +148,6 @@ def _photo_bin_send(uname, passwd, ref, did, photo_name, photo_data):
|
|||
|
||||
|
||||
def _photos_send(cr,uid, uname, passwd, did, ids):
|
||||
print '_photos_send'
|
||||
print "********************START****************"
|
||||
for (ref,id) in ids:
|
||||
service = netsvc.LocalService("object_proxy")
|
||||
# ids_attach = service.execute(db_name,uid, 'ir.attachment', 'search', [('res_model','=','auction.lots'), ('res_id', '=',id)])
|
||||
|
@ -160,17 +156,13 @@ def _photos_send(cr,uid, uname, passwd, did, ids):
|
|||
bin = base64.decodestring(datas[0]['image'])
|
||||
fname = datas[0]['name']
|
||||
_photo_bin_send(uname, passwd, ref, did, fname, bin)
|
||||
print 'SENDING PHOTO...............', ref
|
||||
print "***************COMPLETE**********"
|
||||
|
||||
def _get_dates(self,cr,uid, datas,context={}):
|
||||
global send_fields
|
||||
import httplib
|
||||
conn = httplib.HTTPConnection('www.auction-in-europe.com')
|
||||
conn.request("GET", "/aie_upload/dates_get.php?uname=%s&passwd=%s" % (datas['form']['uname'], datas['form']['password']))
|
||||
print "FET DATS"
|
||||
response = conn.getresponse()
|
||||
print response.status
|
||||
if response.status == 200:
|
||||
def _date_decode(x):
|
||||
return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1','replace').encode('utf-8','replace')))
|
||||
|
@ -184,13 +176,11 @@ def _send(self,db_name,uid, datas,context={}):
|
|||
#cr = pooler.get_db(cr.dbname).cursor()
|
||||
|
||||
# cr=sql_db.db.cursor()
|
||||
print "...................send function Opened..................."
|
||||
cr = pooler.get_db(db_name).cursor()
|
||||
|
||||
cr.execute('select name,aie_categ from auction_lot_category')
|
||||
vals = dict(cr.fetchall())
|
||||
cr.close()
|
||||
print vals
|
||||
|
||||
service = netsvc.LocalService("object_proxy")
|
||||
lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', datas['ids'], ['obj_num','lot_num','obj_desc','bord_vnd_id','lot_est1','lot_est2','artist_id','lot_type','aie_categ'])
|
||||
|
@ -217,11 +207,9 @@ def _send(self,db_name,uid, datas,context={}):
|
|||
l['aie_categ'] = vals.get(l['lot_type'], False)
|
||||
ids.append((l['ref'], l['id']))
|
||||
args = pickle.dumps(lots)
|
||||
print thread.start_new_thread(_catalog_send, (datas['form']['uname'],datas['form']['password'],datas['form']['lang'],datas['form']['dates'], args))
|
||||
thread.start_new_thread(_catalog_send, (datas['form']['uname'],datas['form']['password'],datas['form']['lang'],datas['form']['dates'], args))
|
||||
if(datas['form']['img_send']==True):
|
||||
print "SSSSSSSSSSSSSSSSSsss"
|
||||
print thread.start_new_thread(_photos_send, (cr.dbname,uid, datas['form']['uname'],datas['form']['password'],datas['form']['dates'], ids))
|
||||
print "...................send function closed..................."
|
||||
thread.start_new_thread(_photos_send, (cr.dbname,uid, datas['form']['uname'],datas['form']['password'],datas['form']['dates'], ids))
|
||||
return {}
|
||||
|
||||
def _send_pdf(self, cr, uid, data, context):
|
||||
|
|
|
@ -46,7 +46,6 @@ def _values(self,cr,uid, datas,context={}):
|
|||
|
||||
|
||||
def _makeInvoices(self, cr, uid, data, context):
|
||||
print "make invoice",data,context
|
||||
order_obj = pooler.get_pool(cr.dbname).get('auction.lots')
|
||||
newinv = []
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
@ -57,7 +56,6 @@ def _makeInvoices(self, cr, uid, data, context):
|
|||
ids = order_obj.lots_invoice(cr, uid, data['ids'],context,data['form']['number'])
|
||||
# ids = order_obj.lots_invoice(cr, uid, data['ids'],context,invoice_number)
|
||||
cr.commit()
|
||||
print "avant return"
|
||||
return {
|
||||
'domain': "[('id','in', ["+','.join(map(str,ids))+"])]",
|
||||
'name': 'Buyer invoices',
|
||||
|
|
|
@ -38,7 +38,7 @@ from tools.misc import UpdateableStr
|
|||
|
||||
_lot_arch = """<?xml version="1.0"?>
|
||||
<form string="Mark Lots" height="500" width="1000">
|
||||
<label string="Selectionner les lots qui sont livres" colspan="4"/>
|
||||
<label string="Select lots which are Sold" colspan="4"/>
|
||||
<field name="lot_ids" nolabel="1" colspan="4" domain="[('state','=','sold')]"/>
|
||||
</form>
|
||||
"""
|
||||
|
@ -69,7 +69,7 @@ class wizard_reprint(wizard.interface):
|
|||
'arch': _lot_arch,
|
||||
'fields': _lot_fields,
|
||||
'state': [
|
||||
('valid',' Valider ')
|
||||
('valid',' OK ')
|
||||
],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ fields_ask = {
|
|||
#
|
||||
##TODO: pr bien faire, faudrait leur poser la question: continue anyway?
|
||||
# if len(ids)<len(datas['ids']):
|
||||
## print ids, datas['ids']
|
||||
# raise wizard.except_wizard('UserError', ('Some object(s) are not paid !', 'init'))
|
||||
#
|
||||
# return {'objects':len(ids), 'amount_total':price, 'amount_paid':price_paid}
|
||||
|
|
|
@ -72,15 +72,18 @@ def _pay_and_reconcile(self, cr, uid, data, context):
|
|||
if not abs(data['form']['total'] - (data['form']['amount']+data['form']['amount2']+data['form']['amount3']))<0.01:
|
||||
rest=data['form']['total']-(data['form']['amount']+data['form']['amount2']+data['form']['amount3'])
|
||||
raise wizard.except_wizard('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest,2)))
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
lots = pool.get('auction.lots').browse(cr,uid,data['ids'],context)
|
||||
ref_bk_s=pooler.get_pool(cr.dbname).get('account.bank.statement.line')
|
||||
|
||||
for lot in lots:
|
||||
if data['form']['buyer_id']:
|
||||
pool.get('auction.lots').write(cr,uid,[lot.id],{'ach_uid':data['form']['buyer_id']})
|
||||
if not lot.auction_id:
|
||||
raise wizard.except_wizard('Error !', 'No auction date for "%s": Please set one.'%(lot.name))
|
||||
pool.get('auction.lots').write(cr,uid,[lot.id],{'is_ok':True})
|
||||
|
||||
for st,stamount in [('statement_id1','amount'),('statement_id2','amount2'),('statement_id3','amount3')]:
|
||||
if data['form'][st]:
|
||||
new_id=ref_bk_s.create(cr,uid,{
|
||||
|
|
|
@ -67,9 +67,7 @@ def _transfer_unsold_object(self, cr, uid, data, context):
|
|||
obj_pool = pooler.get_pool(cr.dbname).get('auction.lots')
|
||||
ids= obj_pool.search(cr,uid,[('auction_id','=',data['form']['auction_id_from']),('state','=','unsold')])
|
||||
for rec in obj_pool.browse(cr, uid, ids, context):
|
||||
# print "rec.auction_id",rec.auction_id
|
||||
new_id=pooler.get_pool(cr.dbname).get('auction.lot.history').create(cr,uid,{'auction_id':rec.auction_id.id,'lot_id':rec.id,'price': rec.obj_ret, 'name': 'reasons'+rec.auction_id.auction1})
|
||||
# print new_id
|
||||
up_auction=pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,[rec.id],{'auction_id':data['form']['auction_id_to'],
|
||||
'obj_ret':None,
|
||||
'obj_price':None,
|
||||
|
|
|
@ -111,6 +111,7 @@ class res_partner_job(osv.osv):
|
|||
'contact_id':fields.many2one('res.partner.contact','Contact', required=True),
|
||||
'function_id': fields.many2one('res.partner.function','Function', required=True),
|
||||
'sequence_contact':fields.integer('Sequence (Contact)',help='order of importance of this address in the list of addresses of the linked contact'),
|
||||
'sequence_partner':fields.integer('Sequence (Partner)',help='order of importance of this function in the list of functions of the linked partner'),
|
||||
'email': fields.char('E-Mail', size=240),
|
||||
'phone': fields.char('Phone', size=64),
|
||||
}
|
||||
|
|
|
@ -112,12 +112,14 @@
|
|||
<newline/>
|
||||
<field name="job_ids" mode="tree, form" colspan="4">
|
||||
<tree string="Contacts" editable="top">
|
||||
<field name="sequence_partner"/>
|
||||
<field name="contact_id"/>
|
||||
<field name="function_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
</tree>
|
||||
<form string="Contacts">
|
||||
<field name="sequence_partner"/>
|
||||
<field name="contact_id"/>
|
||||
<field name="function_id"/>
|
||||
<field name="phone"/>
|
||||
|
@ -277,6 +279,7 @@
|
|||
<field name="email" select="2"/>
|
||||
<field name="phone" select="2"/>
|
||||
<field name="sequence_contact" select="2"/>
|
||||
<field name="sequence_partner" select="2"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
|
|
@ -11,29 +11,29 @@
|
|||
identification, prioritization, assignment, resolution and notification.""",
|
||||
"depends" : ["crm","report_crm"],
|
||||
"init_xml" : [
|
||||
"crm_bugs_view.xml",
|
||||
"crm_jobs_view.xml",
|
||||
"crm_lead_view.xml",
|
||||
"crm_meeting_view.xml",
|
||||
"crm_opportunity_view.xml",
|
||||
"crm_fund_view.xml"
|
||||
],
|
||||
"crm_config_view.xml",
|
||||
"crm_bugs_view.xml",
|
||||
"crm_jobs_view.xml",
|
||||
"crm_lead_view.xml",
|
||||
"crm_meeting_view.xml",
|
||||
"crm_opportunity_view.xml",
|
||||
"crm_fund_view.xml"
|
||||
],
|
||||
"demo_xml" : [
|
||||
"crm_bugs_data.xml",
|
||||
"crm_jobs_data.xml",
|
||||
"crm_meeting_data.xml",
|
||||
"crm_lead_data.xml",
|
||||
"crm_opportunity_data.xml"
|
||||
],
|
||||
# "crm_bugs_data.xml",
|
||||
# "crm_jobs_data.xml",
|
||||
# "crm_meeting_data.xml",
|
||||
# "crm_lead_data.xml",
|
||||
# "crm_opportunity_data.xml"
|
||||
],
|
||||
"update_xml" : [
|
||||
"security/ir.model.access.csv",
|
||||
"crm_bugs_demo.xml",
|
||||
"crm_jobs_demo.xml",
|
||||
"crm_lead_demo.xml",
|
||||
"crm_meeting_demo.xml",
|
||||
"crm_opportunity_demo.xml",
|
||||
"crm_report_view.xml"
|
||||
],
|
||||
# "crm_bugs_demo.xml",
|
||||
# "crm_jobs_demo.xml",
|
||||
# "crm_lead_demo.xml",
|
||||
# "crm_meeting_demo.xml",
|
||||
# "crm_opportunity_demo.xml",
|
||||
# "crm_report_view.xml"
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import time
|
||||
import tools
|
||||
from osv import fields,osv,orm
|
||||
|
||||
import os
|
||||
import mx.DateTime
|
||||
import base64
|
||||
|
||||
|
@ -49,6 +49,48 @@ class crm_cases(osv.osv):
|
|||
|
||||
crm_cases()
|
||||
|
||||
class crm_menu_config_wizard(osv.osv_memory):
|
||||
|
||||
_name='crm.menu.config_wizard'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=64),
|
||||
'meeting' : fields.boolean('Calendar of Meetings'),
|
||||
'lead' : fields.boolean('Leads'),
|
||||
'opportunity' : fields.boolean('Business Opportunities'),
|
||||
'jobs' : fields.boolean('Jobs Hiring Process'),
|
||||
'bugs' : fields.boolean('Bug Tracking'),
|
||||
'fund' : fields.boolean('Fund Raising Operations'),
|
||||
}
|
||||
|
||||
def action_create(self, cr, uid, ids, *args):
|
||||
for res in self.read(cr,uid,ids):
|
||||
res.__delitem__('id')
|
||||
# 'update'
|
||||
for section in res :
|
||||
if res[section]:
|
||||
file_name = 'crm_'+section+'_demo.xml'
|
||||
try:
|
||||
tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_configuration',file_name )), {}, 'init', *args)
|
||||
except Exception, e:
|
||||
raise osv.except_osv('Error !', e)
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
crm_menu_config_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- configartion view -->
|
||||
|
||||
<record id="view_config_crm_menu" model="ir.ui.view">
|
||||
<field name="name">Configure Menu for Sections</field>
|
||||
<field name="model">crm.menu.config_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure CRM Sections">
|
||||
<separator col="4" colspan="4" string="Configure CRM Menu for Selected Sections"/>
|
||||
<newline/>
|
||||
<field name="meeting"/>
|
||||
<field name="lead"/>
|
||||
<field name="opportunity"/>
|
||||
<field name="jobs"/>
|
||||
<field name="bugs"/>
|
||||
<field name="fund"/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-forward" name="action_create" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_config_crm_menu" model="ir.actions.act_window">
|
||||
<field name="name">Configure Menu for CRM case Section</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">crm.menu.config_wizard</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
<record id="config_wizard_step_case_section_menu" model="ir.module.module.configuration.step">
|
||||
<field name="name">Create Menu for CRM Case Section</field>
|
||||
<field name="note">This Configuration step use to create Menu for Case Sections</field>
|
||||
<field name="action_id" ref="action_view_config_crm_menu"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -232,12 +232,12 @@
|
|||
<field name="view_id" ref="crm_case_form_view11"/>
|
||||
<field name="act_window_id" ref="crm_case_categ0_act_myjobs"/>
|
||||
</record>
|
||||
<menuitem parent="menu_crm_case_categ0_act11" id="menu_crm_case_categ0_act_myjobs_myjobs" action="crm_case_categ0_act_myjobs"/>
|
||||
<menuitem parent="menu_crm_case_categ0_act11" id="menu_crm_case_categ0_act_myjobs_myjobs" action="crm_case_categ0_act_myjobs"/>
|
||||
|
||||
<!--
|
||||
ALL JOBS REQUESTS
|
||||
-->
|
||||
<record model="ir.actions.act_window" id="crm_case_categ0_act111">
|
||||
<record model="ir.actions.act_window" id="crm_case_categ0_act111">
|
||||
<field name="name">All Jobs Requests</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">tree,calendar,form</field>
|
||||
|
@ -399,6 +399,6 @@
|
|||
<field name="view_id" ref="crm_case_form_view11"/>
|
||||
<field name="act_window_id" ref="crm_case_categ0_act_alljobs"/>
|
||||
</record>
|
||||
<menuitem parent="menu_crm_case_categ0_act111" id="menu_crm_case_categ0_act_myjobs_alljobs" action="crm_case_categ0_act_alljobs"/>
|
||||
<menuitem parent="menu_crm_case_categ0_act111" id="menu_crm_case_categ0_act_myjobs_alljobs" action="crm_case_categ0_act_alljobs"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -86,24 +86,24 @@
|
|||
-->
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meetmy">
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="domain" eval="'[(\'user_id\',\'=\',uid)]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet_my">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meetmy"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_meet_my">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meetmy"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_meet_my">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meetmy"/>
|
||||
|
@ -114,24 +114,24 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_meetmy1">
|
||||
<field name="name">Draft Meetings</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="domain" eval="'[(\'user_id\',\'=\',uid),(\'state\',\'=\',\'draft\')]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet_my1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy1"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetmy1">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy1"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetmy1">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy1"/>
|
||||
|
@ -142,24 +142,24 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_meetmy2">
|
||||
<field name="name">Confirmed Meetings</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="domain" eval="'[(\'user_id\',\'=\',uid),(\'state\',\'=\',\'done\')]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_meetmy2">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy2"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetmy2">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy2"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetmy2">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetmy2"/>
|
||||
|
@ -172,23 +172,23 @@
|
|||
-->
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet">
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meet"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_meet">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meet"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form__meet">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_meet"/>
|
||||
|
@ -198,24 +198,24 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_meetall1">
|
||||
<field name="name">Draft Meetings</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="domain" eval="'[(\'state\',\'=\',\'draft\')]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_meetall1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall1"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetall1">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall1"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetall1">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall1"/>
|
||||
|
@ -225,24 +225,24 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_meetall2">
|
||||
<field name="name">Confirmed Meetings</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="domain" eval="'[(\'state\',\'=\',\'done\')]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_meetall2">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall2"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetall2">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall2"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetall2">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall2"/>
|
||||
|
@ -253,24 +253,24 @@
|
|||
<field name="name">Next Deadlines</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="domain" eval="[('state','!=','done'),('date','>=',time.strftime('%Y-%m-%d'))]"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_meetall3">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall3"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetall3">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall3"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetall3">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_meet"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_meetall3"/>
|
||||
|
|
|
@ -87,24 +87,24 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_oppor11">
|
||||
<field name="name">All Opportunities</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_oppor"/>
|
||||
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support3)+')]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_oppor11">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_oppor"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_oppor11"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_oppor11">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_oppor"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_oppor11"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_oppor11">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_form_view_oppor"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_oppor11"/>
|
||||
|
@ -193,18 +193,18 @@
|
|||
<record model="ir.actions.act_window" id="crm_case_category_act_oppor22">
|
||||
<field name="name">My Opportunities</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="view_mode">tree,calendar,form</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_oppor"/>
|
||||
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support3)+'),(\'user_id\',\'=\',uid)]'"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_oppor22">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">calendar</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_oppor"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_oppor22"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_oppor22">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_oppor"/>
|
||||
<field name="act_window_id" ref="crm_case_category_act_oppor22"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
Events \ Reporting
|
||||
""",
|
||||
"depends" : [
|
||||
"project","crm","base_contact",
|
||||
"project","crm","base_contact","account_budget",
|
||||
],
|
||||
"demo_xml" : ["event_demo.xml"],
|
||||
"init_xml" : ["event_data.xml"],
|
||||
|
|
|
@ -54,9 +54,12 @@ class hr_holidays_status(osv.osv):
|
|||
'name' : fields.char('Holiday Status', size=64, required=True, translate=True),
|
||||
'section_id': fields.many2one('crm.case.section', 'Section'),
|
||||
'color_name' : fields.selection([('red', 'Red'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color of the status', required=True),
|
||||
'limit' : fields.boolean('Allow to override Limit'),
|
||||
'active' : fields.boolean('Active')
|
||||
}
|
||||
_defaults = {
|
||||
'color_name': lambda *args: 'red',
|
||||
'active' : lambda *a: True,
|
||||
}
|
||||
hr_holidays_status()
|
||||
|
||||
|
@ -64,6 +67,20 @@ class hr_holidays(osv.osv):
|
|||
_name = "hr.holidays"
|
||||
# _inherit = 'hr.holidays'
|
||||
_description = "Holidays"
|
||||
|
||||
def _get_days(self,cr, uid,ids, name, *args):
|
||||
res = {}
|
||||
for val in self.browse(cr, uid, ids):
|
||||
date_from = val.date_from
|
||||
date_to = val.date_to
|
||||
if date_from:
|
||||
if date_to:
|
||||
from_dt = time.mktime(time.strptime(date_from,'%Y-%m-%d %H:%M:%S'))
|
||||
to_dt = time.mktime(time.strptime(date_to,'%Y-%m-%d %H:%M:%S'))
|
||||
diff_day = (to_dt-from_dt)/(3600*24)
|
||||
res[val.id] = round(diff_day)+1
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Description', required=True, readonly=True, size=64, states={'draft':[('readonly',False)]}),
|
||||
'state': fields.selection([('draft', 'draft'), ('confirm', 'Confirmed'), ('refuse', 'Refused'), ('validate', 'Validate'), ('cancel', 'Cancel')], 'Status', readonly=True),
|
||||
|
@ -74,7 +91,7 @@ class hr_holidays(osv.osv):
|
|||
'user_id':fields.many2one('res.users', 'Employee_id', states={'draft':[('readonly',False)]}, select=True, readonly=True),
|
||||
'manager_id' : fields.many2one('hr.employee', 'Holiday manager', invisible=False, readonly=True),
|
||||
'notes' : fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days': fields.float('Number of Days in this Holiday Request',required=True, states={'draft':[('readonly',False)]}, readonly=True),
|
||||
'number_of_days': fields.function(_get_days, method=True,store=True, type='float', string='Number of Days in this Holiday Request'),
|
||||
'case_id':fields.many2one('crm.case', 'Case'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -152,8 +169,9 @@ class hr_holidays(osv.osv):
|
|||
if holiday_id:
|
||||
obj_holidays_per_user=self.pool.get('hr.holidays.per.user').browse(cr, uid,holiday_id[0])
|
||||
leaves_rest=obj_holidays_per_user.max_leaves - obj_holidays_per_user.leaves_taken
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv('Attention!','You Cannot Validate leaves while available leaves are less than asked leaves.')
|
||||
if not obj_holidays_per_user.holiday_status.limit:
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv('Attention!','You Cannot Validate leaves while available leaves are less than asked leaves.')
|
||||
self.pool.get('hr.holidays.per.user').write(cr,uid,obj_holidays_per_user.id,{'leaves_taken':obj_holidays_per_user.leaves_taken + leave_asked})
|
||||
if record.holiday_status.section_id:
|
||||
vals={}
|
||||
|
@ -195,9 +213,12 @@ class hr_holidays_per_user(osv.osv):
|
|||
'holiday_status' : fields.many2one("hr.holidays.status", "Holiday's Status", required=True),
|
||||
'max_leaves' : fields.float('Maximum Leaves Allowed',required=True),
|
||||
'leaves_taken' : fields.float('Leaves Already Taken',readonly=True),
|
||||
'active' : fields.boolean('Active'),
|
||||
'notes' : fields.text('Notes'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active' : lambda *a: True,
|
||||
}
|
||||
def create(self, cr, uid, vals, *args, **kwargs):
|
||||
|
||||
if vals['employee_id']:
|
||||
|
|
|
@ -1,95 +1,99 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<!-- Holidays -->
|
||||
<record model="ir.ui.view" id="edit_holiday_inherit_new">
|
||||
<field name="name">hr.holidays.form.inherit</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Holidays -->
|
||||
<record model="ir.ui.view" id="edit_holiday_inherit_new">
|
||||
<field name="name">hr.holidays.form.inherit</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Employee holidays">
|
||||
<field colspan="4" name="name" select="1"/>
|
||||
<field name="date_from" select="1"/>
|
||||
<field name="date_to" select="1"/>
|
||||
<newline/>
|
||||
<field name="holiday_status" select="1"/>
|
||||
<group col="12" colspan="2">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Validate" name="validate" states="confirm" type="workflow"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow"/>
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object"/>
|
||||
</group>
|
||||
<field name="state" select="1" colspan="2"/>
|
||||
<newline />
|
||||
<field name="notes" col="12" colspan="4"/>
|
||||
<newline />
|
||||
<field name="manager_id" colspan="2"/>
|
||||
<field name="employee_id" select="1" />
|
||||
<newline />
|
||||
<field name="number_of_days" colspan="2"/>
|
||||
<group col="12" colspan="2">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Validate" name="validate" states="confirm" type="workflow"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow"/>
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object"/>
|
||||
</group>
|
||||
<field name="state" select="1" colspan="2"/>
|
||||
<newline />
|
||||
<field name="notes" col="12" colspan="4"/>
|
||||
<newline />
|
||||
<field name="manager_id" colspan="2"/>
|
||||
<field name="employee_id" select="1" />
|
||||
<newline />
|
||||
<field name="number_of_days" colspan="2"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday">
|
||||
<field name="name">hr.holidays.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<record model="ir.ui.view" id="view_holiday">
|
||||
<field name="name">hr.holidays.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Employee holidays">
|
||||
<field name="name"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="holiday_status"/>
|
||||
<field name="state"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_2">
|
||||
<field name="name">hr.holidays.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="inherit_id" ref="view_holiday"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="number_of_days" string="Number of Days"/>
|
||||
<field name="employee_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holiday_2">
|
||||
<field name="name">hr.holidays.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="inherit_id" ref="view_holiday"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="number_of_days" string="Number of Days"/>
|
||||
<field name="employee_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- holidays status -->
|
||||
<record model="ir.ui.view" id="edit_holiday_status_form">
|
||||
<field name="name">hr.holidays.status.form</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<!-- holidays status -->
|
||||
<record model="ir.ui.view" id="edit_holiday_status_form">
|
||||
<field name="name">hr.holidays.status.form</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Define holiday status">
|
||||
<field colspan="4" name="name" select="1"/>
|
||||
<field name="color_name" select="2"/>
|
||||
<field name="section_id" select="1" />
|
||||
<field name="color_name" select="2"/>
|
||||
<field name="section_id" select="1" />
|
||||
<field name="limit" select="2"/>
|
||||
<field name="active" select="2"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holiday_status_tree">
|
||||
<field name="name">hr.holidays.status.tree</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holiday_status_tree">
|
||||
<field name="name">hr.holidays.status.tree</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Holiday status">
|
||||
<field name="name"/>
|
||||
<field name="color_name" />
|
||||
<field name="section_id" />
|
||||
<field name="color_name" />
|
||||
<field name="section_id" />
|
||||
<field name="limit" select="2"/>
|
||||
<field name="active" select="2"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_view_holiday_status" model="ir.actions.act_window">
|
||||
<field name="name">Holiday Status</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -99,153 +103,155 @@
|
|||
</record>
|
||||
<menuitem action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration"/>
|
||||
|
||||
<!-- holidays per user -->
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_form">
|
||||
<field name="name">hr.holidays.per.user.form</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Holidays Per Employee">
|
||||
<field name="employee_id" select="1" />
|
||||
<field name="holiday_status" select="1" />
|
||||
<newline/>
|
||||
<field name="max_leaves" select="2" colspan="2" />
|
||||
<newline/>
|
||||
<field name="leaves_taken" select="2" colspan="2" />
|
||||
<newline/>
|
||||
<field name="notes" colspan="4" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_tree">
|
||||
<field name="name">hr.holidays.per.user.tree</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Holidays Per Employee">
|
||||
<field name="employee_id"/>
|
||||
<field name="holiday_status"/>
|
||||
<field name="max_leaves"/>
|
||||
<field name="leaves_taken"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- holidays per user -->
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_form">
|
||||
<field name="name">hr.holidays.per.user.form</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Holidays Per Employee">
|
||||
<field name="employee_id" select="1" />
|
||||
<field name="holiday_status" select="1" />
|
||||
<newline/>
|
||||
<field name="max_leaves" select="2" colspan="2" />
|
||||
<newline/>
|
||||
<field name="leaves_taken" select="2" colspan="2" />
|
||||
<field name="active" select="2"/>
|
||||
<newline/>
|
||||
<field name="notes" colspan="4" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_tree">
|
||||
<field name="name">hr.holidays.per.user.tree</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Holidays Per Employee">
|
||||
<field name="employee_id"/>
|
||||
<field name="holiday_status"/>
|
||||
<field name="max_leaves"/>
|
||||
<field name="leaves_taken"/>
|
||||
<field name="active" select="2"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_graph">
|
||||
<field name="name">hr.holidays.per.user.graph</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph type="bar" string="Holidays Allowed">
|
||||
<field name="employee_id"/>
|
||||
<field name="max_leaves" operator="+"/>
|
||||
<field name="leaves_taken" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_holidays_per_user_graph">
|
||||
<field name="name">hr.holidays.per.user.graph</field>
|
||||
<field name="model">hr.holidays.per.user</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph type="bar" string="Holidays Allowed">
|
||||
<field name="employee_id"/>
|
||||
<field name="max_leaves" operator="+"/>
|
||||
<field name="leaves_taken" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu Items -->
|
||||
<record model="ir.actions.act_window" id="open_ask_holidays">
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="edit_holiday_inherit_new" />
|
||||
</record>
|
||||
<menuitem name="Holidays Request" parent="hr.menu_hr_root" id="menu_open_ask_holidays" action="open_ask_holidays"/>
|
||||
<!-- Menu Items -->
|
||||
<record model="ir.actions.act_window" id="open_ask_holidays">
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="edit_holiday_inherit_new" />
|
||||
</record>
|
||||
<menuitem name="Holidays Request" parent="hr.menu_hr_root" id="menu_open_ask_holidays" action="open_ask_holidays"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_holiday">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="All Holidays Requests" parent="menu_open_ask_holidays" id="menu_action_all_holiday" action="action_all_holiday" />
|
||||
<record model="ir.actions.act_window" id="action_all_holiday">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="All Holidays Requests" parent="menu_open_ask_holidays" id="menu_action_all_holiday" action="action_all_holiday" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday">
|
||||
<field name="name">My Holidays Request</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="My Holidays Requests" parent="menu_open_ask_holidays" id="menu_action_my_holiday" action="action_my_holiday" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday">
|
||||
<field name="name">My Holidays Request</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="My Holidays Requests" parent="menu_open_ask_holidays" id="menu_action_my_holiday" action="action_my_holiday" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_draft">
|
||||
<field name="name">My Holidays Request Draft</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','draft')]</field>
|
||||
</record>
|
||||
<menuitem name="My Draft Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_draft" action="action_my_holiday_draft" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_draft">
|
||||
<field name="name">My Holidays Request Draft</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','draft')]</field>
|
||||
</record>
|
||||
<menuitem name="My Draft Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_draft" action="action_my_holiday_draft" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_waiting">
|
||||
<field name="name">My Holidays Request Waiting confirmation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','confirm')]</field>
|
||||
</record>
|
||||
<menuitem name="My Awaiting Confirmation Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_waiting" action="action_my_holiday_waiting" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_waiting">
|
||||
<field name="name">My Holidays Request Waiting confirmation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','confirm')]</field>
|
||||
</record>
|
||||
<menuitem name="My Awaiting Confirmation Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_waiting" action="action_my_holiday_waiting" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_validate">
|
||||
<field name="name">My Holidays Request Validated</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','validate')]</field>
|
||||
</record>
|
||||
<menuitem name="My Validated Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_validate" action="action_my_holiday_validate" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_validate">
|
||||
<field name="name">My Holidays Request Validated</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','validate')]</field>
|
||||
</record>
|
||||
<menuitem name="My Validated Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_validate" action="action_my_holiday_validate" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_refuse">
|
||||
<field name="name">My Holidays Request Refused</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','refuse')]</field>
|
||||
</record>
|
||||
<menuitem name="My Refused Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_refuse" action="action_my_holiday_refuse" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_refuse">
|
||||
<field name="name">My Holidays Request Refused</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid), ('state','=','refuse')]</field>
|
||||
</record>
|
||||
<menuitem name="My Refused Holidays Requests" parent="menu_action_my_holiday" id="menu_action_my_holiday_refuse" action="action_my_holiday_refuse" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_holiday_waiting">
|
||||
<field name="name">Requests Awaiting for Validation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','confirm')]</field>
|
||||
</record>
|
||||
<menuitem name="Holidays Requests Awaiting for Validation" parent="menu_action_all_holiday" id="menu_action_holiday_waiting" action="action_holiday_waiting" />
|
||||
<record model="ir.actions.act_window" id="action_holiday_waiting">
|
||||
<field name="name">Requests Awaiting for Validation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','confirm')]</field>
|
||||
</record>
|
||||
<menuitem name="Holidays Requests Awaiting for Validation" parent="menu_action_all_holiday" id="menu_action_holiday_waiting" action="action_holiday_waiting" />
|
||||
|
||||
<record model="ir.actions.act_window" id="action_holidays_per_user">
|
||||
<field name="name">Holidays Per Employee</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.per.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
</record>
|
||||
<menuitem name="Holidays Per Employee" parent="hr.menu_hr_configuration" id="menu_open_holidays_per_user" action="action_holidays_per_user"/>
|
||||
<record model="ir.actions.act_window" id="action_holidays_per_user">
|
||||
<field name="name">Holidays Per Employee</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.per.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
</record>
|
||||
<menuitem name="Holidays Per Employee" parent="hr.menu_hr_configuration" id="menu_open_holidays_per_user" action="action_holidays_per_user"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_available">
|
||||
<field name="name">My Available Holidays</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.per.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="My Available Holidays" parent="hr.menu_hr_reporting" id="menu_action_my_holiday_available" action="action_my_holiday_available" />
|
||||
<record model="ir.actions.act_window" id="action_my_holiday_available">
|
||||
<field name="name">My Available Holidays</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.per.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
<menuitem name="My Available Holidays" parent="hr.menu_hr_reporting" id="menu_action_my_holiday_available" action="action_my_holiday_available" />
|
||||
|
||||
|
||||
<!-- Shortcuts -->
|
||||
<act_window name="My Holiday Requests"
|
||||
domain="[('employee_id', '=', active_id)]"
|
||||
res_model="hr.holidays"
|
||||
src_model="hr.employee"
|
||||
id="act_hr_employee_holiday_request"/>
|
||||
<!-- Shortcuts -->
|
||||
<act_window name="My Holiday Requests"
|
||||
domain="[('employee_id', '=', active_id)]"
|
||||
res_model="hr.holidays"
|
||||
src_model="hr.employee"
|
||||
id="act_hr_employee_holiday_request"/>
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1106,9 +1106,8 @@ class StockPicking(osv.osv):
|
|||
# Explode picking by replacing phantom BoMs
|
||||
#
|
||||
def action_explode(self, cr, uid, picks, *args):
|
||||
for pick in picks:
|
||||
for move in pick.move_lines:
|
||||
self.pool.get('stock.move')._action_explode(cr, uid, move)
|
||||
for move in picks:
|
||||
self.pool.get('stock.move')._action_explode(cr, uid, move)
|
||||
return picks
|
||||
|
||||
StockPicking()
|
||||
|
|
|
@ -10,7 +10,7 @@ This module allows you to manage your process for the end-users.
|
|||
""",
|
||||
"depends" : ["base", "sale"],
|
||||
"init_xml" : [],
|
||||
"demo_xml" : ['process_data.xml'],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
"security/ir.model.access.csv",
|
||||
'process_view.xml',
|
||||
|
|
Binary file not shown.
|
@ -45,11 +45,11 @@ class process_process(osv.osv):
|
|||
}
|
||||
|
||||
def graph_get(self, cr, uid, id, res_model, res_id, scale, context):
|
||||
|
||||
current_object = res_model
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
||||
process = pool.get('process.process').browse(cr, uid, [id])[0]
|
||||
current_object = pool.get(res_model).browse(cr, uid, [res_id])[0]
|
||||
|
||||
nodes = {}
|
||||
start = []
|
||||
|
@ -59,20 +59,35 @@ class process_process(osv.osv):
|
|||
data = {}
|
||||
|
||||
data['name'] = node.name
|
||||
data['menu'] = node.menu_id.name
|
||||
data['model'] = node.model_id.model
|
||||
data['menu'] = (node.menu_id or None) and node.menu_id.name
|
||||
data['model'] = (node.model_id or None) and node.model_id.model
|
||||
data['kind'] = node.kind
|
||||
data['active'] = 0
|
||||
|
||||
if node.kind == "state" and node.model_id and node.model_id.model == res_model:
|
||||
states = node.model_states
|
||||
states = (states or []) and states.split(',')
|
||||
data['active'] = (states and current_object.state in states) or not states
|
||||
|
||||
elif node.kind == "router":
|
||||
#TODO:
|
||||
pass
|
||||
|
||||
elif node.kind == "subflow":
|
||||
#TODO: subflow
|
||||
pass
|
||||
|
||||
nodes[node.id] = data
|
||||
|
||||
if node.flow_start:
|
||||
start.append(node.id)
|
||||
|
||||
for tr in node.transition_out:
|
||||
for tr in node.transition_ids:
|
||||
data = {}
|
||||
|
||||
data['name'] = tr.name
|
||||
data['source'] = tr.node_from_id.id
|
||||
data['target'] = tr.node_to_id.id
|
||||
data['source'] = tr.source_node_id.id
|
||||
data['target'] = tr.target_node_id.id
|
||||
|
||||
data['buttons'] = buttons = []
|
||||
for b in tr.action_ids:
|
||||
|
@ -81,11 +96,11 @@ class process_process(osv.osv):
|
|||
buttons.append(button)
|
||||
|
||||
data['roles'] = roles = []
|
||||
for r in tr.transition_ids:
|
||||
for r in tr.role_ids:
|
||||
role = {}
|
||||
role['name'] = r.role_id.name
|
||||
role['name'] = r.name
|
||||
roles.append(role)
|
||||
|
||||
|
||||
transitions[tr.id] = data
|
||||
|
||||
g = tools.graph(nodes.keys(), map(lambda x: (x['source'], x['target']), transitions.values()))
|
||||
|
@ -130,8 +145,7 @@ class process_node(osv.osv):
|
|||
'model_id': fields.many2one('ir.model', 'Object', ondelete='set null'),
|
||||
'model_states': fields.char('States Expression', size=128),
|
||||
'flow_start': fields.boolean('Starting Flow'),
|
||||
'transition_in': fields.one2many('process.transition', 'node_to_id', 'Starting Transitions'),
|
||||
'transition_out': fields.one2many('process.transition', 'node_from_id', 'Ending Transitions'),
|
||||
'transition_ids': fields.one2many('process.transition', 'target_node_id', 'Transitions'),
|
||||
}
|
||||
_defaults = {
|
||||
'kind': lambda *args: 'state',
|
||||
|
@ -145,11 +159,11 @@ class process_transition(osv.osv):
|
|||
_description ='Process Transitions'
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=32, required=True),
|
||||
'node_from_id': fields.many2one('process.node', 'Origin Node', required=True, ondelete='cascade'),
|
||||
'node_to_id': fields.many2one('process.node', 'Destination Node', required=True, ondelete='cascade'),
|
||||
'transition_ids': fields.many2many('workflow.transition', 'process_transition_ids', 'trans1_id', 'trans2_id', 'Workflow Transitions'),
|
||||
'source_node_id': fields.many2one('process.node', 'Source Node', required=True, ondelete='cascade'),
|
||||
'target_node_id': fields.many2one('process.node', 'Target Node', required=True, ondelete='cascade'),
|
||||
'action_ids': fields.one2many('process.transition.action', 'transition_id', 'Buttons'),
|
||||
'role_ids': fields.many2many('res.roles', 'process_transition_roles_rel', 'process_transition_id', 'role_id', 'Roles Required'),
|
||||
'note': fields.text('Description'),
|
||||
'action_ids': fields.one2many('process.transition.action', 'transition_id', 'Buttons')
|
||||
}
|
||||
_defaults = {
|
||||
}
|
||||
|
@ -160,7 +174,10 @@ class process_transition_action(osv.osv):
|
|||
_description ='Process Transitions Actions'
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=32, required=True),
|
||||
'state': fields.selection([('dummy','Dummy'),('method','Object Method'),('workflow','Workflow Trigger'),('action','Action')], 'Type', required=True),
|
||||
'state': fields.selection([('dummy','Dummy'),
|
||||
('method','Object Method'),
|
||||
('workflow','Workflow Trigger'),
|
||||
('action','Action')], 'Type', required=True),
|
||||
'action': fields.char('Action ID', size=64, states={
|
||||
'dummy':[('readonly',1)],
|
||||
'method':[('required',1)],
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<report id="report_process"
|
||||
model="process.process"
|
||||
name="process.process.print"
|
||||
string="Print Process"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -2,186 +2,112 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem
|
||||
id="menu_process"
|
||||
name="Enterprise Process"
|
||||
parent="base.menu_custom"/>
|
||||
<menuitem
|
||||
id="menu_process"
|
||||
name="Enterprise Process"
|
||||
parent="base.menu_custom"/>
|
||||
|
||||
<!-- Views for Process -->
|
||||
<record model="ir.ui.view" id="view_process_form">
|
||||
<field name="name">process.process.form</field>
|
||||
<field name="model">process.process</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process">
|
||||
<notebook>
|
||||
<page string="Process">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="2"/>
|
||||
<field name="note" colspan="4"/>
|
||||
</page><page string="Nodes">
|
||||
<field name="node_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Views for Process -->
|
||||
<record model="ir.ui.view" id="view_process_form">
|
||||
<field name="name">process.process.form</field>
|
||||
<field name="model">process.process</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process">
|
||||
<group colspan="4" string="Details">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="2"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Nodes">
|
||||
<field name="node_ids" colspan="4" nolabel="1">
|
||||
<form string="Process Node">
|
||||
<group colspan="4" string="Details">
|
||||
<field name="name" select="1"/>
|
||||
<field name="flow_start"/>
|
||||
<newline/>
|
||||
<field name="model_id" select="1"/>
|
||||
<field name="menu_id" select="2"/>
|
||||
<newline/>
|
||||
<field name="kind" select="1"/>
|
||||
<field name="model_states"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Transitions">
|
||||
<field name="transition_ids" colspan="4" nolabel="1">
|
||||
<tree string="Transitions">
|
||||
<field name="name"/>
|
||||
<field name="target_node_id"/>
|
||||
</tree>
|
||||
<form string="Transition">
|
||||
<group colspan="4" string="Details">
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="target_node_id"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Buttons">
|
||||
<field name="action_ids" colspan="4" nolabel="1">
|
||||
<tree string="Actions">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="action"/>
|
||||
</tree>
|
||||
<form string="Actions">
|
||||
<field name="name" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="state"/>
|
||||
<field name="action"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Roles Required">
|
||||
<field name="role_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Extra Information">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Extra Information">
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Extra Information">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_tree">
|
||||
<field name="name">process.process.tree</field>
|
||||
<field name="model">process.process</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Process">
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_process_tree">
|
||||
<field name="name">process.process.tree</field>
|
||||
<field name="model">process.process</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Process">
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_form">
|
||||
<field name="name">Process</field>
|
||||
<field name="res_model">process.process</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_process_form"
|
||||
action="action_process_form"
|
||||
parent="menu_process"/>
|
||||
|
||||
<!-- Views for Process Nodes -->
|
||||
|
||||
<record model="ir.ui.view" id="view_process_node_tree">
|
||||
<field name="name">process.node.tree</field>
|
||||
<field name="model">process.node</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Process Node">
|
||||
<field name="name"/>
|
||||
<field name="process_id"/>
|
||||
<field name="flow_start"/>
|
||||
<field name="kind"/>
|
||||
<field name="model_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_node_form">
|
||||
<field name="name">process.node.form</field>
|
||||
<field name="model">process.node</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process Node">
|
||||
<notebook>
|
||||
<page string="Node Description">
|
||||
<field name="name" select="1"/>
|
||||
<newline/>
|
||||
<field name="process_id" select="1"/>
|
||||
<field name="flow_start"/>
|
||||
<field name="kind" select="1"/>
|
||||
<field name="model_id" select="1"/>
|
||||
<field name="model_states"/>
|
||||
<newline/>
|
||||
<field name="menu_id" select="2"/>
|
||||
<separator string="Outgoing Transitions" colspan="4"/>
|
||||
<field name="transition_out" colspan="4" nolabel="1">
|
||||
<tree string="Outgoing Transitions">
|
||||
<field name="name"/>
|
||||
<field name="node_to_id"/>
|
||||
</tree>
|
||||
<form string="Outgoing Transitions">
|
||||
<notebook>
|
||||
<page string="Description">
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="node_from_id"/>
|
||||
<field name="node_to_id"/>
|
||||
<field name="note" colspan="4"/>
|
||||
</page><page string="Transitions">
|
||||
<field name="action_ids" colspan="4"/>
|
||||
<field name="transition_ids" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Extra Information">
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_node_form">
|
||||
<field name="name">Process Node</field>
|
||||
<field name="res_model">process.node</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_process_node_form"
|
||||
parent="menu_process"
|
||||
id="menu_partner_address_form"/>
|
||||
|
||||
|
||||
<!-- Views for Partners -->
|
||||
<record model="ir.ui.view" id="view_transition_form">
|
||||
<field name="name">Process Transitions</field>
|
||||
<field name="model">process.transition</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Transitions">
|
||||
<notebook>
|
||||
<page string="Description">
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="node_from_id"/>
|
||||
<field name="node_to_id"/>
|
||||
<field name="note" colspan="4"/>
|
||||
</page><page string="Transitions">
|
||||
<field name="action_ids" colspan="4">
|
||||
<tree string="Actions">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="action"/>
|
||||
</tree>
|
||||
<form string="Actions">
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="state"/>
|
||||
<field name="action"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="transition_ids" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_transition_tree">
|
||||
<field name="name">Process Transitions</field>
|
||||
<field name="model">process.transition</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Transitions">
|
||||
<field name="name"/>
|
||||
<field name="node_from_id"/>
|
||||
<field name="node_to_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_transition_open">
|
||||
<field name="name">Process Transitions</field>
|
||||
<field name="res_model">process.transition</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_transition_open"
|
||||
parent="menu_process"
|
||||
id="menu_action_transition_open"/>
|
||||
<record model="ir.actions.act_window" id="action_process_form">
|
||||
<field name="name">Process</field>
|
||||
<field name="res_model">process.process</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_process_form"
|
||||
action="action_process_form"
|
||||
parent="menu_process"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2005-TODAY TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import report_process
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 885 B |
Binary file not shown.
Before Width: | Height: | Size: 1013 B |
|
@ -1,172 +0,0 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
import Image
|
||||
import ImageDraw
|
||||
import ImageFont
|
||||
import math
|
||||
|
||||
import addons
|
||||
|
||||
ROUNDED = 30
|
||||
BGCOLOR = (228,233,237)
|
||||
TITLECOLOR = (150,70,70)
|
||||
FONT = addons.get_module_resource('process', 'report/sb.ttf')
|
||||
BOXSIZE = (160,120)
|
||||
|
||||
size = 800,600
|
||||
|
||||
class draw(object):
|
||||
def _rounding_box(self, x, y, width, height, title=None, bgcolor=BGCOLOR):
|
||||
d = ImageDraw.Draw(self.img)
|
||||
DR = ROUNDED/2
|
||||
d.polygon( (x+DR,y,x+width-DR,y,x+width,y+DR,x+width,y+height-DR,x+width-DR,y+height,x+DR,y+height,x,y+height-DR,x,y+DR), fill=bgcolor)
|
||||
d.pieslice((x,y,x+ROUNDED,y+ROUNDED),180,270,fill=bgcolor)
|
||||
d.pieslice((x+width-ROUNDED,y,x+width,y+ROUNDED),270,0,fill=title and TITLECOLOR or bgcolor)
|
||||
d.pieslice((x+width-ROUNDED,y+height-ROUNDED,x+width,y+height),0,90,fill=bgcolor)
|
||||
d.pieslice((x,y+height-ROUNDED,x+ROUNDED,y+height),90,180,fill=bgcolor)
|
||||
if title:
|
||||
d.polygon( (x+width/5, y, x+width-DR, y, x+width, y+DR, x+width, y+20, x+width/5+15, y+20), fill=TITLECOLOR)
|
||||
self.draw_text(x+width/5+13, y+4, 10, title, (255,255,255), width*4/5-14)
|
||||
|
||||
def node(self, x, y, width, height, title=None, start_color=BGCOLOR):
|
||||
self._rounding_box(x,y,BOXSIZE[0]-16,BOXSIZE[1], bgcolor=start_color)
|
||||
self._rounding_box(x+12,y,BOXSIZE[0]-16,BOXSIZE[1], bgcolor=(255,255,255))
|
||||
self._rounding_box(x+16,y,BOXSIZE[0]-16,BOXSIZE[1], title)
|
||||
|
||||
def angle(self, arrow):
|
||||
if not arrow[1]-arrow[3]:
|
||||
angle = 180
|
||||
else:
|
||||
angle = math.atan(-(arrow[2]-arrow[0]) / (arrow[1]-arrow[3])) * 180 / math.pi
|
||||
angle = 270 - angle
|
||||
if arrow[3]<arrow[1]:
|
||||
angle = 180 + angle
|
||||
return int(angle)
|
||||
|
||||
def arrow(self, arrow):
|
||||
d = ImageDraw.Draw(self.img)
|
||||
d.line(arrow, width=1, fill=(0,0,0))
|
||||
angle = self.angle(arrow)
|
||||
d.pieslice((arrow[2]-14,arrow[3]-14,arrow[2]+14,arrow[3]+14),angle-18,angle+18,fill=(0,0,0))
|
||||
|
||||
def draw_text(self, x, y, size, title, color=(155,255,255), maxlength=None, font_name=FONT, center=False):
|
||||
d = ImageDraw.Draw(self.img)
|
||||
font = ImageFont.truetype(font_name, size)
|
||||
d.setfont(font)
|
||||
size2 = d.textsize(title)
|
||||
if maxlength:
|
||||
fontsize = min(size, size * maxlength / size2[0])
|
||||
font = ImageFont.truetype(font_name, fontsize)
|
||||
d.setfont(font)
|
||||
size = d.textsize(title)
|
||||
if center:
|
||||
x = x-size[0]/2
|
||||
d.text( (x, y+(size2[1]-size[1])/2), title, color)
|
||||
|
||||
def arrow_role(self, node_from, node_to, role='Hello'):
|
||||
d = ImageDraw.Draw(self.img)
|
||||
x = (node_from[0] + node_to[0]) /2
|
||||
y = (node_from[1] + node_to[1]) /2
|
||||
angle = self.angle(node_from+node_to) + 105
|
||||
d.pieslice((x-40,y-40,x+40,y+40),angle-5,angle+5,fill=(100,0,0))
|
||||
d.pieslice((x-6,y-6,x+6,y+6),angle-7,angle+7,fill=(255,255,255))
|
||||
|
||||
print -180 + angle - 90
|
||||
x = x + math.cos(angle * math.pi / 180) * 40
|
||||
y = y + math.sin(angle * math.pi / 180) * 40
|
||||
a,b = x,y
|
||||
angle -= 120
|
||||
|
||||
x = x + math.cos(angle * math.pi / 180) * 20
|
||||
y = y + math.sin(angle * math.pi / 180) * 20
|
||||
|
||||
d.line((a,b,x,y), width=5, fill=(100,0,0))
|
||||
angle += 125
|
||||
d.pieslice((x-30,y-30,x+30,y+30),angle-7,angle+7,fill=(100,0,0))
|
||||
|
||||
x = x + math.cos(angle * math.pi / 180) * 50
|
||||
y = y + math.sin(angle * math.pi / 180) * 50
|
||||
return (x,y)
|
||||
|
||||
def picture(self, x, y, fname):
|
||||
img = Image.open(fname)
|
||||
img2 = img.convert('RGBA')
|
||||
self.img.paste(img2, (max(0,x-img.size[0]/2), max(0,y-img.size[1])), mask=img2)
|
||||
|
||||
def __init__(self, img):
|
||||
self.img = img
|
||||
|
||||
class graph(object):
|
||||
def __init__(self, img):
|
||||
self.draw = draw(img)
|
||||
|
||||
def intersect_one(self, start, stop):
|
||||
if start[0] < stop[0]:
|
||||
x1 = start[0] + BOXSIZE[0]/2 + 3
|
||||
else:
|
||||
x1 = start[0] - BOXSIZE[0]/2 - 3
|
||||
if not start[0]-stop[0]:
|
||||
y1 = 99999999999999
|
||||
else:
|
||||
y1 = start[1] - (start[1] - stop[1]) * (start[0]-x1) / (start[0] - stop[0])
|
||||
|
||||
if start[1] < stop[1]:
|
||||
y2 = start[1] + BOXSIZE[1]/2 + 3
|
||||
else:
|
||||
y2 = start[1] - BOXSIZE[1]/2 - 3
|
||||
if not start[1]-stop[1]:
|
||||
x2 = 99999999999999
|
||||
else:
|
||||
x2 = start[0] - (start[0] - stop[0]) * (start[1]-y2) / (start[1] - stop[1])
|
||||
|
||||
if abs(start[0]-x1)+abs(start[1]-y1)<abs(start[0]-x2)+abs(y2-start[1]):
|
||||
return (x1,y1)
|
||||
return (x2,y2)
|
||||
|
||||
def intersect(self, start, stop):
|
||||
s = self.intersect_one(start,stop)
|
||||
s2 = self.intersect_one(stop,start)
|
||||
return s+s2
|
||||
|
||||
def node(self, x, y, data, start_color=False):
|
||||
self.draw.node(x,y,BOXSIZE[0], BOXSIZE[1], data.get('title','Unknown'), start_color and (255,125,125) or BGCOLOR)
|
||||
self.draw.picture(x+35, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-help.png'))
|
||||
if start_color:
|
||||
self.draw.picture(x+65, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-open.png'))
|
||||
self.draw.picture(x+95, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-print.png'))
|
||||
y = y+25
|
||||
menus = data.get('menu','').split('/')
|
||||
while menus:
|
||||
menu = menus.pop(0)
|
||||
if menu:
|
||||
if menus: menu=menu+' /'
|
||||
self.draw.draw_text(x+23, y, 10, menu, color=(0,0,0), maxlength=BOXSIZE[0] - 25,
|
||||
font_name=addons.get_module_resource('process', 'report/ds.ttf'))
|
||||
y+=15
|
||||
|
||||
def arrow_role(self, node_from, node_to, role='Hello'):
|
||||
start = (node_from[0]+BOXSIZE[0]/2, node_from[1]+BOXSIZE[1]/2)
|
||||
stop = (node_to[0]+BOXSIZE[0]/2, node_to[1]+BOXSIZE[1]/2)
|
||||
(x,y) = self.draw.arrow_role(start, stop, role)
|
||||
self.draw.picture(x, y-3, addons.get_module_resource('process', 'report/role.png'))
|
||||
self.draw.draw_text(x,y-3, 12, 'Salesman', color=(0,0,0), center=True)
|
||||
|
||||
def arrow(self, node_from, node_to):
|
||||
start = (node_from[0]+BOXSIZE[0]/2, node_from[1]+BOXSIZE[1]/2)
|
||||
stop = (node_to[0]+BOXSIZE[0]/2, node_to[1]+BOXSIZE[1]/2)
|
||||
arrow = self.intersect(start,stop)
|
||||
self.draw.arrow(arrow)
|
||||
|
||||
if __name__=='__main__':
|
||||
img = Image.new('RGB',size,'#ffffff')
|
||||
g = graph(img)
|
||||
g.node(50,100,{'title':'SALE AZER ORDER', 'menu':'Sales Management/Sales Orders/My Sales Order/My Open Sales Order'}, start_color=(200,100,100))
|
||||
g.node(350,150,{'title':'SALE AZER AZE ORDER', 'menu':'Sales Management/Sales Orders/My Quotations'})
|
||||
g.arrow((50,100),(350,150))
|
||||
|
||||
g.arrow_role((50,100),(350,150))
|
||||
|
||||
#img.show()
|
||||
img.save('a.pdf')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id: print_instance.py 8595 2008-06-16 13:00:21Z stw $
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
import time, os
|
||||
|
||||
import netsvc
|
||||
import report,pooler,tools
|
||||
|
||||
import process_print
|
||||
import Image
|
||||
|
||||
|
||||
class report_graph_instance(object):
|
||||
def __init__(self, cr, uid, ids, data):
|
||||
current_object = 'sale.order'
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
for process in pool.get('process.process').browse(cr, uid, ids):
|
||||
nodes = {}
|
||||
start = []
|
||||
transitions = {}
|
||||
for node in process.node_ids:
|
||||
nodes[node.id] = node
|
||||
if node.flow_start:
|
||||
start.append(node.id)
|
||||
for tr in node.transition_out:
|
||||
transitions[tr.id] = tr
|
||||
g = tools.graph(nodes.keys(), map(lambda x: (x.node_from_id.id,x.node_to_id.id), transitions.values()))
|
||||
g.process(start)
|
||||
g.scale(250,250, 100, 10)
|
||||
|
||||
img = Image.new('RGB',(1024,768),'#ffffff')
|
||||
g2 = process_print.graph(img)
|
||||
positions = g.result
|
||||
for name,node in positions.items():
|
||||
start_color = (nodes[name].model_id.model==current_object)
|
||||
g2.node(node['y'],node['x'], {
|
||||
'title': nodes[name].name,
|
||||
'menu': nodes[name].menu_id.complete_name
|
||||
}, start_color=start_color)
|
||||
for name,transition in transitions.items():
|
||||
if transition.transition_ids:
|
||||
g2.arrow_role((positions[transition.node_from_id.id]['y'], positions[transition.node_from_id.id]['x']),
|
||||
(positions[transition.node_to_id.id]['y'], positions[transition.node_to_id.id]['x']))
|
||||
g2.arrow((positions[transition.node_from_id.id]['y'], positions[transition.node_from_id.id]['x']),
|
||||
(positions[transition.node_to_id.id]['y'], positions[transition.node_to_id.id]['x']))
|
||||
img.save('/tmp/a.pdf')
|
||||
self.result = file('/tmp/a.pdf').read()
|
||||
self.done = True
|
||||
|
||||
def is_done(self):
|
||||
return self.done
|
||||
|
||||
def get(self):
|
||||
if self.done:
|
||||
return self.result
|
||||
else:
|
||||
return None
|
||||
|
||||
class report_graph(report.interface.report_int):
|
||||
def __init__(self, name, table):
|
||||
report.interface.report_int.__init__(self, name)
|
||||
self.table = table
|
||||
|
||||
def result(self):
|
||||
if self.obj.is_done():
|
||||
return (True, self.obj.get(), 'pdf')
|
||||
else:
|
||||
return (False, False, False)
|
||||
|
||||
def create(self, cr, uid, ids, data, context={}):
|
||||
self.obj = report_graph_instance(cr, uid, ids, data)
|
||||
return (self.obj.get(), 'pdf')
|
||||
|
||||
report_graph('report.process.process.print', 'process.process')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
@ -95,7 +95,7 @@ class stock_picking(osv.osv):
|
|||
def _invoice_hook(self, cursor, user, picking, invoice_id):
|
||||
purchase_obj = self.pool.get('purchase.order')
|
||||
if picking.purchase_id:
|
||||
purchase_obj.write(cursor, user, [picking.purchase_id.id], {
|
||||
purchase_obj.write(cursor, user, [picking.purchase_id.id], {'invoiced':True,
|
||||
'invoice_id': invoice_id,
|
||||
})
|
||||
return super(stock_picking, self)._invoice_hook(cursor, user,
|
||||
|
|
|
@ -77,5 +77,36 @@ class report_stock_prodlots(osv.osv):
|
|||
)""")
|
||||
report_stock_prodlots()
|
||||
|
||||
|
||||
class report_inventory_latest(osv.osv):
|
||||
_name = "report.inventory.latest"
|
||||
_description = "Latest inventories by product."
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.datetime('Latest Date',readonly=True),
|
||||
'product': fields.many2one('product.product', 'Product', readonly=True, select=True),
|
||||
'inventory': fields.many2one('stock.inventory', 'Inventory Name', readonly=True, select=True),
|
||||
'qty': fields.float('Quantity', readonly=True, select=True),
|
||||
'uom' : fields.many2one('product.uom', 'UoM', readonly=True),
|
||||
# 'date' : fields.datetime('Latest Date',readonly=True),
|
||||
}
|
||||
_order = 'name desc'
|
||||
def init(self, cr):
|
||||
cr.execute("""
|
||||
create or replace view report_inventory_latest as (
|
||||
select max(l.id) as id,
|
||||
l.product_id as product,
|
||||
l.product_qty as qty,
|
||||
l.product_uom as uom ,
|
||||
min(l.inventory_id) as inventory,
|
||||
i.date as name
|
||||
from stock_inventory_line l
|
||||
join stock_inventory i on (l.inventory_id=i.id)
|
||||
group by l.product_uom,l.product_qty,l.product_id,i.date
|
||||
|
||||
)""")
|
||||
report_inventory_latest()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
<field name="view_mode">form,tree</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="next_id_61" name="Reporting" parent="stock.menu_stock_root"/><menuitem id="next_id_62" name="Traceability" parent="next_id_61"/><menuitem action="action_report_stock_prodlots_form" id="menu_report_stock_prodlots" parent="next_id_62"/>
|
||||
<menuitem id="next_id_61" name="Reporting" parent="stock.menu_stock_root"/><menuitem id="next_id_62" name="Traceability" parent="next_id_61"/>
|
||||
|
||||
<menuitem action="action_report_stock_prodlots_form" id="menu_report_stock_prodlots" parent="next_id_62"/>
|
||||
|
||||
<act_window domain="[('location_id', '=', active_id)]" id="act_stock_location_2_report_stock_prodlots" name="Stock by production lots" res_model="report.stock.prodlots" src_model="stock.location"/>
|
||||
|
||||
|
@ -32,5 +34,31 @@
|
|||
|
||||
<act_window domain="[('prodlot_id', '=', active_id)]" id="act_stock_production_lot_2_report_stock_prodlots" name="Stock" res_model="report.stock.prodlots" src_model="stock.production.lot"/>
|
||||
|
||||
<record id="report_stock_latest_tree" model="ir.ui.view">
|
||||
<field name="name">report.inventory.latest.view</field>
|
||||
<field name="model">report.inventory.latest</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Latest inventories by product">
|
||||
<field name="product" select="1"/>
|
||||
<field name="qty" select="1"/>
|
||||
<field name="uom"/>
|
||||
<field name="inventory"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_stock_latest_form" model="ir.actions.act_window">
|
||||
<field name="name">Latest Inventories by product</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">report.inventory.latest</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('name','>=',time.strftime('%Y-%m-01'))]</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_report_stock_latest_form" id="menu_report_stock_latest" parent="next_id_62"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -301,7 +301,7 @@ class sale_order(osv.osv):
|
|||
def _inv_get(self, cr, uid, order, context={}):
|
||||
return {}
|
||||
|
||||
def _make_invoice(self, cr, uid, order, lines):
|
||||
def _make_invoice(self, cr, uid, order, lines, context={}):
|
||||
a = order.partner_id.property_account_receivable.id
|
||||
if order.payment_term:
|
||||
pay_term = order.payment_term.id
|
||||
|
@ -781,7 +781,7 @@ class sale_order_line(osv.osv):
|
|||
if not product:
|
||||
return {'value': {'th_weight' : 0, 'product_packaging': False,
|
||||
'product_uos_qty': qty}, 'domain': {'product_uom': [],
|
||||
'product_uos': []}}
|
||||
'product_uos': []}}
|
||||
|
||||
if not date_order:
|
||||
date_order = time.strftime('%Y-%m-%d')
|
||||
|
@ -793,7 +793,7 @@ class sale_order_line(osv.osv):
|
|||
pack = self.pool.get('product.packaging').browse(cr, uid, packaging, context)
|
||||
q = product_uom_obj._compute_qty(cr, uid, uom, pack.qty, default_uom)
|
||||
qty = qty - qty % q + q
|
||||
result['product_uom_qty'] = qty
|
||||
result['product_uom_qty'] = qty
|
||||
|
||||
if uom:
|
||||
uom2 = product_uom_obj.browse(cr, uid, uom)
|
||||
|
|
|
@ -94,7 +94,7 @@ class stock_picking(osv.osv):
|
|||
def _invoice_line_hook(self, cursor, user, move_line, invoice_line_id):
|
||||
sale_line_obj = self.pool.get('sale.order.line')
|
||||
if move_line.sale_line_id:
|
||||
sale_line_obj.write(cursor, user, [move_line.sale_line_id.id], {
|
||||
sale_line_obj.write(cursor, user, [move_line.sale_line_id.id], {'invoiced':True,
|
||||
'invoice_lines': [(6, 0, [invoice_line_id])],
|
||||
})
|
||||
return super(stock_picking, self)._invoice_line_hook(cursor, user,
|
||||
|
@ -114,4 +114,3 @@ stock_picking()
|
|||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -15,3 +15,4 @@
|
|||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -977,11 +977,11 @@ class stock_move(osv.osv):
|
|||
return True
|
||||
|
||||
def action_done(self, cr, uid, ids, context=None):
|
||||
track_flag=False
|
||||
for move in self.browse(cr, uid, ids):
|
||||
if move.move_dest_id.id and (move.state != 'done'):
|
||||
mid = move.move_dest_id.id
|
||||
if move.move_dest_id.id:
|
||||
cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%d,%d)', (move.id, move.move_dest_id.id))
|
||||
cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%d,%d)', (move.id, move.move_dest_id.id))
|
||||
if move.move_dest_id.state in ('waiting','confirmed'):
|
||||
self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'})
|
||||
if move.move_dest_id.picking_id:
|
||||
|
@ -1069,6 +1069,11 @@ class stock_move(osv.osv):
|
|||
'line_id': lines,
|
||||
'ref': ref,
|
||||
})
|
||||
|
||||
|
||||
if (move.product_id.tracking and not move.prodlot_id):
|
||||
raise osv.except_osv('Warning ! ','You should put a production lot for : '+move.product_id.name)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'done'})
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
@ -1234,4 +1239,3 @@ class stock_picking_move_wizard(osv.osv_memory):
|
|||
stock_picking_move_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -1257,3 +1257,4 @@
|
|||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
Loading…
Reference in New Issue