[MERGE] Merge from trunk addons

bzr revid: mra@mra-laptop-20101004043444-6dvkwuhx05cdf134
This commit is contained in:
Mustufa Rangwala
2010-10-04 10:04:44 +05:30
141 changed files with 2761 additions and 1244 deletions
+21 -9
View File
@@ -292,15 +292,27 @@ class account_move_line(osv.osv):
ml = self.browse(cr, uid, id, context)
return map(lambda x: x.id, ml.move_id.line_id)
# TODO: this is false, it does not uses draft and closed periods
def _balance(self, cr, uid, ids, prop, unknow_none, unknow_dict):
res={}
# TODO group the foreach in sql
for id in ids:
cr.execute('SELECT date,account_id FROM account_move_line WHERE id=%s', (id,))
dt, acc = cr.fetchone()
cr.execute('SELECT SUM(debit-credit) FROM account_move_line WHERE account_id=%s AND (date<%s OR (date=%s AND id<=%s))', (acc,dt,dt,id))
res[id] = cr.fetchone()[0]
def _balance(self, cr, uid, ids, name, arg, context=None):
if context is None:
context = {}
c = context.copy()
c['initital_bal'] = True
sql = [
"""select l2.id, sum(l1.debit-l1.credit) from account_move_line l1, account_move_line l2""",
"""where l2.account_id=l1.account_id""",
"""and""",
"""l1.id<=l2.id""",
"""and""",
"""l2.id in %s""",
"""and""",
self._query_get(cr, uid, obj='l1', context=c),
""" group by l2.id""",
]
cr.execute('\n'.join(sql), [tuple(ids)])
res = dict(cr.fetchall())
return res
def _invoice(self, cursor, user, ids, name, arg, context=None):
+3 -3
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-30 13:07+0000\n"
"Last-Translator: Douwe Wullink (Dypalio) <Unknown>\n"
"PO-Revision-Date: 2010-10-01 11:48+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Launchpad-Export-Date: 2010-10-02 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
+3 -3
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 12:50+0000\n"
"PO-Revision-Date: 2010-09-30 13:20+0000\n"
"Last-Translator: Douwe Wullink (Dypalio) <Unknown>\n"
"PO-Revision-Date: 2010-10-01 11:59+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Launchpad-Export-Date: 2010-10-02 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_anglo_saxon
+3 -3
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 13:11+0000\n"
"PO-Revision-Date: 2010-10-01 06:44+0000\n"
"Last-Translator: Douwe Wullink (Dypalio) <Unknown>\n"
"PO-Revision-Date: 2010-10-01 11:59+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Launchpad-Export-Date: 2010-10-02 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_coda
+3 -3
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-06-18 10:59+0000\n"
"PO-Revision-Date: 2010-10-01 07:53+0000\n"
"Last-Translator: Douwe Wullink (Dypalio) <Unknown>\n"
"PO-Revision-Date: 2010-10-01 11:59+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Launchpad-Export-Date: 2010-10-02 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: analytic
+71 -52
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-19 12:20+0000\n"
"PO-Revision-Date: 2010-10-01 08:47+0000\n"
"Last-Translator: Douwe Wullink (Dypalio) <Unknown>\n"
"PO-Revision-Date: 2010-10-02 08:12+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:48+0000\n"
"X-Launchpad-Export-Date: 2010-10-03 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_action_rule
@@ -185,42 +185,42 @@ msgstr "Laatste actiedatum"
#. module: base_action_rule
#: selection:base.action.rule,trg_date_range_type:0
msgid "Hours"
msgstr ""
msgstr "Uren"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_id)s = Object ID"
msgstr ""
msgstr "%(object_id)s = Object ID"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Delay After Trigger Date"
msgstr ""
msgstr "Vertraging na Activeerdatum"
#. module: base_action_rule
#: field:base.action.rule,act_remind_attach:0
msgid "Remind with Attachment"
msgstr ""
msgstr "Herinneren met bijlage"
#. module: base_action_rule
#: constraint:ir.cron:0
msgid "Invalid arguments"
msgstr ""
msgstr "Ongeldige argumenten"
#. module: base_action_rule
#: field:base.action.rule,act_user_id:0
msgid "Set Responsible to"
msgstr ""
msgstr "Zet verantwoordelijke op"
#. module: base_action_rule
#: selection:base.action.rule,trg_date_type:0
msgid "None"
msgstr ""
msgstr "Geen"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_user_phone)s = Responsible phone"
msgstr ""
msgstr "%(object_user_phone)s = Telefoon verantwoordelijke"
#. module: base_action_rule
#: view:base.action.rule:0
@@ -228,11 +228,14 @@ msgid ""
"The rule uses the AND operator. The model must match all non-empty fields so "
"that the rule executes the action described in the 'Actions' tab."
msgstr ""
"De regel gebruikt een EN bewerking. Het model moet met alle niet-lege velden "
"overeenkomen om de regel de in de 'Acties' tab beschreven actie te laten "
"uitvoeren."
#. module: base_action_rule
#: field:base.action.rule,trg_date_range_type:0
msgid "Delay type"
msgstr ""
msgstr "Soort vertraging"
#. module: base_action_rule
#: help:base.action.rule,regex_name:0
@@ -242,11 +245,15 @@ msgid ""
"string 'urgent'\n"
"Note: This is case sensitive search."
msgstr ""
"Reguliere expressie voor overeenkomende naam van de bron; \n"
"i.e.: 'urgent.*' zal zoeken naar records met de naam beginnend met de tekst "
"'urgent'\n"
"Opmerking: dit zoeken is hoofdletter gevoelig."
#. module: base_action_rule
#: field:base.action.rule,act_method:0
msgid "Call Object Method"
msgstr ""
msgstr "Object-methode aanroepen"
#. module: base_action_rule
#: help:base.action.rule,act_mail_to_watchers:0
@@ -254,31 +261,33 @@ msgid ""
"Check this if you want the rule to mark CC(mail to any other person defined "
"in actions)."
msgstr ""
"Vink aan als u wilt dat de regel CC markeert (mail naar een andere in de "
"acties gedefinieerde persoon)."
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(partner)s = Partner name"
msgstr ""
msgstr "%(partner)s = Naam relatie"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Note"
msgstr ""
msgstr "Notitie"
#. module: base_action_rule
#: constraint:ir.ui.menu:0
msgid "Error ! You can not create recursive Menu."
msgstr ""
msgstr "Fout ! U kunt geen recursief menu maken."
#. module: base_action_rule
#: field:base.action.rule,trg_date_range:0
msgid "Delay after trigger date"
msgstr ""
msgstr "Vertraging na activeerdatum"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Conditions"
msgstr ""
msgstr "Voorwaarden"
#. module: base_action_rule
#: help:base.action.rule,trg_date_range:0
@@ -287,47 +296,50 @@ msgid ""
"need a delay before the trigger date, like sending a reminder 15 minutes "
"before a meeting."
msgstr ""
"Vertraging na activeerdatum, specificeert dat u een negatief getal kunt "
"invoeren als u vertraging vóór de activeerdatum wilt, zoals een herinnering "
"15 minuten voor een vergadering versturen."
#. module: base_action_rule
#: field:base.action.rule,active:0
msgid "Active"
msgstr ""
msgstr "Actief"
#. module: base_action_rule
#: code:addons/base_action_rule/base_action_rule.py:0
#, python-format
msgid "No E-Mail ID Found for your Company address!"
msgstr ""
msgstr "Geen email-ID gevonden bij uw bedrijfsadres!"
#. module: base_action_rule
#: field:base.action.rule,act_remind_user:0
msgid "Remind Responsible"
msgstr ""
msgstr "Herinneren verantwoordelijke"
#. module: base_action_rule
#: model:ir.module.module,description:base_action_rule.module_meta_information
msgid "This module allows to implement action rules for any object."
msgstr ""
msgstr "Deze module laat u actieregels voor elk object implementeren."
#. module: base_action_rule
#: help:base.action.rule,sequence:0
msgid "Gives the sequence order when displaying a list of rules."
msgstr ""
msgstr "Geeft de volgorde aan waarin de lijst van regels wordt weergegeven."
#. module: base_action_rule
#: selection:base.action.rule,trg_date_range_type:0
msgid "Months"
msgstr ""
msgstr "Maanden"
#. module: base_action_rule
#: field:base.action.rule,filter_id:0
msgid "Filter"
msgstr ""
msgstr "Filter"
#. module: base_action_rule
#: selection:base.action.rule,trg_date_type:0
msgid "Date"
msgstr ""
msgstr "Datum"
#. module: base_action_rule
#: help:base.action.rule,server_action_id:0
@@ -335,108 +347,111 @@ msgid ""
"Describes the action name.\n"
"eg:on which object which action to be taken on basis of which condition"
msgstr ""
"Beschrijft de actie naam.\n"
"ie: op welk object welke actie wordt uitgevoerd onder welke conditie"
#. module: base_action_rule
#: model:ir.model,name:base_action_rule.model_ir_cron
msgid "ir.cron"
msgstr ""
msgstr "ir.cron"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_description)s = Object description"
msgstr ""
msgstr "%(object_description)s = Object omschrijving"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Email Actions"
msgstr ""
msgstr "Email acties"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Email Information"
msgstr ""
msgstr "Email Informatie"
#. module: base_action_rule
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"De objectnaam moet beginnen met x_ en mag geen speciale tekens bevatten !"
#. module: base_action_rule
#: model:ir.model,name:base_action_rule.model_base_action_rule
msgid "Action Rules"
msgstr ""
msgstr "Actieregels"
#. module: base_action_rule
#: help:base.action.rule,act_mail_body:0
msgid "Content of mail"
msgstr ""
msgstr "Inhoud van mail"
#. module: base_action_rule
#: field:base.action.rule,trg_user_id:0
msgid "Responsible"
msgstr ""
msgstr "Verantwoordelijke"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(partner_email)s = Partner Email"
msgstr ""
msgstr "%(partner_email)s = Relatie email"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_date)s = Creation date"
msgstr ""
msgstr "%(object_date)s = Aanmaakdatum"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_user_email)s = Responsible Email"
msgstr ""
msgstr "%(object_user_email)s = Verantwoordelijke email"
#. module: base_action_rule
#: field:base.action.rule,act_mail_body:0
msgid "Mail body"
msgstr ""
msgstr "E-mail berichttekst"
#. module: base_action_rule
#: field:base.action.rule,act_mail_to_watchers:0
msgid "Mail to Watchers (CC)"
msgstr ""
msgstr "E-mail naar toeschouwers (CC)"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Server Action to be Triggered"
msgstr ""
msgstr "Server actie om te activeren"
#. module: base_action_rule
#: field:base.action.rule,act_mail_to_user:0
msgid "Mail to Responsible"
msgstr ""
msgstr "E-mail naar verantwoordelijke"
#. module: base_action_rule
#: field:base.action.rule,act_email_cc:0
msgid "Add Watchers (Cc)"
msgstr ""
msgstr "Toevoegen toeschouwers (Cc)"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Conditions on Model Fields"
msgstr ""
msgstr "Voorwaarden op Model velden"
#. module: base_action_rule
#: model:ir.actions.act_window,name:base_action_rule.base_action_rule_act
#: model:ir.ui.menu,name:base_action_rule.menu_base_action_rule_form
msgid "Automated Actions"
msgstr ""
msgstr "Geautomatiseerde acties"
#. module: base_action_rule
#: field:base.action.rule,server_action_id:0
msgid "Server Action"
msgstr ""
msgstr "Server-actie"
#. module: base_action_rule
#: field:base.action.rule,regex_name:0
msgid "Regex on Resource Name"
msgstr ""
msgstr "Regex op bronnaam"
#. module: base_action_rule
#: help:base.action.rule,act_remind_attach:0
@@ -444,21 +459,23 @@ msgid ""
"Check this if you want that all documents attached to the object be attached "
"to the reminder email sent."
msgstr ""
"Vink dit aan als u wilt dat alle bij het object gevoegde documenten worden "
"bijgevoegd bij de verstuurde herinnering."
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Conditions on Timing"
msgstr ""
msgstr "Voorwaarden op timing"
#. module: base_action_rule
#: field:base.action.rule,sequence:0
msgid "Sequence"
msgstr ""
msgstr "Volgnummer"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Actions"
msgstr ""
msgstr "Acties"
#. module: base_action_rule
#: help:base.action.rule,active:0
@@ -466,23 +483,25 @@ msgid ""
"If the active field is set to False, it will allow you to hide the rule "
"without removing it."
msgstr ""
"Als het actief veld uitzet, kunt u de regel verbergen zonder haar te "
"verwijderen."
#. module: base_action_rule
#: view:base.action.rule:0
msgid "%(object_user)s = Responsible name"
msgstr ""
msgstr "%(object_user)s = Naam verantwoordelijke"
#. module: base_action_rule
#: field:base.action.rule,create_date:0
msgid "Create Date"
msgstr ""
msgstr "Aanmaakdatum"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Conditions on States"
msgstr ""
msgstr "Voorwaarden op status"
#. module: base_action_rule
#: field:base.action.rule,trg_date_type:0
msgid "Trigger Date"
msgstr ""
msgstr "Activeerdatum"
+17 -18
View File
@@ -673,9 +673,10 @@ true, it will allow you to hide the event alarm information without removing it.
new_res_alarm = res_alarm_obj.create(cr, uid, val, context=context)
else:
new_res_alarm = alarm_ids[0]
cr.execute('Update %s set base_calendar_alarm_id=%s, alarm_id=%s \
where id=%s' % (model_obj._table, \
cal_alarm.id, new_res_alarm, data.id))
cr.execute('UPDATE %s ' % model_obj._table + \
' SET base_calendar_alarm_id=%s, alarm_id=%s ' \
' WHERE id=%s',
(cal_alarm.id, new_res_alarm, data.id))
self.do_alarm_unlink(cr, uid, [data.id], model)
if basic_alarm:
@@ -697,9 +698,10 @@ true, it will allow you to hide the event alarm information without removing it.
'user_id': uid
}
alarm_id = alarm_obj.create(cr, uid, vals)
cr.execute('Update %s set base_calendar_alarm_id=%s, alarm_id=%s \
where id=%s' % (model_obj._table, \
alarm_id, basic_alarm.id, data.id))
cr.execute('UPDATE %s ' % model_obj._table + \
' SET base_calendar_alarm_id=%s, alarm_id=%s '
' WHERE id=%s', \
( alarm_id, basic_alarm.id, data.id) )
return True
def do_alarm_unlink(self, cr, uid, ids, model, context=None):
@@ -722,7 +724,7 @@ true, it will allow you to hide the event alarm information without removing it.
if alarm_ids:
alarm_obj.unlink(cr, uid, alarm_ids)
cr.execute('Update %s set base_calendar_alarm_id=NULL, alarm_id=NULL\
where id=%s' % (model_obj._table, datas.id))
where id=%%d' % model_obj._table,(datas.id,))
return True
res_alarm()
@@ -994,10 +996,10 @@ class calendar_event(osv.osv):
context = {}
cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\
mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\
day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id))
day=0,select1='date',month_list=Null ,byday=Null where id=%%s" % (self._table), (id,))
if not value:
cr.execute("UPDATE %s set rrule_type='none' where id=%s" % (self._table, id))
cr.execute("UPDATE %s set rrule_type='none' where id=%%s" % self._table,(id,))
return True
val = {}
for part in value.split(';'):
@@ -1063,7 +1065,7 @@ class calendar_event(osv.osv):
'rule_type': rrule_type,
'id': id,
})
cr.execute(qry % val)
cr.execute(qry, val) # Hopefully psycopg2 works with dicts. But, FIXME
return True
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
@@ -1081,7 +1083,7 @@ class calendar_event(osv.osv):
if datas.get('rrule_type'):
if datas.get('rrule_type') == 'none':
result[event] = False
cr.execute("UPDATE %s set exrule=Null where id=%s" % (self._table, event))
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
elif datas.get('rrule_type') == 'custom':
if datas.get('interval', 0) < 0:
raise osv.except_osv('Warning!', 'Interval can not be Negative')
@@ -1258,7 +1260,7 @@ true, it will allow you to hide the event alarm information without removing it.
if defaults.get('location'):
qry += ", location = '%(location)s'"
qry += "WHERE id = %s" % (event_id)
cr.execute(qry %(defaults))
cr.execute(qry, defaults)
return True
@@ -1283,8 +1285,7 @@ true, it will allow you to hide the event alarm information without removing it.
if ids and (base_start_date or base_until_date):
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, m.duration, \
m.exdate, m.exrule, m.recurrent_id, m.recurrent_uid from " + self._table + \
" m where m.id in ("\
+ ','.join(map(lambda x: str(x), ids))+")")
" m where m.id = ANY(%s)", (ids,) )
count = 0
for data in cr.dictfetchall():
@@ -1683,10 +1684,8 @@ class calendar_todo(osv.osv):
@param context: A standard dictionary for contextual values
"""
event = self.browse(cr, uid, id, context=context)
cr.execute("UPDATE %s set date_start='%s' where id=%s" \
% (self._table, value, id))
return True
assert name == 'date'
return self.write(cr, uid, id, { 'date_start': value }, context=context)
_columns = {
'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \
+1 -1
View File
@@ -122,7 +122,7 @@
separator="1" help="Delegated Invitations" />
<separator orientation="vertical"/>
<field name="email" select='1'/>
<field name="user_id" select="1"/>
<field name="user_id" select="1" string="Responsible"/>
<separator orientation="vertical"/>
<field name="cutype" string="Invitation type" select="1"/>
<field name="event_date" select="1"/>
@@ -159,8 +159,8 @@ send an Email to Invited Person')
if not partner_id:
return {'value': {'contact_ids': []}}
cr.execute('select id from res_partner_address \
where partner_id=%s' % (partner_id))
cr.execute('SELECT id FROM res_partner_address \
WHERE partner_id=%s', (partner_id,))
contacts = map(lambda x: x[0], cr.fetchall())
return {'value': {'contact_ids': contacts}}
@@ -143,34 +143,9 @@
<menuitem
name="Custom Reports" id="base.menu_custom_reports"
groups="base.group_extended"
action="base_report_creator_action" parent="base.reporting_menu" sequence="1"/>
<menuitem
parent="base.next_id_50"
id="menu_base_report_creator_action_config"
action="base_report_creator_action"/>
<record model="ir.ui.view" id="base_report_creator_tree_simple">
<field name="name">base_report_creator.report.simple.tree</field>
<field name="model">base_report_creator.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Reports">
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="base_report_creator_action_tree">
<field name="res_model">base_report_creator.report</field>
<field name="view_type">tree</field>
</record>
<menuitem
name="Custom Reports" parent="base.menu_custom_reports"
id="menu_base_report_creator_action"
action="base_report_creator_action_tree"/>
</data>
</openerp>
@@ -72,21 +72,10 @@
<field name="context">{'menu':True}</field>
</record>
<menuitem icon="terp-graph" id="base.reporting_menu"
name="Reporting" sequence="30" />
<menuitem id="base.next_id_50" name="Configuration"
parent="base.reporting_menu" sequence="3" />
<menuitem parent="base.next_id_50" name="Report Designer"
<menuitem parent="base.reporting_menu" name="Report Designer"
action="action_report_designer_wizard"
id="menu_action_report_designer_wizard" sequence="70" />
<menuitem parent="base.next_id_50" name="Modify an existing report"
action="action_view_base_report_sxw"
id="menu_wizard_report_designer_modify" sequence="70" groups="base.group_extended"/>
</data>
</openerp>
+8 -20
View File
@@ -60,25 +60,15 @@ class base_setup_config_choice(osv.osv_memory):
'config_logo' : _get_image
}
def set_default_menu(self, cr, uid, menu, context=None):
user = self.pool.get('res.users')\
.browse(cr, uid, uid, context=context)
user.write({'action_id': menu.id,
'menu_id': menu.id})
def get_default_menu(self, cr, uid, context=None):
actions = self.pool.get('ir.actions.act_window')
current_menu_id = actions.search(cr, uid, [('name','=','Menu')],
context=context)
assert len(current_menu_id) == 1,\
'A given user should only have one menu item'
return actions.browse(cr, uid, current_menu_id[0], context=context)
def reset_menu(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
menu_id = user._get_menu()
user.write({'action_id': False,
'menu_id': menu_id})
return self.pool.get('ir.actions.act_window').browse(cr, uid, menu_id, context=context)
def menu(self, cr, uid, ids, context=None):
menu = self.get_default_menu(cr, uid, context=context)
self.set_default_menu(cr, uid, menu, context=context)
menu = self.reset_menu(cr, uid, context=context)
if menu.view_id.id:
view_id = (menu.view_id.id, menu.view_id.name)
@@ -98,9 +88,7 @@ class base_setup_config_choice(osv.osv_memory):
}
def config(self, cr, uid, ids, context=None):
menu = self.get_default_menu(cr, uid, context=context)
self.set_default_menu(cr, uid, menu, context=context)
self.reset_menu(cr, uid, context=context)
return self.pool.get('res.config').next(cr, uid, [], context=context)
base_setup_config_choice()
+4 -1
View File
@@ -24,9 +24,12 @@
"version":"0.1",
"author":"Tiny",
"category":"Generic Modules/Base",
"description": """Synchronization with all objects.""",
"depends":["base"],
"demo_xml":[],
"update_xml":["base_synchro_wizard.xml","base_synchro_view.xml"],
"update_xml":[ "wizard/base_synchro_view.xml",
"base_synchro_view.xml",
"security/ir.model.access.csv",],
"active":False,
"installable":True,
}
+5 -1
View File
@@ -42,7 +42,7 @@ class base_synchro_server(osv.osv):
base_synchro_server()
class base_synchro_obj(osv.osv):
'''Class to store the operations done by wizart'''
'''Class to store the operations done by wizard'''
_name = "base.synchro.obj"
_description = "Register Class"
_columns = {
@@ -66,6 +66,10 @@ class base_synchro_obj(osv.osv):
#
# Return a list of changes: [ (date, id) ]
#
def get_ids(self, cr, uid, object, dt, domain=[], context={}):
return self._get_ids(cr, uid, object, dt, domain, context)
def _get_ids(self, cr, uid, object, dt, domain=[], context={}):
result = []
if dt:
+72 -10
View File
@@ -30,6 +30,37 @@
</field>
</record>
<record id="ir_filters_transfer_line_form" model="ir.ui.view">
<field name="name">base.synchro.obj.line.form</field>
<field name="model">base.synchro.obj.line</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Transfered Ids Details">
<group colspan="4" col="10">
<field name="name"/>
<field name="obj_id"/>
</group>
<newline/>
<group expand="0" string="Group By" colspan="4">
<filter string="Object" icon="terp-stage" domain="[]" context="{'group_by':'obj_id'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'name'}"/>
</group>
</search>
</field>
</record>
<!-- Filters action-->
<record id="actions_transfer_line_form" model="ir.actions.act_window">
<field name="name">Filters</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.synchro.obj.line</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_transfer_line_tree"/>
<field name="search_view_id" ref="ir_filters_transfer_line_form"/>
</record>
<record id="action_base_synchro_obj_line_tree" model="ir.actions.act_window">
<field name="name">Synchronized instances</field>
@@ -56,7 +87,7 @@
<field colspan="4" name="domain"/>
<field name="synchronize_date"/>
<newline/>
<field name="avoid_ids" colspan="4">
<field name="avoid_ids" colspan="4" nolabel="1">
<tree string="Fields" editable="bottom">
<field name="name"/>
</tree>
@@ -81,6 +112,37 @@
</field>
</record>
<record id="ir_filters_regclass_tree" model="ir.ui.view">
<field name="name">base.synchro.obj.line.form</field>
<field name="model">base.synchro.obj</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Synchronized objects">
<group colspan="4" col="10">
<field name="model_id"/>
<field name="synchronize_date"/>
</group>
<newline/>
<group expand="0" string="Group By" colspan="4">
<filter string="Object to synchronize" icon="terp-stage" domain="[]" context="{'group_by':'model_id'}"/>
<separator orientation="vertical"/>
<filter string="Latest synchronization" icon="terp-go-month" domain="[]" context="{'group_by':'synchronize_date'}"/>
</group>
</search>
</field>
</record>
<!-- Filters action-->
<record id="actions_regclass_tree" model="ir.actions.act_window">
<field name="name">Filters</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.synchro.obj</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_regclass_tree"/>
<field name="search_view_id" ref="ir_filters_regclass_tree"/>
</record>
<record id="action_transfer_tree" model="ir.actions.act_window">
<field name="name">Synchronized objects</field>
<field name="type">ir.actions.act_window</field>
@@ -115,15 +177,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Synchronized server">
<field name="name" select="1"/>
<newline/>
<field name="server_url" select="2"/>
<newline/>
<field name="server_port"/>
<field name="server_db"/>
<newline/>
<field name="login" select="1"/>
<field name="password"/>
<group colspan="4" col="6">
<field name="name"/>
<field name="login"/>
<field name="password" password="True"/>
<field name="server_url"/>
<field name="server_port"/>
<field name="server_db"/>
</group>
</form>
</field>
</record>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<wizard id="wizard_cost_account_synchro" model="account.analytic.account" name="account.analytic.account.transfer" string="Synchronize objects"/>
<menuitem id="next_id_62" name="Synchronization" parent="base.menu_administration"/><menuitem action="wizard_cost_account_synchro" id="menu_wizard_cost_account_synchro" parent="base_synchro.next_id_62" type="wizard"/>
</data>
</openerp>
@@ -0,0 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"base_synchro_server","base.synchro.server","model_base_synchro_server","base.group_system",1,1,1,1
" base_synchro_obj"," base.synchro.obj","model_base_synchro_obj","base.group_system",1,1,1,1
"base_synchro_obj_avoid","base.synchro.obj.avoid","model_base_synchro_obj_avoid","base.group_system",1,1,1,1
"base_synchro_obj_line","base.synchro.obj.line","model_base_synchro_obj_line","base.group_system",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 base_synchro_server base.synchro.server model_base_synchro_server base.group_system 1 1 1 1
3 base_synchro_obj base.synchro.obj model_base_synchro_obj base.group_system 1 1 1 1
4 base_synchro_obj_avoid base.synchro.obj.avoid model_base_synchro_obj_avoid base.group_system 1 1 1 1
5 base_synchro_obj_line base.synchro.obj.line model_base_synchro_obj_line base.group_system 1 1 1 1
+1
View File
@@ -19,4 +19,5 @@
#
##############################################################################
import base_synchro
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+63 -73
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
## -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import osv
from datetime import date
import time
@@ -27,26 +26,7 @@ import xmlrpclib
import re
import tools
import threading
acc_synchro_form = '''<?xml version="1.0"?>
<form string="Transfer Data To Server">
<field name="server_url" colspan="4"/>
<newline/>
<separator string="Control" colspan="4"/>
<field name="user_id"/>
<newline/>
</form>'''
acc_synchro_fields = {
'server_url': {'string':'Server URL', 'type':'many2one', 'relation':'base.synchro.server','required':True},
'user_id': {'string':'Send Result To', 'type':'many2one', 'relation':'res.users', 'default': lambda uid,data,state: uid},
}
finish_form ='''<?xml version="1.0"?>
<form string="Synchronization Complited!">
<label string="The synchronisation has been started.\nYou will receive a request when it's done." colspan="4"/>
</form>
'''
from osv import osv, fields
class RPCProxyOne(object):
def __init__(self, server, ressource):
@@ -66,13 +46,26 @@ class RPCProxy(object):
def get(self, ressource):
return RPCProxyOne(self.server, ressource)
class wizard_cost_account_synchro(wizard.interface):
class base_synchro(osv.osv_memory):
"""Base Synchronization """
_name = 'base.synchro'
_columns = {
'server_url': fields.many2one('base.synchro.server', "Server URL", required=True),
'user_id': fields.many2one('res.users', "Send Result To",),
}
_defaults = {
'user_id': lambda self,cr,uid,context: uid,
}
start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
report = []
report_total = 0
report_create = 0
report_write = 0
def _synchronize(self, cr, uid, server, object, context):
def synchronize(self, cr, uid, server, object, context):
pool = pooler.get_pool(cr.dbname)
self.meta = {}
ids = []
@@ -80,14 +73,14 @@ class wizard_cost_account_synchro(wizard.interface):
pool2 = pool
#try:
if object.action in ('d','b'):
ids = pool1.get('base.synchro.obj')._get_ids(cr, uid,
ids = pool1.get('base.synchro.obj').get_ids(cr, uid,
object.model_id.model,
object.synchronize_date,
eval(object.domain),
{'action':'d'}
)
if object.action in ('u','b'):
ids += pool2.get('base.synchro.obj')._get_ids(cr, uid,
ids += pool2.get('base.synchro.obj').get_ids(cr, uid,
object.model_id.model,
object.synchronize_date,
eval(object.domain),
@@ -109,7 +102,7 @@ class wizard_cost_account_synchro(wizard.interface):
if object.model_id.model=='crm.case.history':
fields = ['email','description','log_id']
value = pool_src.get(object.model_id.model).read(cr, uid, [id], fields)[0]
value = self._data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
id2 = self.get_id(cr, uid, object.id, id, action, context)
#
# Transform value
@@ -133,7 +126,7 @@ class wizard_cost_account_synchro(wizard.interface):
else:
print value
idnew = pool_dest.get(object.model_id.model).create(cr, uid, value)
synid = pool.get('base.synchro.obj.line').create(cr, uid, {
synid = self.pool.get('base.synchro.obj.line').create(cr, uid, {
'obj_id': object.id,
'local_id': (action=='u') and id or idnew,
'remote_id': (action=='d') and id or idnew
@@ -141,25 +134,20 @@ class wizard_cost_account_synchro(wizard.interface):
self.report_total+=1
self.report_create+=1
self.meta = {}
return 'finish'
return True
#
# IN: object and ID
# OUT: ID of the remote object computed:
# If object is synchronised, read the sync database
# Otherwise, use the name_search method
#
def get_id(self, cr, uid, object_id, id, action, context={}):
pool = pooler.get_pool(cr.dbname)
line_pool = pool.get('base.synchro.obj.line')
field_src = (action=='u') and 'local_id' or 'remote_id'
field_dest = (action=='d') and 'local_id' or 'remote_id'
rid = pool.get('base.synchro.obj.line').search(cr, uid, [('obj_id','=',object_id), (field_src,'=',id)], context=context)
rid = line_pool.search(cr, uid, [('obj_id','=',object_id), (field_src,'=',id)], context=context)
result = False
if rid:
result = pool.get('base.synchro.obj.line').read(cr, uid, rid, [field_dest], context=context)[0][field_dest]
result = line_pool.read(cr, uid, rid, [field_dest], context=context)[0][field_dest]
return result
def _relation_transform(self, cr, uid, pool_src, pool_dest, object, id, action, context={}):
def relation_transform(self, cr, uid, pool_src, pool_dest, object, id, action, context={}):
if not id:
return False
pool = pooler.get_pool(cr.dbname)
@@ -186,7 +174,14 @@ class wizard_cost_account_synchro(wizard.interface):
print self.report.append('WARNING: Record "%s" on relation %s not found, set to null.' % (names,object))
return result
def _data_transform(self, cr, uid, pool_src, pool_dest, object, data, action='u', context={}):
#
# IN: object and ID
# OUT: ID of the remote object computed:
# If object is synchronised, read the sync database
# Otherwise, use the name_search method
#
def data_transform(self, cr, uid, pool_src, pool_dest, object, data, action='u', context={}):
self.meta.setdefault(pool_src, {})
if not object in self.meta[pool_src]:
self.meta[pool_src][object] = pool_src.get(object).fields_get(cr, uid, context)
@@ -201,12 +196,12 @@ class wizard_cost_account_synchro(wizard.interface):
del data[f]
elif ftype == 'many2one':
if data[f]:
df = self._relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context)
df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context)
data[f] = df
if not data[f]:
del data[f]
elif ftype == 'many2many':
res = map(lambda x: self._relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], x, action, context), data[f])
res = map(lambda x: self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], x, action, context), data[f])
data[f] = [(6, 0, res)]
del data['id']
return data
@@ -215,21 +210,22 @@ class wizard_cost_account_synchro(wizard.interface):
# Find all objects that are created or modified after the synchronize_date
# Synchronize these obejcts
#
def _upload_download(self, db_name, uid, data, context):
cr = pooler.get_db(db_name).cursor()
def upload_download(self, cr, uid, ids, context):
start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
syn_obj = self.browse(cr, uid, ids)[0]
pool = pooler.get_pool(cr.dbname)
server = pool.get('base.synchro.server').browse(cr, uid, data['form']['server_url'], context)
server = pool.get('base.synchro.server').browse(cr, uid, ids, context)[0]
for object in server.obj_ids:
dt = time.strftime('%Y-%m-%d %H:%M:%S')
self._synchronize(cr, uid, server, object, context)
self.synchronize(cr, uid, server, object, context)
if object.action=='b':
time.sleep(1)
dt = time.strftime('%Y-%m-%d %H:%M:%S')
pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
cr.commit()
self.pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
if 'user_id' in data['form'] and data['form']['user_id']:
if 'user_id' in syn_obj.user_id:
request = pooler.get_pool(cr.dbname).get('res.request')
if not self.report:
self.report.append('No exception.')
@@ -248,32 +244,26 @@ Exceptions:
request.create(cr, uid, {
'name' : "Synchronization report",
'act_from' : uid,
'act_to' : data['form']['user_id'],
'act_to' : syn_obj.user_id,
'body': summary,
})
cr.commit()
cr.close()
return 'finish'
return True
def _upload_download_multi_thread(self, cr, uid, data, context):
threaded_synchronization = threading.Thread(target=self._upload_download, args=(cr.dbname, uid, data, context))
threaded_synchronization.start()
return 'finish'
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':acc_synchro_form, 'fields':acc_synchro_fields, 'state':[('end','Cancel'),('upload_download','Synchronize')]}
},
'upload_download': {
'actions': [],
'result':{'type':'choice', 'next_state': _upload_download_multi_thread}
},
'finish': {
'actions': [],
'result':{'type':'form', 'arch':finish_form,'fields':{},'state':[('end','Ok')]}
},
}
wizard_cost_account_synchro('account.analytic.account.transfer')
def upload_download_multi_thread(self, cr, uid, data, context):
threaded_synchronization = threading.Thread(target=self.upload_download, args=(cr, uid, data, context))
threaded_synchronization.run()
data_obj = self.pool.get('ir.model.data')
id2 = data_obj._get_id(cr, uid, 'base_synchro', 'view_base_synchro_finish')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
return {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'base.synchro',
'views': [(id2, 'form')],
'view_id': False,
'type': 'ir.actions.act_window',
'target': 'new',
}
base_synchro()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_base_synchro" model="ir.ui.view">
<field name="name">Base Synchronization</field>
<field name="model">base.synchro</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Transfer Data To Server">
<field name="server_url" colspan="4"/>
<field name="user_id" default="uid"/>
<newline/>
<separator string="" colspan="4"/>
<button special="cancel" string="_Close" icon="gtk-cancel"/>
<button name="upload_download_multi_thread" string="_Synchronize" type="object" icon="gtk-ok"/>
</form>
</field>
</record>
<record id="action_view_base_synchro" model="ir.actions.act_window">
<field name="name">Base Synchronization</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.synchro</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem id="next_id_62" name="Synchronization" parent="base.menu_administration"/>
<record id="view_base_synchro_finish" model="ir.ui.view">
<field name="name">Base Synchronization</field>
<field name="model">base.synchro</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Synchronization Complited!">
<label string="The synchronisation has been started.You will receive a request when it's done." colspan="4"/>
<separator string="" colspan="4"/>
<button special="cancel" string="OK" icon="gtk-ok"/>
</form>
</field>
</record>
<menuitem id="next_id_62" name="Synchronization" parent="base.menu_administration"/>
<menuitem parent="base_synchro.next_id_62" name="Synchronize objects"
action="action_view_base_synchro"
id="menu_action_view_base_synchro" />
</data>
</openerp>
+7 -16
View File
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="base.reporting_menu"
parent="base.menu_custom"
name="Reporting" sequence="30" />
<!--Board Note Search View -->
<record id="view_board_note_search" model="ir.ui.view">
<field name="name">board.note.search</field>
@@ -23,7 +20,7 @@
</search>
</field>
</record>
<!--Board Note Tree View -->
<record id="view_board_note_tree" model="ir.ui.view">
@@ -33,11 +30,11 @@
<field name="arch" type="xml">
<tree string="Notes">
<field name="name"/>
<field name="user_id"/>
<field name="user_id"/>
</tree>
</field>
</record>
<!--Board Note Form View -->
<record id="view_board_note_form" model="ir.ui.view">
@@ -113,7 +110,7 @@
</form>
</field>
</record>
<record id="view_board_search" model="ir.ui.view">
<field name="name">board.board.search</field>
<field name="model">board.board</field>
@@ -136,19 +133,13 @@
<field name="search_view_id" ref="view_board_search"/>
</record>
<menuitem
id="base.next_id_50"
name="Configuration"
parent="base.reporting_menu"
groups="base.group_system"
sequence="3"/>
<menuitem
action="action_view_board_list_form"
id="menu_view_board_form"
parent="base.next_id_50" sequence="1"/>
id="menu_view_board_form" parent="base.reporting_menu" sequence="1"/>
<menuitem action="action_view_board_note_form"
id="menu_view_board_note_form" parent="base.next_id_50"
id="menu_view_board_note_form"
parent="base.reporting_menu"
sequence="3" groups="base.group_system" />
<act_window context="{'view': active_id}" id="dashboard_open"
+10 -9
View File
@@ -61,10 +61,10 @@ def uid2openobjectid(cr, uidval, oomodel, rdate):
model_obj = pooler.get_pool(cr.dbname).get(model)
if (not model == oomodel) or (not dbname == cr.dbname):
return (False, None)
qry = 'select distinct(id) from %s' % model_obj._table
qry = 'SELECT DISTINCT(id) FROM %s' % model_obj._table
if rdate:
qry += " where recurrent_id='%s'" % (rdate)
cr.execute(qry)
qry += " WHERE recurrent_id=%s"
cr.execute(qry, (rdate,))
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
@@ -364,8 +364,8 @@ class CalDAV(object):
model_obj = self.pool.get(model)
r_ids = []
if model_obj._columns.get('recurrent_uid', None):
cr.execute('select id from %s where recurrent_uid=%s'
% (model_obj._table, data[map_field]))
cr.execute('SELECT id FROM %s WHERE recurrent_uid=%%s' % model_obj._table,
(data[map_field],))
r_ids = map(lambda x: x[0], cr.fetchall())
if r_ids:
r_datas = model_obj.read(cr, uid, r_ids, context=context)
@@ -715,8 +715,9 @@ class basic_calendar_line(osv.osv):
@param context: A standard dictionary for contextual values
"""
cr.execute("Select count(id) from basic_calendar_lines \
where name='%s' and calendar_id=%s" % (vals.get('name'), vals.get('calendar_id')))
cr.execute("SELECT COUNT(id) FROM basic_calendar_lines \
WHERE name='%s' AND calendar_id=%s",
(vals.get('name'), vals.get('calendar_id')))
res = cr.fetchone()
if res:
if res[0] > 0:
@@ -797,8 +798,8 @@ class basic_calendar_fields(osv.osv):
@param context: A standard dictionary for contextual values
"""
cr.execute('select name from basic_calendar_attributes \
where id=%s' % (vals.get('name')))
cr.execute('SELECT name FROM basic_calendar_attributes \
WHERE id=%s', (vals.get('name'),))
name = cr.fetchone()
name = name[0]
if name in ('valarm', 'attendee'):
+4 -4
View File
@@ -34,11 +34,11 @@ class calendar_collection(osv.osv):
def _get_root_calendar_directory(self, cr, uid, context=None):
objid = self.pool.get('ir.model.data')
try:
mid = objid._get_id(cr, uid, 'document', 'dir_calendars')
mid = objid._get_id(cr, uid, 'document', 'dir_calendars')
if not mid:
return False
root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
root_cal_dir = self.browse(cr, uid, root_id, context=context)
root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
root_cal_dir = self.browse(cr,uid, root_id, context=context)
return root_cal_dir.name
except Exception, e:
import netsvc
@@ -67,7 +67,7 @@ class calendar_collection(osv.osv):
], limit=1, context=context)
root_cal_dir = self._get_root_calendar_directory(cr, uid, context=context)
if not calendar_ids:
if not calendar_ids:
return root_cal_dir
calendar_id = calendar_ids[0]
calendar = calendar_obj.browse(cr, uid, calendar_id,
+81 -97
View File
@@ -145,53 +145,29 @@ class crm_case(object):
@param context: A standard dictionary for contextual values"""
if not context:
context = {}
s = self.get_stage_dict(cr, uid, ids, context=context)
section = self._name
stage = False
stage_pool = self.pool.get('crm.case.stage')
model = self._name
for case in self.browse(cr, uid, ids, context):
if section in s:
st = not context.get('force_domain', False) and case.stage_id.id or False
if st in s[section]:
data = {'stage_id': s[section][st]}
stage = s[section][st]
self.write(cr, uid, [case.id], data)
return stage
def get_stage_dict(self, cr, uid, ids, context=None):
"""This function gives dictionary for stage according to stage levels
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
if not context:
context = {}
stage_obj = self.pool.get('crm.case.stage')
res = self.read(cr, uid, ids, ['section_id', 'stage_id'], context)[0]
section_id = res['section_id'] and res['section_id'][0] or False
stage_id = res['stage_id'] and res['stage_id'][0] or False
# We select either the stages in the same section as the current stage
# if it a stage that does not have a section, or the stages of the
# current section of the case
if stage_id:
stage_record = stage_obj.browse(cr, uid, stage_id)
if not stage_record.section_id:
section_id = False # only select stages without section
domain = [('object_id.model', '=', self._name), '|', ('section_id', '=', section_id),('section_id','=',False)]
if 'force_domain' in context and context['force_domain']:
domain += context['force_domain']
sid = stage_obj.search(cr, uid, domain, context=context)
s = {}
previous = {}
section = self._name
for stage in stage_obj.browse(cr, uid, sid, context=context):
s.setdefault(section, {})
s[section][previous.get(section, False)] = stage.id
previous[section] = stage.id
return s
next_stage = False
data = {}
domain = [('object_id.model', '=', model)]
if case.section_id and case.section_id.stage_ids:
domain.append(('id', 'in', map(lambda x: x.id, case.section_id.stage_ids)))
stages = stage_pool.search(cr, uid, domain, order='sequence')
index = -1
if case.stage_id and case.stage_id.id in stages:
index = stages.index(case.stage_id.id)
if index + 1 == len(stages):
return False
else:
next_stage = stages[index + 1]
if next_stage:
data = {'stage_id': next_stage}
stage = stage_pool.browse(cr, uid, next_stage, context=context)
if stage.on_change:
data.update({'probability': stage.probability})
self.write(cr, uid, [case.id], data, context=context)
return next_stage
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
@@ -203,21 +179,28 @@ class crm_case(object):
@param context: A standard dictionary for contextual values"""
if not context:
context = {}
s = self.get_stage_dict(cr, uid, ids, context=context)
section = self._name
stage_pool = self.pool.get('crm.case.stage')
model = self._name
for case in self.browse(cr, uid, ids, context):
if section in s:
st = not context.get('force_domain', False) and case.stage_id.id or False
s[section] = dict([(v, k) for (k, v) in s[section].iteritems()])
if st in s[section]:
data = {'stage_id': s[section][st]}
if s[section][st]:
stage = stage_pool.browse(cr, uid, s[section][st], context=context)
if stage.on_change:
data.update({'probability': stage.probability})
self.write(cr, uid, [case.id], data)
prev_stage = False
data = {}
domain = [('object_id.model', '=', model)]
if case.section_id and case.section_id.stage_ids:
domain.append(('id', 'in', map(lambda x: x.id, case.section_id.stage_ids)))
stages = stage_pool.search(cr, uid, domain, order='sequence')
index = 0
if case.stage_id and case.stage_id.id in stages:
index = stages.index(case.stage_id.id)
if index == 0:
return False
else:
prev_stage = stages[index - 1]
if prev_stage:
data = {'stage_id': prev_stage}
stage = stage_pool.browse(cr, uid, prev_stage, context=context)
if stage.on_change:
data.update({'probability': stage.probability})
self.write(cr, uid, [case.id], data, context=context)
return True
def onchange_partner_id(self, cr, uid, ids, part, email=False):
@@ -492,6 +475,43 @@ class crm_case(object):
return res
class crm_case_stage(osv.osv):
""" Stage of case """
_name = "crm.case.stage"
_description = "Stage of case"
_rec_name = 'name'
_order = "sequence"
_columns = {
'name': fields.char('Stage Name', size=64, required=True, translate=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."),
'object_id': fields.many2one('ir.model', 'Object Name'),
'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"),
'on_change': fields.boolean('Change Probability Automatically', \
help="Change Probability on next and previous stages."),
'requirements': fields.text('Requirements')
}
def _find_object_id(self, cr, uid, context=None):
"""Finds id for case object
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values
"""
object_id = context and context.get('object_id', False) or False
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
return ids and ids[0]
_defaults = {
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
'object_id' : _find_object_id
}
crm_case_stage()
class crm_case_section(osv.osv):
"""Sales Team"""
@@ -517,7 +537,8 @@ class crm_case_section(osv.osv):
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'),
'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"),
'note': fields.text('Description'),
'working_hours': fields.float('Working Hours', digits=(16,2 )),
'working_hours': fields.float('Working Hours', digits=(16,2 )),
'stage_ids':fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
}
_defaults = {
@@ -619,43 +640,6 @@ class crm_case_resource_type(osv.osv):
crm_case_resource_type()
class crm_case_stage(osv.osv):
""" Stage of case """
_name = "crm.case.stage"
_description = "Stage of case"
_rec_name = 'name'
_order = "sequence"
_columns = {
'name': fields.char('Stage Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."),
'object_id': fields.many2one('ir.model', 'Object Name'),
'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"),
'on_change': fields.boolean('Change Probability Automatically', \
help="Change Probability on next and previous stages."),
'requirements': fields.text('Requirements')
}
def _find_object_id(self, cr, uid, context=None):
"""Finds id for case object
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values
"""
object_id = context and context.get('object_id', False) or False
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
return ids and ids[0]
_defaults = {
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
'object_id' : _find_object_id
}
crm_case_stage()
def _links_get(self, cr, uid, context=None):
"""Gets links value for reference field
@param self: The object pointer
+2 -2
View File
@@ -126,8 +126,8 @@ class crm_lead(crm_case, osv.osv):
'contact_name': fields.char('Contact Name', size=64),
'partner_name': fields.char("Partner Name", size=64),
'optin': fields.boolean('Opt-In'),
'optout': fields.boolean('Opt-Out'),
'optin': fields.boolean('Opt-In', help="If opt-in is checked, this contact has accepted to receive emails."),
'optout': fields.boolean('Opt-Out', help="If opt-out is checked, this contact has refused to receive emails or unsubscribed to a campaign."),
'type':fields.selection([
('lead','Lead'),
('opportunity','Opportunity'),
+6 -6
View File
@@ -8,7 +8,6 @@
<field name="name">New</field>
<field eval="'10'" name="probability"/>
<field eval="'1'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
@@ -16,7 +15,6 @@
<field name="name">Qualification</field>
<field eval="'20'" name="probability"/>
<field eval="'2'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
@@ -24,7 +22,6 @@
<field name="name">Proposition</field>
<field eval="'40'" name="probability"/>
<field eval="'3'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
@@ -32,7 +29,6 @@
<field name="name">Negotiation</field>
<field eval="'60'" name="probability"/>
<field eval="'4'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
@@ -40,7 +36,6 @@
<field name="name">Win</field>
<field eval="'100'" name="probability"/>
<field eval="'5'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
@@ -48,10 +43,15 @@
<field name="name">Lost</field>
<field eval="'0'" name="probability"/>
<field eval="'6'" name="sequence"/>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.section" id="section_sales_department">
<field name="name">Sales Department</field>
<field name="code">Sales</field>
<field name="stage_ids" eval="[(4, ref('stage_lead1')), (4, ref('stage_lead2')), (4, ref('stage_lead3')), (4, ref('stage_lead4')), (4, ref('stage_lead5')), (4, ref('stage_lead6'))]"/>
</record>
<!-- CASE CATEGORY2(category2_id) -->
<record model="crm.case.resource.type" id="type_lead1">
<field name="name">Telesales</field>
+1 -2
View File
@@ -8,9 +8,8 @@
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field>
<field name="view_id" ref="crm_case_tree_view_leads"/>
<field name="context">{"search_default_user_id":uid,'search_default_current':1}</field>
<field name="search_view_id" ref="crm.view_crm_case_leads_filter"/>
<field name="context">{'search_default_current':1, 'default_type': 'lead', 'search_default_section_id':section_id}</field>
<field name="context">{'search_default_current':1, 'default_type': 'lead', 'search_default_section_id': section_id}</field>
<field name="help">A lead is a first, unqualified, contact with a new prospect. Use leads when you import a database of prospects or integrate your website's contact form with OpenERP. After having been qualified, the lead can be converted to a partner and a business opportunity for a further detailed tracking of the related activities.</field>
</record>
+9 -10
View File
@@ -55,8 +55,7 @@
<newline />
<field name="section_id" widget="selection" />
<field name="user_id" />
<field name="stage_id"
domain="[('section_id','=',section_id), ('section_id','=',False), ('object_id.model', '=', 'crm.lead')]" />
<field name="stage_id" readonly="1"/>
<group col="2" colspan="1">
<button name="stage_previous" string="Previous"
states="open,pending,draft" type="object"
@@ -235,7 +234,7 @@
<field name="referred" invisible="1"/>
<field name="channel_id" invisible="1"/>
<field name="stage_id" />
<field name="stage_id" readonly="1"/>
<button name="stage_previous" string="Previous Stage"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next Stage"
@@ -318,7 +317,7 @@
context="{'invisible_section': False}">
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My Sales Team(s)"/>
<filter icon="terp-personal+"
context="{'invisible_section': False}"
@@ -342,8 +341,9 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
<separator orientation="vertical"/>
<filter string="Category" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'categ_id'}"/>
<filter string="Campaign" icon="terp-stock_symbol-selection"
@@ -351,11 +351,10 @@
<filter string="Channel" icon="terp-stock_symbol-selection"
domain="[]" context="{'group_by':'channel_id'}" />
<separator orientation="vertical"/>
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Creation Month" icon="terp-go-month"
<filter string="Creation" help="Create date" icon="terp-go-month"
domain="[]" context="{'group_by':'create_date'}" />
</group>
</search>
+1 -1
View File
@@ -49,7 +49,7 @@
<field name="res_model">crm.meeting</field>
<field name="view_mode">calendar,tree,form,gantt</field>
<field name="view_id" ref="crm_case_calendar_view_meet"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="view_crm_case_meetings_filter"/>
<field name="help">The calendar of meetings is shared between sales teams and fully integrated with the others applications like the employee holidays. You can also synchronize meetings with your mobile phone using the caldav interface.</field>
</record>
+1 -1
View File
@@ -312,7 +312,7 @@
<field name="partner_id" select="1" />
<field name="section_id" select="1" widget="selection">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My Sales Team(s)" />
</field>
<field name="user_id" select="1"/>
+5 -4
View File
@@ -14,8 +14,9 @@
<label string="Stage:" align="1.0"/>
<group colspan="1" col="4">
<field name="stage_id" nolabel="1"
on_change="onchange_stage_id(stage_id)"
domain="['|',('section_id','=',section_id),('section_id','=',False),('object_id.model', '=', 'crm.lead')]" />
on_change="onchange_stage_id(stage_id)"
domain="[('object_id.model', '=', 'crm.lead')]"
readonly="1" />
<button name="stage_previous"
states="open,pending" type="object"
icon="gtk-go-back" string="" />
@@ -211,7 +212,7 @@
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
<tree string="Opportunities" colors="blue:state=='pending' and not(date_deadline and (date_deadline &lt; current_date));gray:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Opportunity"/>
@@ -302,7 +303,7 @@
context="{'invisible_section': False}"
widget="selection">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
context="{'invisible_section': False}"
help="My Sales Team(s)" />
<filter icon="terp-personal+"
-3
View File
@@ -61,9 +61,6 @@ class crm_phonecall(crm_case, osv.osv):
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'stage_id': fields.many2one('crm.case.stage', 'Stage', \
domain="['|',('section_id','=',section_id),('section_id','=',False),\
('object_id.model', '=', 'crm.phonecall')]"),
'date_open': fields.datetime('Opened', readonly=True),
# phonecall fields
'duration': fields.float('Duration', help="Duration in Minutes"),
-18
View File
@@ -16,23 +16,5 @@
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<!--
Case Stage
-->
<record model="crm.case.stage" id="stage_phone1">
<field name="name">Planned</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_phone2">
<field name="name">Held</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_phone3">
<field name="name">Not Held</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
</data>
</openerp>
-6
View File
@@ -16,7 +16,6 @@
<field eval="&quot;(726) 782-0636&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_phone1"/>
<field name="stage_id" ref="crm.stage_phone1"/>
<field eval="&quot;(769) 703-274&quot;" name="partner_phone"/>
<field eval="2.3" name="duration"/>
</record>
@@ -32,7 +31,6 @@
<field eval="&quot;(392) 895-7917&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_phone1"/>
<field name="stage_id" ref="crm.stage_phone2"/>
<field eval="&quot;(956) 293-2595&quot;" name="partner_phone"/>
<field eval="1.5" name="duration"/>
</record>
@@ -48,7 +46,6 @@
<field eval="&quot;(820) 167-3208&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_phone1"/>
<field name="stage_id" ref="crm.stage_phone3"/>
<field eval="&quot;(079) 681-2139&quot;" name="partner_phone"/>
<field eval="&quot;contact@tecsas.fr&quot;" name="email_from"/>
<field eval="5.0" name="duration"/>
@@ -64,7 +61,6 @@
<field eval="&quot;(077) 582-4035&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_phone2"/>
<field name="stage_id" ref="crm.stage_phone1"/>
<field eval="&quot;(514) 698-4118&quot;" name="partner_phone"/>
<field eval="3.45" name="duration"/>
</record>
@@ -80,7 +76,6 @@
<field eval="&quot;(333) 715-1450&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_phone2"/>
<field name="stage_id" ref="crm.stage_phone2"/>
<field eval="&quot;(855) 924-4364&quot;" name="partner_phone"/>
<field eval="2.08" name="duration"/>
</record>
@@ -96,7 +91,6 @@
<field eval="&quot;(468) 017-2684&quot;" name="partner_mobile"/>
<field eval="time.strftime('%Y-%m-28 14:15:30')" name="date"/>
<field name="categ_id" ref="crm.categ_phone2"/>
<field name="stage_id" ref="crm.stage_phone3"/>
<field eval="&quot;(373) 907-1009&quot;" name="partner_phone"/>
<field eval="&quot;info@opensides.be&quot;" name="email_from"/>
<field eval="8.56" name="duration"/>
+2 -2
View File
@@ -31,7 +31,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="crm_case_phone_tree_view"/>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id':section_id}</field>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
</record>
@@ -67,7 +67,7 @@
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="crm_case_phone_tree_view"/>
<field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone1'))+')]'"/>
<field name="context" eval="'{\'set_editable\':True,\'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1, \'default_categ_id\': ' + str(ref('categ_phone1')) +'}'"/>
<field name="context" eval="'{\'search_default_section_id\':section_id, \'set_editable\':True,\'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1, \'default_categ_id\': ' + str(ref('categ_phone1')) +'}'"/>
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
<field name="help">Trace easily all your Inbound calls. The Inbound menu open a search view in editable mode, so you can easily modify or add a new call record. With the actions buttons convert a lead into an opportunity or plan a meeting.</field>
+5 -5
View File
@@ -71,7 +71,7 @@
attrs="{'invisible':[('opportunity_id','!=',False)]}" />
<label colspan="6" string=""/>
<button string="Schedule Other Call"
icon="gtk-redo"
icon="terp-call-start"
name="%(phonecall_to_phonecall_act)d"
type="action" />
@@ -150,7 +150,7 @@
attrs="{'invisible':[('opportunity_id','!=',False)]}" />
<label colspan="6" string=""/>
<button string="Schedule Other Call"
icon="gtk-redo"
icon="terp-call-start"
name="%(phonecall_to_phonecall_act)d"
type="action" />
@@ -250,8 +250,8 @@
name="current"
domain="[('state','in', ('draft','open','pending'))]"/>
<filter icon="terp-go-today" string="Today"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),\
('date','&gt;=',datetime.strftime('%%Y-%%m-%%d 00:00:00'))]"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
name="today"
help="Todays's Phonecalls"
/>
@@ -272,7 +272,7 @@
<field name="section_id"
select="1" widget="selection" string="Sales Team">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My Sales Team(s)" />
</field>
<newline/>
+4 -3
View File
@@ -48,6 +48,10 @@
<separator string="Team Members" colspan="4"/>
<field name="member_ids" nolabel="1" colspan="4"/>
</page>
<page string="Stages">
<separator string="Select stages for this Sales Team" colspan="4"/>
<field name="stage_ids" colspan="4" nolabel="1"/>
</page>
<page string="Notes">
<field name="note" select="1" colspan="4" nolabel="1"/>
</page>
@@ -97,8 +101,6 @@
<field name="sequence"/>
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
@@ -113,7 +115,6 @@
<form string="Stage">
<separator string="Stage Definition" colspan="4"/>
<field name="name" select="1"/>
<field name="section_id" select="1"/>
<field name="object_id" invisible="1" />
<field name="sequence"/>
<field name="probability"/>
+2 -2
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2010-01-05 05:59+0000\n"
"PO-Revision-Date: 2010-09-30 08:13+0000\n"
"PO-Revision-Date: 2010-10-01 11:57+0000\n"
"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Launchpad-Export-Date: 2010-10-02 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
+1 -3
View File
@@ -101,9 +101,7 @@ class crm_lead_report(osv.osv):
'probable_revenue': fields.float('Probable Revenue', digits=(16,2),readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="['|',('section_id','=',False),('section_id','=',section_id)]" , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]", readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', readonly=True, domain="('object_id.model', '=', 'crm.lead')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
+7 -9
View File
@@ -99,13 +99,13 @@
<field name="section_id"
default="context.get('section_id', False)"
context="{'invisible_section': False}">
<filter icon="terp-crm"
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="[('section_id.user_id','=',uid)]"
help="My team" />
</field>
<field name="user_id" string="Salesman">
<filter icon="terp-personal+" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
@@ -125,14 +125,16 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="user" icon="terp-personal"
<filter string="Salesman" name="user" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}" />
<filter string="Sales Team" icon="terp-personal+"
domain="[]"
context="{'group_by':'section_id'}" />
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}" />
<filter string="Country" icon="terp-go-home" context="{'group_by':'country_id'}" />
<separator orientation="vertical" />
<filter string="Company" icon="terp-go-home"
domain="[]"
context="{'group_by':'company_id'}" />
<separator orientation="vertical" />
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
@@ -146,10 +148,6 @@
<filter string="State" icon="terp-stock_effects-object-colorize"
domain="[]" context="{'group_by':'state'}" />
<separator orientation="vertical" />
<filter string="Company" icon="terp-go-home"
domain="[]"
context="{'group_by':'company_id'}" />
<separator orientation="vertical" />
<filter string="Day" icon="terp-go-today"
domain="[]" context="{'group_by':'day'}" help="Day on which lead/opportunity is created"/>
<filter string="Month" icon="terp-go-month"
@@ -100,9 +100,6 @@ class crm_phonecall_report(osv.osv):
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]", readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
@@ -130,7 +127,6 @@ class crm_phonecall_report(osv.osv):
c.section_id,
c.categ_id,
c.partner_id,
c.stage_id,
c.duration,
c.company_id,
c.priority,
@@ -14,7 +14,6 @@
<field name="month" invisible="1"/>
<field name="section_id" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
@@ -92,14 +91,14 @@
string="Todo"
domain="[('state','in',('draft','open'))]"
help="Phone calls which are in draft and open state"/>
<filter icon="gtk-media-pause"
string="Not Held"
domain="[('state','=','pending')]"
help="Phone calls which are in pending state"/>
<filter icon="terp-camera_test"
string="Held"
domain="[('state','=','done')]"
help="Phone calls which are in closed state"/>
<filter icon="gtk-media-pause"
string="Not Held"
domain="[('state','=','pending')]"
help="Phone calls which are in pending state"/>
<separator orientation="vertical" />
<field name="section_id" string="Sales Team"
default="context.get('section_id', False)"
@@ -110,15 +109,15 @@
help="My team" />
</field>
<field name="user_id" string="Salesman" select="1">
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="partner_id"/>
<separator orientation="vertical"/>
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<field name="categ_id" widget="selection" string="Type"
domain="[('object_id.model', '=', 'crm.phonecall')]" />
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
@@ -128,19 +127,16 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal"
<filter string="Salesman" name="Salesman" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}" />
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<separator orientation="vertical" />
<filter string="Sales Team" icon="terp-personal+"
domain="[]"
context="{'group_by':'section_id'}" />
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}" />
<separator orientation="vertical" />
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
<filter string="Type" icon="terp-stock_symbol-selection"
domain="[]" context="{'group_by':'categ_id'}" />
<separator orientation="vertical" />
<filter string="State" icon="terp-stock_effects-object-colorize"
domain="[]" context="{'group_by':'state'}" />
<separator orientation="vertical" />
+11
View File
@@ -10,6 +10,17 @@
<field name="name">Sales / User</field>
</record>
<record id="base.group_sale_salesman_personal" context="{'noadmin':True}" model="res.groups">
<field name="name">Sales / User / See Personal Leads</field>
</record>
<record id="crm_rule_personal_lead" model="ir.rule">
<field name="name">Personal Leads</field>
<field ref="model_crm_lead" name="model_id"/>
<field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field name="groups" eval="[(4, ref('base.group_sale_salesman_personal'))]"/>
</record>
<record model='ir.ui.menu' id='base.menu_base_partner'>
<field name="groups_id" eval="[(4,ref('base.group_sale_manager')),(4,ref('base.group_sale_salesman'))]"/>
</record>
+8 -2
View File
@@ -57,6 +57,7 @@ class crm_send_new_email(osv.osv_memory):
'body': fields.text('Message Body', required=True),
'state': fields.selection(AVAILABLE_STATES, string='Set New State To', required=True),
'attachment_ids' : fields.one2many('crm.send.mail.attachment', 'wizard_id'),
'html': fields.boolean('HTML formatting?', help="Select this if you want to send email with HTML formatting."),
}
def action_send(self, cr, uid, ids, context=None):
@@ -79,6 +80,7 @@ class crm_send_new_email(osv.osv_memory):
(x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids
]
subtype = 'plain'
message_id = None
ref_id = None
@@ -119,6 +121,9 @@ class crm_send_new_email(osv.osv_memory):
if message_id:
x_headers['References'] = "%s" % (message_id)
if obj.html:
subtype = 'html'
flag = tools.email_send(
email_from,
emails,
@@ -126,13 +131,14 @@ class crm_send_new_email(osv.osv_memory):
body,
email_cc=email_cc,
attach=attach,
subtype=subtype,
reply_to=obj.reply_to,
openobject_id=str(case.id),
x_headers=x_headers
)
# if not flag:
# raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
if not flag:
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'}
case_pool.history(cr, uid, [case], _(msg_dict[context.get('mail', 'new')]), history=True, \
@@ -16,6 +16,7 @@
<field name="email_to" />
<field name="email_cc"/>
<field name="subject"/>
<field name="html"/>
</group>
<notebook colspan="6">
<page string="Message">
+1 -1
View File
@@ -70,7 +70,7 @@ class crm_claim(crm.crm_case, osv.osv):
'partner_name': fields.char("Employee's Name", size=64),
'partner_mobile': fields.char('Mobile', size=32),
'partner_phone': fields.char('Phone', size=32),
'stage_id': fields.many2one ('crm.case.stage', 'Stage'),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="('object_id.model', '=', 'crm.claim')]"),
'probability': fields.float('Probability (%)'),
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
+6 -1
View File
@@ -71,6 +71,11 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.case.section" id="crm.section_sales_department">
<field name="name">Sales Department</field>
<field name="code">Sales</field>
<field name="stage_ids" eval="[(4, ref('stage_claim1')), (4, ref('stage_claim2')), (4, ref('stage_claim3')), (4, ref('stage_claim4')), (4, ref('stage_claim5'))]"/>
</record>
</data>
</openerp>
+1 -1
View File
@@ -14,7 +14,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,calendar,form,graph</field>
<field name="view_id" ref="crm_case_claims_tree_view"/>
<field name="context">{"search_default_section_id":section_id,"search_default_current":1,"search_default_user_id":uid}</field>
<field name="context">{'search_default_section_id': section_id, "search_default_current":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="crm_claim.view_crm_case_claims_filter"/>
<field name="help">Record and trace your customers' claims here. A claim is defined by a client name, several types, a status and a priority level. A claim can also be a preventive or repairing action. A claim can be linked to a reference like a sales order, or a lot. You can send emails with attachments and get the history of the claim treatment (emails send, interventions type, etc.). </field>
</record>
+8 -4
View File
@@ -42,7 +42,7 @@
<field name="model">crm.claim</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Claims" colors="blue:state=='pending';black:state=='open';gray:state in ('close', 'cancel');red:date_deadline and (date_deadline &lt; current_date)">
<tree string="Claims" colors="blue:state=='pending' and not(date_deadline and (date_deadline &lt; current_date));gray:state in ('close', 'cancel');red:date_deadline and (date_deadline &lt; current_date)">
<field name="name"/>
<field name="partner_id"/>
<field name="user_id" />
@@ -109,9 +109,9 @@
<field name="section_id" widget="selection"/>
<label string="Stage: " align="1.0"/>
<group colspan="1" col="3">
<field name="stage_id" nolabel="1"
<field name="stage_id" nolabel="1" readonly="1"
on_change="onchange_stage_id(stage_id)"
domain="[('section_id','=',section_id), ('object_id.model', '=', 'crm.claim')]" />
domain="[('object_id.model', '=', 'crm.claim')]" />
<button name="stage_previous" string="" type="object" icon="gtk-go-back" />
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
@@ -274,7 +274,11 @@
help="Unassigned Claims" />
</field>
<field name="section_id" select="1"
widget="selection"/>
widget="selection">
<filter icon="terp-personal+"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My section" />
</field>
<newline/>
<group expand="0" string="Group By...">
<filter string="Partner" icon="terp-partner"
+1 -3
View File
@@ -62,9 +62,7 @@ class crm_claim_report(osv.osv):
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]", readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]", readonly=True),
@@ -101,7 +101,7 @@
domain="[('state','=','pending')]"/>
<separator orientation="vertical" />
<field name="section_id" string="Sales Team"
<field name="section_id" string="Sales Team"
default="context.get('section_id', False)"
context="{'invisible_section': False}">
@@ -118,9 +118,9 @@
help="My company"/>
</field>
<field name="user_id" string="Salesman" select="1">
<filter icon="terp-personal+" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
</field>
<field name="user_id" string="Salesman" select="1">
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
@@ -141,7 +141,7 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal"
<filter string="Salesman" name="Salesman" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}" />
<filter string="Sales Team" icon="terp-personal+"
domain="[]"
+1 -3
View File
@@ -61,9 +61,7 @@ class crm_fundraising(crm.crm_case, osv.osv):
'partner_name2': fields.char('Employee Email', size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.fundraising')]"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="('object_id.model', '=', 'crm.fundraising')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \
domain="[('section_id','=',section_id)]"),
'duration': fields.float('Duration'),
@@ -13,7 +13,7 @@
<field name="res_model">crm.fundraising</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_fundraising.crm_case_tree_view_fund"/>
<field name="context">{"search_default_user_id":uid,"search_default_current":1}</field>
<field name="context">{"search_default_user_id":uid,"search_default_current":1, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="crm_fundraising.view_crm_case_fund_filter"/>
<field name="help">When you wish to support your organization or a campaign, trace here all your activities for collecting money. The menu open a search list where you can find funds description, email, history, probability of success. Several actions buttons allows you to easily modify your different fund status.</field>
</record>
@@ -89,7 +89,7 @@
<field name="user_id" string="Responsible"/>
<field name="date"/>
<field name="categ_id" select="1" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
<field name="type_id" string="Payment Mode" select="1" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
<field name="type_id" string="Payment Mode" select="1" widget="selection"/>
</group>
<notebook colspan="4">
<page string="Funds">
@@ -274,7 +274,7 @@
</field>
<field name="section_id" select="1" widget="selection" string="Sales Team">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My section" />
</field>
</group>
@@ -118,7 +118,7 @@
</field>
<field name="user_id" select="1" string="Salesman">
<filter icon="terp-personal+" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
@@ -138,7 +138,7 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal"
<filter string="Salesman" name="Salesman" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}" />
<filter string="Sales Team" icon="terp-personal+"
+1 -1
View File
@@ -11,7 +11,7 @@
<field name="res_model">crm.helpdesk</field>
<field name="view_mode">tree,calendar,form</field>
<field name="view_id" ref="crm_case_tree_view_helpdesk"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="view_crm_case_helpdesk_filter"/>
<field name="help">Alike records and processing of claims, Helpdesk and Support is a good tool to trace your interventions. This menu is more adapted to an oral communication, which is not necessarily related to a claim. Select a customer, add notes and categorize your interventions with a channel and a priority level.</field>
</record>
+1 -1
View File
@@ -249,7 +249,7 @@
<field name="user_id" select="1" widget="selection"/>
<field name="section_id" select="1" widget="selection" string="Sales Team">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My section" />
</field>
<newline/>
@@ -114,23 +114,24 @@
help="My company"/>
</field>
<field name="user_id" string="Salesman">
<filter icon="terp-personal+" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<filter string="Priority" icon="terp-rating-rated"
domain="[]" context="{'group_by':'priority'}" />
<field name="priority" string="Priority"/>
<field name="categ_id"/>
<field name="date_closed" string="Close Date"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" icon="terp-personal"
<filter string="Salesman" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}"
default="1" />
<filter string="Sales Team" icon="terp-personal+"
domain="[]"
context="{'group_by':'section_id'}" />
<filter string="Partner" icon="terp-personal"
<filter string="Partner" icon="terp-partner"
domain="[]"
context="{'group_by':'partner_id'}" />
@@ -63,9 +63,7 @@ class crm_lead_report_assign(osv.osv):
'probable_revenue': fields.float('Probable Revenue', digits=(16,2),readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id)]" , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]", readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="('object_id.model', '=', 'crm.lead')]"),
'partner_id': fields.many2one('res.partner', 'Customer' , readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
@@ -45,7 +45,7 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="user" icon="terp-personal"
<filter string="Salesman" name="user" icon="terp-personal"
domain="[]" context="{'group_by':'user_id'}" />
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_assigned_id'}" />
<filter string="Country" icon="terp-go-home" context="{'group_by':'country_id'}" />
@@ -24,7 +24,7 @@
</field>
</record>
<record model="ir.actions.act_window" id="action_decimal_precision_form">
<field name="name">Decimal Accuracy Definitions</field>
<field name="name">Decimal Accuracy</field>
<field name="res_model">decimal.precision</field>
</record>
<menuitem
File diff suppressed because it is too large Load Diff
+1 -10
View File
@@ -58,14 +58,6 @@
</search>
</field>
</record>
<record id="open_module_tree_department_tree" model="ir.actions.act_window">
<field name="name">Departments</field>
<field name="res_model">hr.department</field>
<field name="view_type">tree</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="search_view_id" ref="view_department_filter"/>
</record>
<menuitem action="open_module_tree_department_tree" id="menu_department_tree" parent="base.menu_users"/>
<record id="open_module_tree_department" model="ir.actions.act_window">
<field name="name">Departments</field>
@@ -75,10 +67,9 @@
<field name="help">Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc.</field>
</record>
<menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6"/>
<record model="ir.ui.view" id="view_users_form_inherit">
<record model="ir.ui.view" id="view_users_form_inherit">
<field name="name">res.users.form</field>
<field name="type">form</field>
<field name="model">res.users</field>
@@ -9,11 +9,11 @@
<field eval="time.strftime('%Y-%m-%d', time.localtime(time.mktime(time.localtime()[0:2] + (0,)*7)-1))" name="date_to"/>
</record>
<record id="sheet1" model="hr_timesheet_sheet.sheet">
<!-- record id="sheet1" model="hr_timesheet_sheet.sheet">
<field name="name">Sheet 1</field>
<field name="user_id" ref="base.user_root"/>
<field eval="time.strftime('%Y-%m-%d')" name="date_current"/>
</record>
</record-->
</data>
</openerp>
+1
View File
@@ -34,6 +34,7 @@
"mail_gateway_view.xml",
"res_partner_view.xml",
'security/ir.model.access.csv'
],
'demo_xml': [],
'installable': True,
+46
View File
@@ -179,6 +179,50 @@ class mailgate_message(osv.osv):
'''
Mailgateway Message
'''
def open_document(self, cr, uid, ids, context):
""" To Open Document
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: the ID of messages
@param context: A standard dictionary
"""
action_data = False
if ids:
message_id = ids[0]
mailgate_data = self.browse(cr, uid, message_id)
model = mailgate_data.model
res_id = mailgate_data.res_id
action_pool = self.pool.get('ir.actions.act_window')
action_ids = action_pool.search(cr, uid, [('res_model', '=', model)])
if action_ids:
action_data = action_pool.read(cr, uid, action_ids[0], context=context)
action_data.update({
'res_id': res_id,
'nodestroy': True
})
return action_data
def open_attachment(self, cr, uid, ids, context):
""" To Open attachments
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: the ID of messages
@param context: A standard dictionary
"""
action_data = False
action_pool = self.pool.get('ir.actions.act_window')
action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')])
if action_ids:
action_data = action_pool.read(cr, uid, action_ids[0], context=context)
action_data.update({
'domain': [('res_id','in',ids),('res_model','=',self._name)],
'nodestroy': True
})
return action_data
def truncate_data(self, cr, uid, data, context=None):
data_list = data and data.split('\n') or []
if len(data_list) > 3:
@@ -547,3 +591,5 @@ class mailgate_tool(osv.osv_memory):
return res
mailgate_tool()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+18 -9
View File
@@ -2,11 +2,11 @@
<openerp>
<data>
<record model="ir.ui.view" id="view_mailgate_message_form">
<field name="name">mailgate.message.form</field>
<field name="name">mailgate.message.form</field>
<field name="model">mailgate.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="mailgate message">
<form string="mailgate message">
<group colspan="4" col="6">
<field name="name" string="Subject" required="1" select="1" widget="char" size="512"/>
<field name="date" required="1" select="1"/>
@@ -24,10 +24,13 @@
</group>
<group col="2" colspan="2">
<separator string="Message Details" colspan="4"/>
<field name="model" readonly="1"/>
<field name="model" readonly="1"/>
<group col="3" colspan="2">
<field name="res_id" readonly="1"/>
<field name="message_id" />
<field name="ref_id" />
<button name="open_document" string="Open Document" type="object" icon="gtk-jump-to"/>
</group>
<field name="message_id" />
<field name="ref_id" />
</group>
<separator string="Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4" />
@@ -53,6 +56,8 @@
<field name="user_id" string="Owner"/>
<field name="message_id" string="Message" invisible="1"/>
<field name="partner_id" invisible="1"/>
<button name="open_document" string="Open Document" type="object" icon="gtk-jump-to"/>
<button name="open_attachment" string="Open Attachments" type="object" icon="gtk-jump-to"/>
</tree>
</field>
</record>
@@ -66,12 +71,12 @@
<field name="name" string="Subject"/>
<field name="date" />
<field name="user_id" string="Owner" default="uid"/>
<field name="description" />
<field name="partner_id" string="Partner Name"/>
<newline/>
<group expand="0" string="Group By..." groups="base.group_extended">
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Owner" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Owner" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Thread" icon="terp-mail-" domain="[]" context="{'group_by':'message_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" help="Creation Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
@@ -191,7 +196,6 @@
view_id="view_mailgate_message_tree"
/>
<menuitem name="Emails" id="menu_base_config_mail"
parent="base.menu_base_partner" sequence="5" />
@@ -201,6 +205,11 @@
action="mail_gateway.action_view_mailgate_message"
/>
<act_window
id="act_res_partner_open_email" name="Attachments"
res_model="ir.attachment"
src_model="mailgate.message"
domain="[('res_id', '=', res_id),('res_model','=',model)]"/>
</data>
</openerp>
+8 -26
View File
@@ -232,14 +232,6 @@
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_20"/>
</record>
<record id="mrp_bom_8" model="mrp.bom">
<field name="name">HDD Seagate</field>
<field name="sequence">26</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
<field model="product.product" name="product_id" ref="product.product_product_hdd1"/>
</record>
<record id="mrp_bom_9" model="mrp.bom">
<field name="name">Assembly Basic PC</field>
<field name="sequence">29</field>
@@ -563,6 +555,14 @@
<!--
Resource: mrp.bom new EVV
-->
<record id="mrp_bom_defaultbomforshelfofcm0" model="mrp.bom">
<field name="name">Default BOM for Shelf of 100cm</field>
<field name="code">SHE100</field>
<field name="sequence">129</field>
<field name="product_id" ref="product.product_product_shelfofcm0"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
</record>
<record id="mrp_bom_assemblysection0" model="mrp.bom">
<field name="name">Assembly Section</field>
@@ -591,15 +591,6 @@
<field model="mrp.bom" name="bom_id" search="[('name', '=', u'Default BOM for Shelf of 100cm')]"/>
</record>
<record id="mrp_bom_defaultbomforshelfofcm0" model="mrp.bom">
<field name="name">Default BOM for Shelf of 100cm</field>
<field name="code">SHE100</field>
<field name="sequence">129</field>
<field name="product_id" ref="product.product_product_shelfofcm0"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
</record>
<record id="mrp_bom_rearpanelarm0" model="mrp.bom">
<field name="sequence">131</field>
<field name="product_id" ref="product.product_product_rearpanelarm0"/>
@@ -647,15 +638,6 @@
<field name="type">phantom</field>
</record>
<record id="mrp_bom_rearpanelarm1" model="mrp.bom">
<field name="sequence">141</field>
<field name="product_id" ref="product.product_product_rearpanelarm0"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
<field name="product_qty">1.0</field>
<field name="name">Rear panel SHE100</field>
</record>
<record id="mrp_bom_assemblysection2" model="mrp.bom">
<field name="name">Assembly Section</field>
<field name="sequence">143</field>
+9 -7
View File
@@ -131,6 +131,8 @@ class report_custom(report_rml):
</row>
""" % (_('Component'), _('Component suppliers'), _('Quantity'),_('Cost Price per Uom')+'('+company_currency.code+')', _('Supplier Price per Uom')+'('+company_currency.code+')')
purchase_price_digits = rml_obj.get_digits(dp='Purchase Price')
for product in product_pool.browse(cr, uid, ids, context=context):
bom_id = bom_pool._bom_find(cr, uid, product.id, product.uom_id.id)
title = "<title>%s</title>" %(_("Cost Structure"))
@@ -150,8 +152,8 @@ class report_custom(report_rml):
<col> """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """: </col>
<col/>
<col f='yes'/>
<col t='yes'>"""+ rml_obj.formatLang(total_strd) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
</row></lines>'"""
else:
bom = bom_pool.browse(cr, uid, bom_id, context=context)
@@ -177,8 +179,8 @@ class report_custom(report_rml):
<col> """ + _('Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'(' + company_currency.code +')'+ """: </col>
<col/>
<col t='yes'/>
<col t='yes'>"""+ rml_obj.formatLang(total_strd) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
</row></lines>'"""
total2 = 0
@@ -195,14 +197,14 @@ class report_custom(report_rml):
<col/>
<col/>
<col/>
<col t='yes'>"""+ rml_obj.formatLang(total2) +' '+ company_currency.symbol +"""</col>
<col t='yes'>"""+ rml_obj.formatLang(total2, digits=purchase_price_digits) +' '+ company_currency.symbol +"""</col>
</row></lines>'"""
xml += """<lines style='total'> <row>
<col> """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """: </col>
<col/>
<col t='yes'/>
<col t='yes'>"""+ rml_obj.formatLang(total_strd+total2) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total+total2) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total_strd+total2, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
<col t='yes'>"""+ rml_obj.formatLang(total+total2, digits=purchase_price_digits) +' '+ company_currency.symbol + """</col>
</row></lines>'"""
xml = '<?xml version="1.0" ?><report>' + config_start + config_stop + xml + '</report>'
+15 -12
View File
@@ -22,9 +22,8 @@
from report.render import render
from report.interface import report_int
from pychart import *
from mx.DateTime import *
import time
from datetime import datetime
from datetime import date, datetime, timedelta
from dateutil.relativedelta import relativedelta
from report.misc import choice_colors
@@ -55,8 +54,8 @@ class report_custom(report_int):
stop = start
if time_unit == 'month':
dates = {}
a = Date(*map(int, start.split("-"))).year*12+Date(*map(int, start.split("-"))).month
z = Date(*map(int, stop.split("-"))).year*12+Date(*map(int, stop.split("-"))).month+1
a = int(start.split("-")[0])*12 + int(start.split("-")[1])
z = int(stop.split("-")[0])*12 + int(stop.split("-")[1]) + 1
for i in range(a,z):
year = i/12
month = i%12
@@ -66,27 +65,31 @@ class report_custom(report_int):
months = {1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}
dates[i] = {
'name' :months[month],
'start':(datetime.date(year, month, 2) + relativedelta(day=1)).strftime('%Y-%m-%d'),
'stop' :(datetime.date(year, month, 2) + relativedelta(day=-1)).strftime('%Y-%m-%d'),
'start':(datetime(year, month, 2) + relativedelta(day=1)).strftime('%Y-%m-%d'),
'stop' :(datetime(year, month, 2) + relativedelta(day=31)).strftime('%Y-%m-%d'),
}
return dates
elif time_unit == 'week':
dates = {}
a = Date(*map(int, start.split("-"))).iso_week[0]*52+Date(*map(int, start.split("-"))).iso_week[1]
z = Date(*map(int, stop.split("-"))).iso_week[0]*52+Date(*map(int, stop.split("-"))).iso_week[1]
start_week = date(int(start.split("-")[0]),int(start.split("-")[1]),int(start.split("-")[2])).isocalendar()
end_week = date(int(stop.split("-")[0]),int(stop.split("-")[1]),int(stop.split("-")[2])).isocalendar()
a = int(start.split("-")[0])*52 + start_week[1]
z = int(stop.split("-")[0])*52 + end_week[1]
for i in range(a,z+1):
year = i/52
week = i%52
d = date(year, 1, 1)
dates[i] = {
'name' :"Week #%d" % week,
'start':ISO.WeekTime(year, week, 1).strftime('%Y-%m-%d'),
'stop' :ISO.WeekTime(year, week, 7).strftime('%Y-%m-%d'),
'start':(d + timedelta(days=-d.weekday(), weeks=week)).strftime('%Y-%m-%d'),
'stop' :(d + timedelta(days=6-d.weekday(), weeks=week)).strftime('%Y-%m-%d'),
}
return dates
else: # time_unit = day
dates = {}
a = Date(*map(int, start.split("-")))
z = Date(*map(int, stop.split("-")))
a = datetime(int(start.split("-")[0]),int(start.split("-")[1]),int(start.split("-")[2]))
z = datetime(int(stop.split("-")[0]),int(stop.split("-")[1]),int(stop.split("-")[2]))
i = a
while i <= z:
dates[map(int,i.strftime('%Y%m%d').split())[0]] = {
+12 -14
View File
@@ -21,10 +21,9 @@
from osv import fields
from osv import osv
import datetime
import netsvc
import time
from mx import DateTime
from datetime import datetime
from tools.translate import _
#----------------------------------------------------------
@@ -75,7 +74,6 @@ class mrp_production_workcenter_line(osv.osv):
for op in ops:
res[op.id] = False
if op.date_planned:
d = DateTime.strptime(op.date_planned,'%Y-%m-%d %H:%M:%S')
i = intervals[(op.date_planned, op.hour, op.workcenter_id.calendar_id.id)]
if i:
res[op.id] = i[-1][1].strftime('%Y-%m-%d %H:%M:%S')
@@ -176,8 +174,8 @@ class mrp_production_workcenter_line(osv.osv):
date_now = time.strftime('%Y-%m-%d %H:%M:%S')
obj_line = self.browse(cr, uid, ids[0])
date_start = datetime.datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
date_finished = datetime.datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
date_start = datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
delay += (date_finished-date_start).days * 24
delay += (date_finished-date_start).seconds / float(60*60)
@@ -259,9 +257,9 @@ class mrp_production(osv.osv):
""" Computes planned and finished dates for work order.
@return: Calculated date
"""
dt_end = DateTime.now()
dt_end = datetime.now()
for po in self.browse(cr, uid, ids, context=context):
dt_end = DateTime.strptime(po.date_start or po.date_planned, '%Y-%m-%d %H:%M:%S')
dt_end = datetime.strptime(po.date_planned, '%Y-%m-%d %H:%M:%S')
if not po.date_start:
self.write(cr, uid, [po.id], {
'date_start': po.date_planned
@@ -275,7 +273,7 @@ class mrp_production(osv.osv):
del context['__last_update']
if (wc.date_planned < dt.strftime('%Y-%m-%d %H:%M:%S')) or mini:
self.pool.get('mrp.production.workcenter.line').write(cr, uid, [wc.id], {
'date_planned':dt.strftime('%Y-%m-%d %H:%M:%S')
'date_planned': dt.strftime('%Y-%m-%d %H:%M:%S')
}, context=context, update=False)
i = self.pool.get('resource.calendar').interval_get(
cr,
@@ -287,7 +285,7 @@ class mrp_production(osv.osv):
if i:
dt_end = max(dt_end, i[-1][1])
else:
dt_end = DateTime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S')
dt_end = datetime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S')
old = wc.sequence or 0
super(mrp_production, self).write(cr, uid, [po.id], {
'date_finnished': dt_end
@@ -302,7 +300,7 @@ class mrp_production(osv.osv):
if po.allow_reorder:
continue
todo = po.move_lines
dt = DateTime.strptime(po.date_start,'%Y-%m-%d %H:%M:%S')
dt = datetime.strptime(po.date_start,'%Y-%m-%d %H:%M:%S')
while todo:
l = todo.pop(0)
if l.state in ('done','cancel','draft'):
@@ -426,8 +424,8 @@ class mrp_operations_operation(osv.osv):
if not i: continue
if code_lst[i-1] not in ('resume','start'):
continue
a = datetime.datetime.strptime(time_lst[i-1],'%Y-%m-%d %H:%M:%S')
b = datetime.datetime.strptime(time_lst[i],'%Y-%m-%d %H:%M:%S')
a = datetime.strptime(time_lst[i-1],'%Y-%m-%d %H:%M:%S')
b = datetime.strptime(time_lst[i],'%Y-%m-%d %H:%M:%S')
diff += (b-a).days * 24
diff += (b-a).seconds / float(60*60)
return diff
@@ -513,7 +511,7 @@ class mrp_operations_operation(osv.osv):
if code.start_stop=='done':
self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,wc_op_id)
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_done', cr)
self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finnished':DateTime.now().strftime('%Y-%m-%d %H:%M:%S')})
self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finnished':datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
if code.start_stop=='pause':
self.pool.get('mrp.production.workcenter.line').action_pause(cr,uid,wc_op_id)
@@ -551,7 +549,7 @@ class mrp_operations_operation(osv.osv):
'order_date': fields.function(_get_order_date,method=True,string='Order Date',type='date',store={'mrp.production':(_order_date_search_production,['date_planned'], 10)}),
}
_defaults={
'date_start': lambda *a:DateTime.now().strftime('%Y-%m-%d %H:%M:%S')
'date_start': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S')
}
mrp_operations_operation()
@@ -1 +1,2 @@
python addin.py
pause
@@ -1 +1,2 @@
python addin.py --unregister
pause
@@ -162,7 +162,8 @@ hwndChk_list=[]
global search_text
search_text='search_text'
global partner_ref
partner_ref = ''
global name
name=''
global email
@@ -774,13 +775,6 @@ def CreateContact(btnProcessor,*args):
return
partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
sel = win32gui.SendMessage(combo, win32con.CB_GETCURSEL)
state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[10])
state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)
coun_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
country_sel = win32gui.SendMessage(coun_combo, win32con.CB_GETCURSEL)
name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
office_no = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
@@ -795,6 +789,7 @@ def CreateContact(btnProcessor,*args):
return
res = {
'partner_id':ustr(partner),
'name':ustr(name),
'email':ustr(email),
'phone':ustr(office_no),
@@ -806,37 +801,8 @@ def CreateContact(btnProcessor,*args):
'zip':ustr(zip)
}
fs_id = c_id = -1
if not state_sel == -1 :
try:
temp = NewConn.GetAllState()
i = -1
for t in temp:
i+=1
if i == state_sel:
fs_id = t[0]
break;
res ['state_id'] = fs_id
except Exception, e:
msg = getMessage(e)
win32ui.MessageBox(msg, "New Partner", flag_error)
pass
if not country_sel == -1 :
try:
temp = NewConn.GetAllCountry()
i = -1
for t in temp:
i+=1
if i == country_sel:
c_id = t[0]
break;
res ['country_id'] = c_id
except Exception, e:
msg = getMessage(e)
win32ui.MessageBox(msg, "Open Contact", flag_error)
pass
try:
id = NewConn.CreateContact(sel, str(res))
id = NewConn.CreateContact(str(res))
if not partner:
msg="New contact created."
else:
@@ -848,9 +814,6 @@ def CreateContact(btnProcessor,*args):
win32ui.MessageBox(msg, "Create Contact", flag_info)
for i in range(0,9):
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], '')
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(state_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(coun_combo, win32con.CB_SETCURSEL, -1 )
win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.id)
def SetAllText(txtProcessor,*args):
@@ -929,6 +892,8 @@ def SetDefaultContact(txtProcessor,*args):
global name
global email
global partner_ref
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[1],partner_ref)
if txtProcessor.init_done:
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)
@@ -941,12 +906,9 @@ def SetDefaultContact(txtProcessor,*args):
except Exception,e:
pass
fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])
c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[2])
win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)
txtProcessor.init_done = True
def setCheckList(groupProcessor,*args):
@@ -1043,6 +1005,8 @@ def set_search_text(dialogProcessor,*args):
def set_name_email(dialogProcessor,*args):
global name
global email
global partner_ref
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[2], ustr(partner_ref))
name = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[0])
email = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[1])
@@ -1051,6 +1015,8 @@ def GetDefaultEmail(txtProcessor,*args):
from win32com.client import Dispatch
import win32con
b = check()
global partner_ref
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0], ustr(partner_ref))
if not b:
return
#Acquiring control of the text box
@@ -1070,96 +1036,67 @@ def GetDefaultEmail(txtProcessor,*args):
win32ui.MessageBox("Error In reading email ID from Email ","Open Contact", flag_error)
pass
win32gui.SendMessage(search_partner_box, win32con.WM_SETTEXT, 0, search_partner_text)
fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[10])
c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[11])
partner_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[0])
if search_partner_text.strip() == "":
search_partner_text = None
return
vals = []
#Searching the res.partner.address for contact based on Sender Mail ID.
vals = NewConn.SearchPartnerDetail(search_partner_text)
#If no user Found.
if vals == None:
for i in range(1,10):
for i in range(1,12):
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")
win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
win32ui.MessageBox("No matching records found for : "+str(search_partner)+".","Open Contact", flag_excl)
return
else:
#If user Found than Setting the Value for the contact in fields.
for i in range(1,10):
for i in range(1,12):
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")
win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
for val in vals:
if val[0] == 'partner_id':
temp = list (NewConn.GetPartners())
i = -1
for t in temp:
i+=1
if t[1] == val[1][1] :
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0], ustr(val[1][1]))
if val[0] == 'name' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[1], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[1], ustr(val[1]))
if val[0] == 'street' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[2], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[2], ustr(val[1]))
if val[0] == 'street2' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[3], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[3], ustr(val[1]))
if val[0] == 'zip' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[9], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[9], ustr(val[1]))
if val[0] == 'city' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[4], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[4], ustr(val[1]))
if val[0] == 'state_id' and val[1] != False :
id = i = -1
temp = list(NewConn.GetAllState())
for t in temp:
i+=1
if str(t[1]) == str(val[1][1]):
id = i
break;
sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[10], ustr(val[1][1]))
if val[0] == 'country_id' and val[1] != False :
id = i = -1
temp = list(NewConn.GetAllCountry())
for t in temp:
i+=1
if str(t[1]) == str(val[1][1]):
id = i
break;
sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[11], ustr(val[1][1]))
if val[0] == 'phone' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[5], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[5], ustr(val[1]))
if val[0] == 'mobile' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[6], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[6], ustr(val[1]))
if val[0] == 'fax' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[7], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[7], ustr(val[1]))
if val[0] == 'email' and val[1] != False :
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[8], str(val[1]))
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[8], ustr(val[1]))
txtProcessor.init_done=True
def SearchPartner(btnProcessor,*args):
b = check()
global partner_ref
if not b:
return
#hwnd For the List box
fs_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
c_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[12])
partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
try :
search_partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
if not search_partner:
@@ -1170,79 +1107,51 @@ def SearchPartner(btnProcessor,*args):
vals = NewConn.SearchPartnerDetail(search_partner)
#if contact not found resetting all field to blank
if vals == None:
for i in range(2,11):
for i in range(1,13):
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")
win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
win32ui.MessageBox("No matching records found for : "+str(search_partner)+".","Open Contact", flag_excl)
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<enter new search>")
return
#if contact found than setting the values for the contact.
else:
for i in range(2,11):
for i in range(1,13):
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")
win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
for val in vals:
if val[0] == 'partner_id':
#Finding the partner index in list and setting it.
temp = list (NewConn.GetPartners())
i = -1
for t in temp:
i+=1
if t[1] == val[1][1] :
win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1], ustr(val[1][1]))
if val[0] == 'name' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], ustr(val[1]))
if val[0] == 'street' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3], ustr(val[1]))
if val[0] == 'street2' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4], ustr(val[1]))
if val[0] == 'zip' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10], ustr(val[1]))
if val[0] == 'city' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5], ustr(val[1]))
if val[0] == 'state_id' and val[1] != False :
#Finding the state index in list and setting it.
id = i = -1
temp = list(NewConn.GetAllState())
for t in temp:
i+=1
if str(t[1]) == str(val[1][1]):
id = i
break;
sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[11], ustr(val[1][1]))
if val[0] == 'country_id' and val[1] != False :
#Finding the country index in list and setting it.
id = i = -1
temp = list(NewConn.GetAllCountry())
for t in temp:
i+=1
if str(t[1]) == str(val[1][1]):
id = i
break;
sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[12], ustr(val[1][1]))
if val[0] == 'phone' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6], ustr(val[1]))
if val[0] == 'mobile' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7], ustr(val[1]))
if val[0] == 'fax' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8], ustr(val[1]))
if val[0] == 'email' and val[1] != False :
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9], str(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9], ustr(val[1]))
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<Enter new search>")
except Exception,e:
@@ -1253,6 +1162,7 @@ def SearchPartner(btnProcessor,*args):
def WritePartner(btnProcessor,*args):
new_vals=[]
#Reading new value of the fields.
partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
contect_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
street = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
street2 = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3])
@@ -1262,70 +1172,14 @@ def WritePartner(btnProcessor,*args):
fax = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10])
zip = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
country_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[6])
country_sel = win32gui.SendMessage(country_combo, win32con.CB_GETCURSEL)
state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[5])
state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)
partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
partner_sel = win32gui.SendMessage(partner_combo, win32con.CB_GETCURSEL)
#Checking that record not being saved without name or Partner
if contect_name.strip() == "":
win32ui.MessageBox("Please enter partner Contact Name name.", "Open Contact", flag_excl)
return
if partner_sel < 1:
win32ui.MessageBox("Please Select Partner From list.", "Open Contact", flag_excl)
return
fs_id = c_id = p_id = -1
#Finding the partner index in list finding it record ID.
if not partner_sel < 0 :
try:
temp = NewConn.GetPartners()
i = -1
for t in temp:
i+=1
if i == partner_sel:
p_id = t[0]
break;
except Exception, e:
msg = getMessage(e)
win32ui.MessageBox(msg, "Open Contact", flag_error)
pass
#Finding the State index in list finding it record ID.
if not state_sel == -1 :
try:
temp = NewConn.GetAllState()
i = -1
for t in temp:
i+=1
if i == state_sel:
fs_id = t[0]
break;
except Exception, e:
msg = getMessage(e)
win32ui.MessageBox(msg, "Open Contact", flag_error)
pass
#Finding the country index in list finding it record ID.
if not country_sel == -1 :
try:
temp = NewConn.GetAllCountry()
i = -1
for t in temp:
i+=1
if i == country_sel:
c_id = t[0]
break;
except Exception, e:
msg = getMessage(e)
win32ui.MessageBox(msg, "Open Contact", flag_error)
pass
# Creating a list to write the values to the OpenERP
new_vals.append(['partner_id',p_id])
new_vals.append(['partner',partner])
new_vals.append(['name',contect_name])
new_vals.append(['street',street])
new_vals.append(['street2',street2])
new_vals.append(['city',city])
new_vals.append(['state_id',fs_id])
new_vals.append(['country_id',c_id])
new_vals.append(['phone',phone])
new_vals.append(['mobile',mobile])
new_vals.append(['email',email])
@@ -1346,6 +1200,80 @@ def WritePartner(btnProcessor,*args):
elif flag == -1:
win32ui.MessageBox("Contact can not be Save.\nFirst select contact using Search.","Open Contact", flag_info)
def SetPartnerNameColumn(listProcessor,*args):
hwndList = listProcessor.GetControl()
child_ex_style = win32gui.SendMessage(hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
child_ex_style |= commctrl.LVS_EX_FULLROWSELECT
win32gui.SendMessage(hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style)
# set header row
lvc = LVCOLUMN(
mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | \
commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM
)
lvc.fmt = commctrl.LVCFMT_LEFT
lvc.iSubItem = 1
lvc.text = "Partner Name"
lvc.cx = 275
win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())
listProcessor.init_done = True
def SelectPartnerFromList(btnProcessor,*args):
hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
sel_text = ''
if sel_count == 1:
sel=-1
for i in range(0,sel_count):
sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, sel, commctrl.LVNI_SELECTED)
buf,extra = win32gui_struct.EmptyLVITEM(1, 0)
size = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)
sel_text = ''
for n in extra:
nombre = n.tostring()
sel_text = nombre[0:size]
global partner_ref
if str(sel_text).strip() == "":
win32ui.MessageBox("Invalid Partner Selected.","Search Partner")
return
try:
partner_ref = str(sel_text)
except Exception,e:
pass
win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
return
elif sel_count < 1:
win32ui.MessageBox("You should Select atleast one partner.","Search Partner")
return
else:
win32ui.MessageBox("Multiple Selection is not allowded.","Search Partner")
return
def SearchPartnerList(btnProcessor,*args):
b = check()
if not b:
return
try :
search_partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
if not search_partner:
win32ui.MessageBox("Please enter Partner name to search for.", "Search Partner", flag_excl)
return
#Searching the contact.
hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
partners = list(NewConn.GetPartners(search_partner))
win32gui.SendMessage(hwndList, commctrl.LVM_DELETEALLITEMS)
if not partners:
win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0],"<enter text to search>")
win32ui.MessageBox("No Partner found with name {0}.".format(search_partner),"Search Partner",flag_error)
for partner in partners:
num_items = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMCOUNT)
item = LVITEM(text=partner[1],iItem = num_items)
win32gui.SendMessage(hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam())
except Exception,e:
msg = getMessage(e)
win32ui.MessageBox(msg, "Search Partner", flag_error)
pass
dialog_map = {
@@ -1399,13 +1327,10 @@ dialog_map = {
),
"IDD_NEW_CONTACT_DIALOG" : (
(PartnersComboProcessor, "ID_PARTNER_DROPDOWNLIST", GetConn, ()),
(CountryComboProcessor, "ID_COUNTRY_DROPLIST", GetConn, ()),
(StateComboProcessor, "ID_FED_STATE_DROPLIST", GetConn, ()),
(CloseButtonProcessor, "IDCANCEL"),
(CommandButtonProcessor, "ID_CONTACT_SAVE_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_CONTACT_OFFICE_TEXT ID_CONTACT_MOBILE_TEXT ID_FAX_TEXT ID_STREET_TEXT ID_STREET2_TEXT ID_PARTNER_CITY_TEXT ID_ZIP_TEXT ID_PARTNER_DROPDOWNLIST ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST", CreateContact, ()),
(TextProcessor, "ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST" , SetDefaultContact, ()),
(DialogCommand, "ID_NEW_PARTNER_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT", "IDD_NEW_PARTNER_DIALOG", set_name_email, ()),
(CommandButtonProcessor, "ID_CONTACT_SAVE_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_CONTACT_OFFICE_TEXT ID_CONTACT_MOBILE_TEXT ID_FAX_TEXT ID_STREET_TEXT ID_STREET2_TEXT ID_PARTNER_CITY_TEXT ID_ZIP_TEXT ID_PARTNER_TEXT", CreateContact, ()),
(TextProcessor, "ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_PARTNER_TEXT" , SetDefaultContact, ()),
(DialogCommand, "ID_NEW_PARTNER_BUTTON", "IDD_SELECT_PARTNER"),
),
"IDD_NEW_PARTNER_DIALOG" : (
@@ -1414,14 +1339,18 @@ dialog_map = {
),
"IDD_VIEW_PARTNER_DIALOG" : (
(PartnersComboProcessor, "ID_PARTNER_DROPLIST", GetConn, ()),
(StateComboProcessor, "ID_ALL_STATE_DROPDOWNLIST", GetConn, ()),
(CountryComboProcessor, "ID_ALL_COUNTRY_DROPDOWNLIST", GetConn, ()),
(TextProcessor, "IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", GetDefaultEmail, ()),
(CommandButtonProcessor, "IDPB_SEARCH_PARTNER IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", SearchPartner, ()),
(CommandButtonProcessor, "IDPB_WRITE_CHANGES ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP", WritePartner, ()),
(TextProcessor, "IDET_SEARCH_PARTNER IDET_PARTNER IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP IDET_PARTNER_STATE IDET_PARTNER_COUNTRY", GetDefaultEmail, ()),
(CommandButtonProcessor, "IDPB_SEARCH_PARTNER IDET_SEARCH_PARTNER IDET_PARTNER IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP IDET_PARTNER_STATE IDET_PARTNER_COUNTRY", SearchPartner, ()),
(CommandButtonProcessor, "IDPB_WRITE_CHANGES IDET_PARTNER IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_STATE IDET_PARTNER_COUNTRY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP", WritePartner, ()),
(CloseButtonProcessor, "IDCANCEL"),
(DialogCommand, "ID_NEW_PART_BUTTON", "IDD_NEW_PARTNER_DIALOG" ),
(DialogCommand, "ID_NEW_PART_BUTTON", "IDD_SELECT_PARTNER" ),
(DialogCommand, "IDPB_NEWPARTNER_BUTTON" , "IDD_NEW_CONTACT_DIALOG")
),
"IDD_SELECT_PARTNER" : (
(CloseButtonProcessor, "IDCANCEL"),
(ListBoxProcessor, "IDC_LIST_PARTNER" ,SetPartnerNameColumn, ()),
(CommandButtonProcessor, "IDPB_PARTNER_SEARCH IDET_PARTNER_SEARCH_NAME IDC_LIST_PARTNER", SearchPartnerList,()),
(CommandButtonProcessor, "IDPB_SELECT_PARTNER IDC_LIST_PARTNER IDD_SELECT_PARTNER" , SelectPartnerFromList,()),
(DialogCommand, "IDPB_CREATE_NEW_PARTNER" , "IDD_NEW_PARTNER_DIALOG")
),
}
@@ -156,6 +156,9 @@
#define IDPB_WRITE_CHANGES 2059
#define ID_ALL_STATE_DROPDOWNLIST 2060
#define ID_ALL_COUNTRY_DROPDOWNLIST 2061
#define IDET_PARTNER_STATE 2062
#define IDET_PARTNER_COUNTRY 2063
#define IDET_PARTNER 2064
//
#define ID_STREET_TEXT 2062
#define ID_STREET2_TEXT 2063
@@ -167,6 +170,13 @@
#define ID_PARTNER_DROPLIST 2069
#define ID_NEW_PART_BUTTON 2070
#define IDPB_NEWPARTNER_BUTTON 2071
#define IDD_SELECT_PARTNER 2073
#define IDC_LIST_PARTNER 2072
#define IDPB_SELECT_PARTNER 2075
#define IDET_PARTNER_SEARCH_NAME 2076
#define IDPB_PARTNER_SEARCH 2077
#define IDPB_CREATE_NEW_PARTNER 2078
#define ID_PARTNER_TEXT 2079
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
File diff suppressed because one or more lines are too long
@@ -111,7 +111,7 @@ EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Push to OpenERP"
FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
GROUPBOX " Link to an Existing Documents ", IDC_STATIC_GROUP, 8,5,250,290,WS_TABSTOP
GROUPBOX "Link to an Existing Documents ", IDC_STATIC_GROUP, 8,5,250,290,WS_TABSTOP
LTEXT "Search for : ",IDC_STATIC,15,17,40,12
EDITTEXT ID_SEARCH_TEXT,60,15,120,12,ES_AUTOHSCROLL | WS_TABSTOP// left top width height
PUSHBUTTON "Search",ID_SEARCH,187,15,40,14,WS_TABSTOP
@@ -131,7 +131,7 @@ BEGIN
PUSHBUTTON "Close",IDCANCEL,385,300,60,14,WS_TABSTOP
END
IDD_NEW_CONTACT_DIALOG DIALOGEX 0, 0, 350, 190
IDD_NEW_CONTACT_DIALOG DIALOGEX 0, 0, 350, 150
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Create a New Contact"
@@ -139,26 +139,23 @@ FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
LTEXT "Select Partner : ",IDC_STATIC,13,20,50,17
COMBOBOX ID_PARTNER_DROPDOWNLIST, 70, 18, 200, 80 ,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "New Partner",ID_NEW_PARTNER_BUTTON,280,17,55,14, WS_TABSTOP
EDITTEXT ID_PARTNER_TEXT, 70, 18, 200, 12 , ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search Partner",ID_NEW_PARTNER_BUTTON,280,17,60,14, WS_TABSTOP
GROUPBOX "Postal Address ", IDC_STATIC_GROUP,10,35,175,125
GROUPBOX "Postal Address ", IDC_STATIC_GROUP,10,35,175,90
LTEXT "Contact Name : ",IDC_STATIC, 18, 53, 100, 17
EDITTEXT ID_CONTACT_NAME_TEXT, 76, 52, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street : ",IDC_STATIC, 18, 67, 40, 17
EDITTEXT ID_STREET_TEXT, 76, 66, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street2 : ",IDC_STATIC, 18, 81, 40, 17
EDITTEXT ID_STREET2_TEXT, 76, 80, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Zip : ",IDC_STATIC,18, 94, 50, 17
LTEXT "Zip : ",IDC_STATIC, 18, 94, 50, 17
EDITTEXT ID_ZIP_TEXT,76, 93, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "City : ",IDC_STATIC,18,108,50,17
LTEXT "City : ",IDC_STATIC, 18,106, 50, 17
EDITTEXT ID_PARTNER_CITY_TEXT,76,107,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Fed. State : ",IDC_STATIC, 18, 123, 40, 17
COMBOBOX ID_FED_STATE_DROPLIST, 76, 122, 100, 80,CBS_DROPDOWNLIST |WS_VSCROLL | WS_TABSTOP
LTEXT "Country : ",IDC_STATIC, 18, 137, 40, 17
COMBOBOX ID_COUNTRY_DROPLIST, 76, 136, 100, 80,CBS_DROPDOWNLIST |WS_VSCROLL | WS_TABSTOP
GROUPBOX "Communication ", IDC_STATIC_GROUP, 188, 35, 150, 125
GROUPBOX "Communication ", IDC_STATIC_GROUP, 188, 35, 150, 90
LTEXT "Office : ",IDC_STATIC,194, 53, 30, 17
EDITTEXT ID_CONTACT_OFFICE_TEXT, 224, 52, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Mobile : ",IDC_STATIC,194, 67, 30, 17
@@ -168,8 +165,8 @@ BEGIN
LTEXT "Email : ",IDC_STATIC, 194, 95, 30, 17
EDITTEXT ID_CONTACT_EMAIL_TEXT, 224, 94, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,290,170,45,14, WS_TABSTOP
PUSHBUTTON "Save",ID_CONTACT_SAVE_BUTTON,240,170,45,14, WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,290,130,45,14, WS_TABSTOP
PUSHBUTTON "Save",ID_CONTACT_SAVE_BUTTON,240,130,45,14, WS_TABSTOP
END
IDD_NEW_PARTNER_DIALOG DIALOGEX 0, 0, 140,40
@@ -192,11 +189,11 @@ FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Email ID : ",IDC_STATIC,32,17,40,12
EDITTEXT IDET_SEARCH_PARTNER, 70, 15, 200, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search Partner ",IDPB_SEARCH_PARTNER,280,15,60,14,WS_TABSTOP
PUSHBUTTON "Search Contact ",IDPB_SEARCH_PARTNER,280,15,60,14,WS_TABSTOP
LTEXT "Partner Name : ",IDC_STATIC,13,42,50,17
COMBOBOX ID_PARTNER_DROPLIST, 70, 42, 200, 80 ,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "New Partner",ID_NEW_PART_BUTTON,280,41,60,14, WS_TABSTOP
EDITTEXT IDET_PARTNER,70, 42, 200, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search Partner",ID_NEW_PART_BUTTON,280,41,60,14, WS_TABSTOP
GROUPBOX "Postal Address ", IDC_STATIC_GROUP,10,65,175,125
LTEXT "Contact Name : ",IDC_STATIC,18,83,50,17
@@ -210,9 +207,9 @@ BEGIN
LTEXT "City : ",IDC_STATIC,18,140,50,17
EDITTEXT IDET_PARTNER_CITY,76,139,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Fed. State : ",IDC_STATIC,18,154,50,17
COMBOBOX ID_ALL_STATE_DROPDOWNLIST, 76, 153, 100, 50,CBS_DROPDOWNLIST |WS_VSCROLL | WS_TABSTOP
EDITTEXT IDET_PARTNER_STATE, 76, 153, 100, 12,ES_AUTOHSCROLL |ES_READONLY
LTEXT "Country :",IDC_STATIC, 18, 169, 35, 17
COMBOBOX ID_ALL_COUNTRY_DROPDOWNLIST, 76, 168,100,50,CBS_DROPDOWNLIST |WS_VSCROLL | WS_TABSTOP
EDITTEXT IDET_PARTNER_COUNTRY, 76, 168, 100, 12,ES_AUTOHSCROLL |ES_READONLY
GROUPBOX "Communication ", IDC_STATIC_GROUP, 188, 65, 152, 125
LTEXT "Phone : ",IDC_STATIC, 194, 83, 30, 17
@@ -228,3 +225,22 @@ BEGIN
PUSHBUTTON "Save", IDPB_WRITE_CHANGES, 213, 195, 60, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 281, 195, 60, 14, WS_TABSTOP
END
IDD_SELECT_PARTNER DIALOGEX 0, 0, 220, 250
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Search Partner"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Enter Name : ",IDC_STATIC,8,12,80,17
EDITTEXT IDET_PARTNER_SEARCH_NAME, 55, 10, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search", IDPB_PARTNER_SEARCH, 160, 10, 50, 14, WS_TABSTOP
CONTROL "List1",IDC_LIST_PARTNER,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Create New Partner", IDPB_CREATE_NEW_PARTNER, 10, 230, 100, 14, WS_TABSTOP
PUSHBUTTON "Select", IDPB_SELECT_PARTNER, 130, 230, 40, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 175, 230, 40, 14, WS_TABSTOP
END
@@ -209,12 +209,12 @@ class XMLRpcConn(object):
obj_list = [ustr(item['name']).encode('iso-8859-1') for item in objects]
return obj_list
def GetPartners(self):
def GetPartners(self, search_partner=''):
import win32ui
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids=[]
obj_list=[]
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[])
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[('name','ilike',ustr(search_partner))])
if ids:
ids.sort()
obj_list.append((-999, ustr('')))
@@ -302,13 +302,13 @@ class XMLRpcConn(object):
result[obj].update({obj_id: attachment_ids})
return result
def CreateContact(self, sel=None, res=None):
def CreateContact(self, res=None):
import win32ui
res=eval(str(res))
self.partner_id_list=eval(str(self.partner_id_list))
if self.partner_id_list.get(sel,-999) != -999:
res['partner_id'] = self.partner_id_list[sel]
partner = res['partner_id']
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
partner_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner', 'search', [('name','=',ustr(partner))])
res.update({'partner_id' : partner_id[0]})
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner.address','create',res)
return id
@@ -339,12 +339,16 @@ class XMLRpcConn(object):
flag = -1
new_dict = dict(new_vals)
email=new_dict['email']
partner = new_dict['partner']
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
partner_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner', 'search', [('name','=',ustr(partner))])
address_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(email))])
if not address_id:
return flag
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','state_id','country_id'])
vals_res_address={ 'name' : new_dict['name'],
vals_res_address={
'partner_id' : partner_id[0],
'name' : new_dict['name'],
'street':new_dict['street'],
'street2' : new_dict['street2'],
'city' : new_dict['city'],
@@ -353,12 +357,6 @@ class XMLRpcConn(object):
'fax' : new_dict['fax'],
'zip' : new_dict['zip'],
}
if new_dict['partner_id'] != -1:
vals_res_address['partner_id'] = new_dict['partner_id']
if new_dict['state_id'] != -1:
vals_res_address['state_id'] = new_dict['state_id']
if new_dict['country_id'] != -1:
vals_res_address['country_id'] = new_dict['country_id']
temp = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'write', address_id, vals_res_address)
if temp:
flag=1
+1 -2
View File
@@ -67,12 +67,11 @@ Main features :
'report/report_pos_order_view.xml',
'report/report_cash_register_view.xml',
'pos_sequence.xml',
'pos_data.xml',
'pos_workflow.xml',
'statement_view.xml',
'statement_report.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml'],
'test':['test/pos_test.yml',
'test/pos_report.yml',
],
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
</data>
</openerp>
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
</data>
</openerp>
+19 -50
View File
@@ -25,8 +25,6 @@ from osv import fields, osv
from mx import DateTime
from tools.translate import _
from decimal import Decimal
import tools
import re
import decimal_precision as dp
class pos_config_journal(osv.osv):
@@ -114,18 +112,18 @@ class pos_order(osv.osv):
@return: Dictionary of values """
res = {}
pay_obj = self.pool.get('account.bank.statement')
stat_obj_line = self.pool.get('account.bank.statement.line')
tot =0.0
val=None
for order in self.browse(cr, uid, ids):
cr.execute("select date_payment from pos_order where id=%d"%(order.id))
cr.execute("SELECT date_payment FROM pos_order WHERE id=%s", (order.id,))
date_p=cr.fetchone()
date_p=date_p and date_p[0] or None
if date_p:
res[order.id]=date_p
return res
cr.execute(" SELECT max(l.date) from account_move_line l, account_move m, account_invoice i, account_move_reconcile r, pos_order o where i.move_id=m.id and l.move_id=m.id and l.reconcile_id=r.id and o.id=%d and o.invoice_id=i.id"%(order.id))
cr.execute(" SELECT max(l.date) "
" FROM account_move_line l, account_move m, account_invoice i, account_move_reconcile r, pos_order o "
" WHERE i.move_id=m.id AND l.move_id=m.id AND l.reconcile_id=r.id AND o.id=%s AND o.invoice_id=i.id",
(order.id,))
val=cr.fetchone()
val= val and val[0] or None
if val:
@@ -138,11 +136,9 @@ class pos_order(osv.osv):
@return: Dictionary of values """
res = {}
pay_obj = self.pool.get('pos.payment')
tot =0.0
val=None
for order in self.browse(cr, uid, ids):
cr.execute("select date_validation from pos_order where id=%d"%(order.id))
cr.execute("SELECT date_validation FROM pos_order WHERE id=%s", (order.id,))
date_p=cr.fetchone()
date_p=date_p and date_p[0] or None
if date_p:
@@ -153,7 +149,7 @@ class pos_order(osv.osv):
if line.discount > discount_allowed:
return {order.id: None }
if order.amount_paid == order.amount_total and not date_p:
cr.execute("select max(date) from account_bank_statement_line where pos_statement_id=%d"%(order.id))
cr.execute("SELECT MAX(date) FROM account_bank_statement_line WHERE pos_statement_id=%s", (order.id,))
val=cr.fetchone()
val=val and val[0] or None
if order.invoice_id and order.invoice_id.move_id and not date_p and not val:
@@ -215,7 +211,6 @@ class pos_order(osv.osv):
""" To get Shop for this order"
@return: Shop id """
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
res = self.pool.get('sale.shop').search(cr, uid, [])
if res:
return res[0]
@@ -242,23 +237,21 @@ class pos_order(osv.osv):
""" Changed the Validation state of order
@return: State """
flag=False
res_company = self.pool.get('res.company')
res_obj = self.pool.get('res.users')
company_disc=self.browse(cr,uid,ids)
if not company_disc:
comp=res_obj.browse(cr,uid,uid).company_id.company_discount or 0.0
else:
comp= company_disc[0] and company_disc[0].company_id and company_disc[0].company_id.company_discount or 0.0
cr.execute("select discount from pos_order_line where order_id=%s and discount <= %s"%(ids[0],comp))
cr.execute("select discount from pos_order_line where order_id=%s and discount <= %s", (ids[0],comp))
res=cr.fetchone()
cr.execute("select discount from pos_order_line where order_id=%s and discount > %s"%(ids[0],comp))
cr.execute("select discount from pos_order_line where order_id=%s and discount > %s", (ids[0],comp))
res2=cr.fetchone()
cr.execute("select journal_id from account_bank_statement_line where pos_statement_id=%s "%(ids[0]))
cr.execute("select journal_id from account_bank_statement_line where pos_statement_id=%s ", (ids[0],))
res3=cr.fetchall()
list_jrnl=[]
for r in res3:
cr.execute("select id from account_journal where name= '%s' and special_journal='t'"%(r[0]))
cr.execute("select id from account_journal where name= '%s' and special_journal='t'", (r[0],))
res3=cr.fetchone()
is_special=res3 and res3[0] or None
if is_special:
@@ -489,7 +482,7 @@ class pos_order(osv.osv):
continue
prop_ids = property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')])
val = property_obj.browse(cr, uid, prop_ids[0]).value_reference
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order.shop_id.warehouse_id.id))
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id=%s", (order.shop_id.warehouse_id.id,))
res=cr.fetchone()
location_id=res and res[0] or None
stock_dest_id = val.id
@@ -540,7 +533,7 @@ class pos_order(osv.osv):
res_obj = self.pool.get('res.company')
try:
part_company=res_obj.browse(cr,uid,uid) and res_obj.browse(cr,uid,uid).parent_id and res_obj.browse(cr,uid,uid).parent_id.id or None
except Exception, e:
except Exception:
raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
if part_company:
raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
@@ -559,12 +552,10 @@ class pos_order(osv.osv):
"""Create a new payment for the order"""
res_obj = self.pool.get('res.company')
statement_obj= self.pool.get('account.bank.statement')
statementl_obj = self.pool.get('account.bank.statement.line')
prod_obj = self.pool.get('product.product')
property_obj=self.pool.get('ir.property')
flag=''
curr_c=self.pool.get('res.users').browse(cr, uid, uid).company_id
curr_company=curr_c.id
order = self.browse(cr, uid, order_id, context)
@@ -600,7 +591,7 @@ class pos_order(osv.osv):
args['statement_id']= statement_id
args['pos_statement_id']= order_id
args['journal_id']= data['journal']
statement_line_id = statementl_obj.create(cr, uid, args)
statementl_obj.create(cr, uid, args)
ids_new.append(statement_id)
wf_service = netsvc.LocalService("workflow")
@@ -661,14 +652,12 @@ class pos_order(osv.osv):
def action_invoice(self, cr, uid, ids, context=None):
"""Create a invoice of order """
res_obj = self.pool.get('res.company')
inv_ref = self.pool.get('account.invoice')
inv_line_ref = self.pool.get('account.invoice.line')
product_obj= self.pool.get('product.product')
inv_ids = []
for order in self.pool.get('pos.order').browse(cr, uid, ids, context):
curr_c = order.user_salesman_id.company_id
if order.invoice_id:
inv_ids.append(order.invoice_id.id)
continue
@@ -894,21 +883,12 @@ class pos_order(osv.osv):
raise osv.except_osv(_('Error !'),
_('There is no receivable account defined for this journal:'\
' "%s" (id:%d)') % (order.sale_journal.name, order.sale_journal.id, ))
am=0.0
for payment in order.statement_ids:
am+=payment.amount
if am > 0:
payment_account = \
payment.statement_id.journal_id.default_debit_account_id.id
else:
payment_account = \
payment.statement_id.journal_id.default_credit_account_id.id
# Create one entry for the payment
if payment.is_acc:
continue
payment_move_id = account_move_obj.create(cr, uid, {
account_move_obj.create(cr, uid, {
'journal_id': payment.statement_id.journal_id.id,
'period_id': period,
}, context=context)
@@ -1022,7 +1002,7 @@ class pos_order_line(osv.osv):
def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context):
res = dict.fromkeys(ids, 0.0)
account_tax_obj = self.pool.get('account.tax')
prices = self.price_by_product_multi(cr, uid, ids)
self.price_by_product_multi(cr, uid, ids)
for line in self.browse(cr, uid, ids):
tax_amount = 0.0
taxes = [t for t in line.product_id.taxes_id]
@@ -1031,7 +1011,6 @@ class pos_order_line(osv.osv):
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
for tax in computed_taxes:
tax_amount += tax['amount']
price = prices[line.id]
if line.discount!=0.0:
res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
else:
@@ -1042,9 +1021,8 @@ class pos_order_line(osv.osv):
def _amount_line(self, cr, uid, ids, field_name, arg, context):
res = {}
prices = self.price_by_product_multi(cr, uid, ids)
self.price_by_product_multi(cr, uid, ids)
for line in self.browse(cr, uid, ids):
price = prices[line.id]
if line.discount!=0.0:
res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
else:
@@ -1056,11 +1034,10 @@ class pos_order_line(osv.osv):
account_tax_obj = self.pool.get('account.tax')
prices = self.price_by_product_multi(cr, uid, ids)
self.price_by_product_multi(cr, uid, ids)
for line in self.browse(cr, uid, ids):
for f in field_names:
if f == 'price_subtotal':
price = prices[line.id]
if line.discount != 0.0:
res[line.id][f] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
else:
@@ -1073,7 +1050,6 @@ class pos_order_line(osv.osv):
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
for tax in computed_taxes:
tax_amount += tax['amount']
price = prices[line.id]
if line.discount!=0.0:
res[line.id][f] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
else:
@@ -1097,8 +1073,6 @@ class pos_order_line(osv.osv):
for line in lines:
pricelist = line.order_id.pricelist_id.id
product_id = line.product_id
qty = line.qty or 0
partner_id = line.order_id.partner_id.id or False
if not product_id:
res[line.id] = 0.0
@@ -1108,8 +1082,6 @@ class pos_order_line(osv.osv):
_('You have to select a pricelist in the sale form !\n' \
'Please set one before choosing a product.'))
uom_id = product_id.uom_po_id.id
#old_price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product_id.id, qty or 1.0, partner_id, {'uom': uom_id})[pricelist]
#print "prod_id: %s, pricelist: %s, price: %s" % (product_id.id, pricelist, price)
price = price_get_multi_res[line.product_id.id][pricelist]
@@ -1170,9 +1142,7 @@ class pos_order_line(osv.osv):
return {'value': {'price_subtotal_incl':sub_total_discount}}
def onchange_ded(self, cr, uid,ids, val_ded,price_u,*a):
pos_order = self.pool.get('pos.order.line')
res_obj = self.pool.get('res.users')
res_company = self.pool.get('res.company')
comp = res_obj.browse(cr,uid,uid).company_id.company_discount or 0.0
val=0.0
if val_ded and price_u:
@@ -1184,7 +1154,6 @@ class pos_order_line(osv.osv):
def onchange_discount(self, cr, uid,ids, discount,price,*a):
pos_order = self.pool.get('pos.order.line')
res_obj = self.pool.get('res.users')
res_company = self.pool.get('res.company')
company_disc = pos_order.browse(cr,uid,ids)
if discount:
if not company_disc:
@@ -1282,7 +1251,7 @@ class pos_order_line(osv.osv):
}
line_id = self.write(cr, uid, order_line_id, vals)
if not line_id:
raise wizard.except_wizard(_('Error'), _('Modify line failed !'))
raise osv.except_osv(_('Error'), _('Modify line failed !'))
line_id = order_line_id
price_line = float(qty)*float(price)
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
</data>
</openerp>
-14
View File
@@ -169,20 +169,6 @@
</record>
<record model="ir.actions.act_window" id="action_pos_order_tobinvoiced">
<field name="name">Uninvoiced Sales</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_pos_order_tree"/>
<field name="domain">[('state','not in', ('invoiced','done')),('invoice_id','=',False)]</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_pos_order_filter"/>
</record>
<menuitem name="Invoicing" id="menu_point_of_sale_invoicing" parent="menu_point_root" sequence="5" />
<menuitem name="Uninvoiced Sales" action="action_pos_order_tobinvoiced" id="menu_point_of_sale_tobinvoiced" parent="menu_point_of_sale_invoicing"/>
<record model="ir.actions.act_window" id="action_pos_order_accepted">
<field name="name">Accepted Sales</field>
<field name="type">ir.actions.act_window</field>
-3
View File
@@ -1,3 +0,0 @@
<?xml version="1.0"?>
<openerp>
</openerp>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
</data>
</openerp>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
</data>
</openerp>
+2 -9
View File
@@ -28,7 +28,7 @@ class pos_details(report_sxw.rml_parse):
def _get_invoice(self,inv_id,user):
res={}
if inv_id:
self.cr.execute("select name from account_invoice as ac where id = %d" %(inv_id))
self.cr.execute("select name from account_invoice as ac where id = %s", (inv_id,))
res = self.cr.fetchone()
return res[0]
else:
@@ -107,14 +107,8 @@ class pos_details(report_sxw.rml_parse):
objects,
0.0)
def _get_payments(self, form,user, ignore_gift=False):
def _get_payments(self, form,user):
statement_line_obj = self.pool.get("account.bank.statement.line")
gift_journal_id = None
if ignore_gift:
config_journal_ids = self.pool.get("pos.config.journal").search(self.cr, self.uid, [('code', '=', 'GIFT')])
if len(config_journal_ids):
config_journal = self.pool.get("pos.config.journal").browse(self.cr, self.uid, config_journal_ids, {})[0]
gift_journal_id = config_journal.journal_id.id
pos_ids=self.pool.get("pos.order").search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)])
data={}
if pos_ids:
@@ -162,7 +156,6 @@ class pos_details(report_sxw.rml_parse):
res = {}
temp={}
list_ids = []
c=[]
temp2 = 0.0
pos_ids=self.pool.get("pos.order").search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)])
temp.update({'name':''})
@@ -7,7 +7,7 @@
"access_pos_payment","pos.payment","model_pos_payment","group_pos_user",1,1,1,1
"access_report_transaction_pos","report.transaction.pos","model_report_transaction_pos","group_pos_manager",1,1,1,1
"access_pos_config_journal_manager","pos.config.journal.manager","model_pos_config_journal","group_pos_manager",1,1,1,1
"access_account_journal_pos_manager","account.journal pos_manager","account.model_account_journal","group_pos_manager",1,0,0,0
"access_account_journal_pos_manager","account.journal pos_manager","account.model_account_journal","group_pos_manager",1,1,1,0
"access_account_journal_pos_user","account.journal pos_user","account.model_account_journal","group_pos_user",1,0,0,0
"access_account_move_pos_user","account.move pos_user","account.model_account_move","group_pos_user",1,0,0,0
"access_account_account_pos_user","account.account pos_user","account.model_account_account","group_pos_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_pos_payment pos.payment model_pos_payment group_pos_user 1 1 1 1
8 access_report_transaction_pos report.transaction.pos model_report_transaction_pos group_pos_manager 1 1 1 1
9 access_pos_config_journal_manager pos.config.journal.manager model_pos_config_journal group_pos_manager 1 1 1 1
10 access_account_journal_pos_manager account.journal pos_manager account.model_account_journal group_pos_manager 1 0 1 0 1 0
11 access_account_journal_pos_user account.journal pos_user account.model_account_journal group_pos_user 1 0 0 0
12 access_account_move_pos_user account.move pos_user account.model_account_move group_pos_user 1 0 0 0
13 access_account_account_pos_user account.account pos_user account.model_account_account group_pos_user 1 0 0 0
@@ -6,7 +6,7 @@
<field name="code">VIJ</field>
<field name="type">cash</field>
<field name="view_id" ref="account.account_journal_view"/>
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="sequence_id" ref="account.sequence_journal"/>
<field model="account.account" name="default_credit_account_id" ref="account.a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="account.a_sale"/>
<field name="user_id" ref="base.user_root"/>
@@ -18,7 +18,7 @@
<field name="code">CAJ</field>
<field name="type">cash</field>
<field name="view_id" ref="account.account_journal_view"/>
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="sequence_id" ref="account.sequence_journal"/>
<field model="account.account" name="default_credit_account_id" ref="account.a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="account.a_sale"/>
<field name="user_id" ref="base.user_root"/>
@@ -30,7 +30,7 @@
<field name="code">BACJ</field>
<field name="type">cash</field>
<field name="view_id" ref="account.account_journal_view"/>
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="sequence_id" ref="account.sequence_journal"/>
<field model="account.account" name="default_credit_account_id" ref="account.a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="account.a_sale"/>
<field name="user_id" ref="base.user_root"/>
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
</data>
</openerp>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
</data>
</openerp>
+10 -1
View File
@@ -67,6 +67,15 @@
(data, format) = netsvc.LocalService('report.pos.details').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d') }}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos details report'+format), 'wb+').write(data)
-
I create a cash journal.
-
!record {model: account.journal, id: account_journal_cash0}:
name: 'Cash Journal'
code: 'CSJ'
type: 'cash'
view_id: account.account_journal_bank_view
sequence_id: account.sequence_journal
-
I create a record for Bank Statement.
-
@@ -74,7 +83,7 @@
name: St.05/19
balance_end_real: 0.0
date: '2010-05-19'
journal_id: account.bank_journal
journal_id: account_journal_cash0
period_id: account.period_5
state: 'draft'
-
@@ -36,7 +36,7 @@ def get_journal(self, cr, uid, context):
obj = self.pool.get('account.journal')
statement_obj = self.pool.get('account.bank.statement')
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
cr.execute("SELECT DISTINCT journal_id from pos_journal_users where user_id=%s order by journal_id", (uid,))
j_ids = map(lambda x1: x1[0], cr.fetchall())
ids = obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)])
obj_ids= statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', ids)])
@@ -129,7 +129,7 @@ class pos_box_entries(osv.osv_memory):
if address_u:
partner_id = address_u.partner_id and address_u.partner_id.id or None
args['partner_id'] = partner_id
statement_line_id = bank_statement.create(cr, uid, args)
bank_statement.create(cr, uid, args)
return {}
@@ -35,12 +35,11 @@ class pos_close_statement(osv.osv_memory):
@param context: A standard dictionary
@return : Blank Dictionary
"""
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
list_statement = []
mod_obj = self.pool.get('ir.model.data')
statement_obj = self.pool.get('account.bank.statement')
journal_obj = self.pool.get('account.journal')
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
"WHERE user_id=%s ORDER BY journal_id", (uid,))
j_ids = map(lambda x1: x1[0], cr.fetchall())
journal_ids = journal_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', j_ids)])
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', journal_ids)])
@@ -21,7 +21,6 @@
from osv import osv
from tools.translate import _
import time
class pos_open_statement(osv.osv_memory):
_name = 'pos.open.statement'
@@ -42,7 +41,8 @@ class pos_open_statement(osv.osv_memory):
statement_obj = self.pool.get('account.bank.statement')
sequence_obj = self.pool.get('ir.sequence')
journal_obj = self.pool.get('account.journal')
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
"WHERE user_id=%s ORDER BY journal_id"% (uid,))
j_ids = map(lambda x1: x1[0], cr.fetchall())
journal_ids = journal_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', j_ids)])
@@ -50,32 +50,17 @@ class pos_open_statement(osv.osv_memory):
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
if len(ids):
raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s".\nPlease close its related Register.' %(journal.name)))
statement_ids = sorted(statement_obj.search(cr, uid, [('state', '=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)]))
if statement_ids:
res = []
statement_ids.reverse()
statement = statement_obj.browse(cr, uid, statement_ids[0])
for end_bal in statement.ending_details_ids:
dct = {
'pieces': end_bal.pieces,
'number': end_bal.number,
}
res.append((0, 0, dct))
data['starting_details_ids'] = res
else:
data['starting_details_ids'] = statement_obj._get_cash_close_box_lines(cr, uid, [])
number = ''
if journal.sequence_id:
number = sequence_obj.get_id(cr, uid, journal.sequence_id.id)
else:
number = sequence_obj.get(cr, uid, 'account.bank.statement')
number = sequence_obj.get(cr, uid, 'account.cash.statement')
data.update({'journal_id': journal.id,
'company_id': company_id,
'user_id': uid,
'state': 'open',
'state': 'draft',
'name': number })
statement_id = statement_obj.create(cr, uid, data)
statement_obj.button_open(cr, uid, [statement_id], context)
+3 -2
View File
@@ -42,7 +42,8 @@ class pos_make_payment(osv.osv_memory):
active_id = context and context.get('active_id',False)
if active_id:
j_obj = self.pool.get('account.journal')
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
"WHERE user_id=%d ORDER BY journal_id"% (uid,))
j_ids = map(lambda x1: x1[0], cr.fetchall())
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)])
@@ -78,7 +79,7 @@ class pos_make_payment(osv.osv_memory):
return res
def view_init(self, cr, uid, fields_list, context=None):
res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
active_id = context and context.get('active_id', False) or False
if active_id:
order = self.pool.get('pos.order').browse(cr, uid, active_id)
+33 -27
View File
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
"""
<!-- Select an Open Sale Order -->
<record id="view_pos_payment" model="ir.ui.view">
@@ -12,30 +10,38 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Add payment :">
<group colspan="4" width="600" height="220">
<field name="journal"/>
<field name="amount" />
<field name="payment_date" />
<!--field name="payment_name" /-->
<field name="invoice_wanted" />
<field name="num_sale" />
<field name="is_acc"/>
<group attrs="{'invisible':[('is_acc','=',False)]}" colspan="4" col="2">
<field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]"
on_change="onchange_product_id(product_id, amount)"/>
</group>
<newline/>
<group attrs="{'invisible':[('invoice_wanted','=',False)]}" colspan="4">
<field name="partner_id" attrs="{'required':[('invoice_wanted', '=', True)]}" colspan="2"/>
<field name="pricelist_id" attrs="{'required':[('invoice_wanted', '=', True)]}" colspan="2"/>
</group>
<separator colspan="4"/>
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<button icon='gtk-stop' special="cancel" string="Cancel" />
<button name="check" string="Make Payment" colspan="1" type="object" icon="terp-dolar"/>
</group>
</group>
<group colspan="8" col="8" width="660" height="230">
<group colspan="4" col="4" width="150">
<label align="0.0" string="The register must be opened to be able to execute a payment." colspan="2"/>
<separator string="" orientation="vertical" rowspan="6"/>
</group>
<group colspan="4" col="4">
<field name="journal"/>
<field name="amount"/>
<field name="payment_date"/>
<!--field name="payment_name" /-->
<field name="invoice_wanted"/>
<field name="num_sale"/>
<field name="is_acc"/>
<group attrs="{'invisible':[('is_acc','=',False)]}" colspan="4" col="2">
<field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]" on_change="onchange_product_id(product_id, amount)"/>
</group>
<newline/>
<group attrs="{'invisible':[('invoice_wanted','=',False)]}" colspan="4">
<field name="partner_id" attrs="{'required':[('invoice_wanted', '=', True)]}" colspan="2"/>
<field name="pricelist_id" attrs="{'required':[('invoice_wanted', '=', True)]}" colspan="2"/>
</group>
</group>
<separator colspan="8"/>
<group col="4" colspan="4"/>
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-stop" special="cancel" string="Cancel"/>
<button name="check" string="Make Payment" colspan="1" type="object" icon="terp-dolar"/>
</group>
</group>
</group>
</form>
</field>
</record>
+29 -10
View File
@@ -123,9 +123,9 @@ class pos_return(osv.osv_memory):
<button icon='gtk-cancel' special="cancel"
string="Cancel" />
<button icon='gtk-ok' name= "create_returns"
string="Return goods and Exchange" type="object"/>
string="Return with Echange" type="object"/>
<button icon='gtk-ok' name="create_returns2"
string="Return without Refund" type="object"/>
string="Refund Without Exchange" type="object"/>
</form>"""
result['arch'] = _moves_arch_lst
@@ -162,6 +162,7 @@ class pos_return(osv.osv_memory):
stock_move_obj = self.pool.get('stock.move')
property_obj= self.pool.get("ir.property")
uom_obj =self. pool.get('product.uom')
statementl_obj = self.pool.get('account.bank.statement.line')
wf_service = netsvc.LocalService("workflow")
#Todo :Need to clean the code
if active_id:
@@ -171,7 +172,9 @@ class pos_return(osv.osv_memory):
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
prop_ids = property_obj.search(cr, uid,[('name', '=', 'property_stock_customer')])
val = property_obj.browse(cr, uid, prop_ids[0]).value_reference
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
(order_id.shop_id.warehouse_id.id,))
res = cr.fetchone()
location_id = res and res[0] or None
stock_dest_id = val.id
@@ -185,10 +188,13 @@ class pos_return(osv.osv_memory):
'lines':[],
'statement_ids':[],
'picking_id':[]})
account_def = property_obj.get(cr, uid, 'property_account_payable', 'res.partner', context=context)
amount = 0.0
for line in order_id.lines:
if line.id:
try:
qty = data['return%s' %line.id]
amount += qty * line.price_unit
except :
qty = line.qty
stock_move_obj.create(cr, uid, {
@@ -204,6 +210,15 @@ class pos_return(osv.osv_memory):
'date_planned': date_cur
})
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
statementl_obj.create(cr, uid, {
'name': 'Refund %s'%order_id.name,
'statement_id': order_id.statement_ids[0].statement_id.id,
'pos_statement_id': new_order,
'date': time.strftime('%Y-%m-%d'),
'account_id': order_id.partner_id and order_id.partner_id.property_account_payable \
and order_id.partner_id.property_account_payable.id or account_def.id,
'amount': -amount,
})
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
@@ -254,7 +269,9 @@ class add_product(osv.osv_memory):
qty=data['quantity']
prop_ids = property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')])
val = property_obj.browse(cr, uid, prop_ids[0]).value_reference
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
(order_id.shop_id.warehouse_id.id,))
res=cr.fetchone()
location_id=res and res[0] or None
stock_dest_id = val.id
@@ -316,7 +333,9 @@ class add_product(osv.osv_memory):
for order_id in order_obj.browse(cr, uid, active_ids, context=context):
prop_ids =property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')])
val = property_obj.browse(cr, uid, prop_ids[0]).value_reference
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
" WHERE w.lot_stock_id=s.id AND w.id=%s ",
(order_id.shop_id.warehouse_id.id,))
res=cr.fetchone()
location_id=res and res[0] or None
stock_dest_id = val.id
@@ -331,13 +350,13 @@ class add_product(osv.osv_memory):
'date':date_cur
})
for line in order_id.lines:
key=('return%s') %line.id
key= 'return%s' % line.id
if line.id:
if data.has_key(key):
qty = data['return%s' %line.id]
qty = data[key]
lines_obj.write(cr,uid,[line.id], {
'qty_rfd':(line.qty or 0.0) + data['return%s' %line.id],
'qty':line.qty-(data['return%s' %line.id] or 0.0)
'qty_rfd':(line.qty or 0.0) + data[key],
'qty':line.qty-(data[key] or 0.0)
})
else:
qty = line.qty
@@ -349,7 +368,7 @@ class add_product(osv.osv_memory):
'location_id':location_id,
'product_id':line.product_id.id,
'location_dest_id':stock_dest_id,
'name':'%s (return)' %order_id.name,
'name':'%s (return)' % order_id.name,
'date':date_cur,
'date_planned':date_cur
})
+2 -2
View File
@@ -4,7 +4,7 @@
<menuitem
id="menu_process"
name="Enterprise Processes"
name="Enterprise Process"
parent="base.menu_custom"
groups="base.group_extended"/>
@@ -121,7 +121,7 @@
</record>
<record model="ir.actions.act_window" id="action_process_form">
<field name="name">Process</field>
<field name="name">Processes</field>
<field name="res_model">process.process</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

Some files were not shown because too many files have changed in this diff Show More