Merge lp:~openerp-dev/openobject-addons/trunk-opw-579812-port-dhr into lp:openobject-addons

Proposed by Dharti Ratani(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-579812-port-dhr
Merge into: lp:openobject-addons
Diff against target: 268 lines (+90/-64)
6 files modified
base_calendar/base_calendar.py (+9/-5)
delivery/delivery_view.xml (+12/-4)
delivery/stock.py (+14/-1)
stock/product.py (+1/-1)
stock/stock.py (+1/-1)
stock/stock_view.xml (+53/-52)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-579812-port-dhr
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+138912@code.launchpad.net

Description of the change

Hello,

This MP contains fix for below issues:

Currently, when the mail is sent by the event reminder scheduler, `Event Date` is set to alarm's trigger date instead of actual event date.

When synchronizing the invitation.ics file with calendar client, the calendar client shows meeting datetime as it received, that is in UTC, meeting datetime should be converted to local timezone.

Kindly review the fix.

Code is forward port from 6.1

Thanks.

To post a comment you must log in.
8267. By Dharti Ratani(OpenERP)

[MERGE]

Unmerged revisions

8267. By Dharti Ratani(OpenERP)

[MERGE]

8266. By Ravi Gohil (OpenERP)

[FIX] base_calendar: Synchronizing the invitation.ics file with calendar client shows meeting time in UTC and setting mail date to actual event's date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_calendar/base_calendar.py'
2--- base_calendar/base_calendar.py 2012-12-15 16:35:56 +0000
3+++ base_calendar/base_calendar.py 2012-12-17 10:24:26 +0000
4@@ -426,11 +426,12 @@
5 @return: .ics file content
6 """
7 res = None
8- def ics_datetime(idate, short=False):
9+ def ics_datetime(idate, short=False, dtfield=False):
10 if idate:
11 if short or len(idate)<=10:
12 return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d')))
13 else:
14+ dtfield.params['TZID'] = ['UTC']
15 return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
16 else:
17 return False
18@@ -443,9 +444,12 @@
19 event = cal.add('vevent')
20 if not event_obj.date_deadline or not event_obj.date:
21 raise osv.except_osv(_('Warning!'),_("First you have to specify the date of the invitation."))
22- event.add('created').value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'))
23- event.add('dtstart').value = ics_datetime(event_obj.date)
24- event.add('dtend').value = ics_datetime(event_obj.date_deadline)
25+ dtfield = event.add('created')
26+ dtfield.value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'), dtfield=dtfield)
27+ dtfield = event.add('dtstart')
28+ dtfield.value = ics_datetime(event_obj.date, dtfield=dtfield)
29+ dtfield = event.add('dtend')
30+ dtfield.value = ics_datetime(event_obj.date_deadline, dtfield=dtfield)
31 event.add('summary').value = event_obj.name
32 if event_obj.description:
33 event.add('description').value = event_obj.description
34@@ -890,7 +894,7 @@
35 ----
36 %s
37 </pre>
38-""" % (alarm.name, alarm.trigger_date, alarm.description, \
39+""" % (alarm.name, alarm.event_date, alarm.description, \
40 alarm.user_id.name, alarm.user_id.signature)
41 mail_to = [alarm.user_id.email]
42 for att in alarm.attendee_ids:
43
44=== modified file 'delivery/delivery_view.xml'
45--- delivery/delivery_view.xml 2012-11-30 17:11:30 +0000
46+++ delivery/delivery_view.xml 2012-12-17 10:24:26 +0000
47@@ -243,8 +243,12 @@
48 <field name="inherit_id" ref="stock.view_picking_form"/>
49 <field name="arch" type="xml">
50 <field name="company_id" position="before">
51- <field name="weight"/>
52- <field name="weight_net" groups="base.group_no_one"/>
53+ <label for="weight" string="Weight"/>
54+ <div>
55+ <field name="weight" class="oe_inline"/>
56+ <field name="weight_uom_id" nolabel="1" class="oe_inline"/>
57+ </div>
58+ <field name="weight_net" groups="base.group_no_one" class="oe_inline"/>
59 </field>
60 </field>
61 </record>
62@@ -279,8 +283,12 @@
63 <field name="inherit_id" ref="stock.view_move_form"/>
64 <field name="arch" type="xml">
65 <xpath expr="//group[@name='main_grp']" position="inside">
66- <field name="weight"/>
67- <field name="weight_net" groups="base.group_no_one"/>
68+ <label for="weight" string="Weight"/>
69+ <div>
70+ <field name="weight" class="oe_inline"/>
71+ <field name="weight_uom_id" nolabel="1" class="oe_inline"/>
72+ </div>
73+ <field name="weight_net" groups="base.group_no_one" class="oe_inline"/>
74 </xpath>
75 </field>
76 </record>
77
78=== modified file 'delivery/stock.py'
79--- delivery/stock.py 2012-11-29 22:26:45 +0000
80+++ delivery/stock.py 2012-12-17 10:24:26 +0000
81@@ -66,6 +66,7 @@
82 }),
83 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
84 'number_of_packages': fields.integer('Number of Packages'),
85+ 'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of measurement for Weight",),
86 }
87
88 def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None):
89@@ -132,6 +133,12 @@
90 invoice_line_obj.create(cr, uid, invoice_line)
91 invoice_obj.button_compute(cr, uid, [invoice.id], context=context)
92 return result
93+ def _get_default_uom(self,cr,uid,c):
94+ uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm')
95+ return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]
96+ _defaults = {
97+ 'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c)
98+ }
99
100 stock_picking()
101
102@@ -169,8 +176,14 @@
103 store={
104 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
105 }),
106+ 'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
107 }
108-
109+ def _get_default_uom(self,cr,uid,c):
110+ uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm')
111+ return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]
112+ _defaults = {
113+ 'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c)
114+ }
115 stock_move()
116
117 # Redefinition of the new fields in order to update the model stock.picking.out in the orm
118
119=== modified file 'stock/product.py'
120--- stock/product.py 2012-11-29 22:26:45 +0000
121+++ stock/product.py 2012-12-17 10:24:26 +0000
122@@ -530,7 +530,7 @@
123 _columns = {
124 'property_stock_journal': fields.property('account.journal',
125 relation='account.journal', type='many2one',
126- string='Stock journal', view_load=True,
127+ string='Stock Journal', view_load=True,
128 help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."),
129 'property_stock_account_input_categ': fields.property('account.account',
130 type='many2one', relation='account.account',
131
132=== modified file 'stock/stock.py'
133--- stock/stock.py 2012-12-15 17:47:43 +0000
134+++ stock/stock.py 2012-12-17 10:24:26 +0000
135@@ -655,7 +655,7 @@
136 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
137 store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
138 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
139- 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
140+ 'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
141 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
142 store=True, type='datetime', string='Max. Expected Date', select=2),
143 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
144
145=== modified file 'stock/stock_view.xml'
146--- stock/stock_view.xml 2012-12-09 10:55:27 +0000
147+++ stock/stock_view.xml 2012-12-17 10:24:26 +0000
148@@ -890,37 +890,37 @@
149 <field name="model">stock.picking.out</field>
150 <field name="inherit_id" ref="view_picking_form"/>
151 <field name="arch" type="xml">
152- <data>
153- <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
154- <button name="%(report_picking_list_out)d" string="Print Delivery Slip" type="action" states="done" class="oe_highlight"/>
155- <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
156- </xpath>
157- <xpath expr="/form/header//button[@name='draft_validate']" position="replace">
158- <button name="draft_validate" states="draft" string="Confirm &amp; Deliver" type="object" class="oe_highlight"/>
159- <button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
160- </xpath>
161- <xpath expr="/form/header//button[@name='action_process']" position="replace">
162- <button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>
163- </xpath>
164- <xpath expr="/form/header//field[@name='state']" position="replace">
165- <field name="state" nolabel="1" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" statusbar_colors='{"auto":"blue", "confirmed":"blue"}'/>
166- </xpath>
167- <xpath expr="//field[@name='partner_id']" position="replace">
168- <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Customer"/>
169- </xpath>
170- <xpath expr="//field[@name='move_lines']" position="replace">
171- <field name="move_lines" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
172- </xpath>
173- <xpath expr="/form/sheet" position="after">
174- <div class="oe_chatter">
175- <field name="message_follower_ids" widget="mail_followers"/>
176- <field name="message_ids" widget="mail_thread"/>
177- </div>
178- </xpath>
179- </data>
180+ <field name="date_done" position="attributes" version="7.0">
181+ <attribute name="string">Date of Delivery</attribute>
182+ </field>
183+ <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
184+ <button name="%(report_picking_list_out)d" string="Print Delivery Slip" type="action" states="done" class="oe_highlight"/>
185+ <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
186+ </xpath>
187+ <xpath expr="/form/header//button[@name='draft_validate']" position="replace">
188+ <button name="draft_validate" states="draft" string="Confirm &amp; Deliver" type="object" class="oe_highlight"/>
189+ <button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
190+ </xpath>
191+ <xpath expr="/form/header//button[@name='action_process']" position="replace">
192+ <button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>
193+ </xpath>
194+ <xpath expr="/form/header//field[@name='state']" position="replace">
195+ <field name="state" nolabel="1" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" statusbar_colors='{"auto":"blue", "confirmed":"blue"}'/>
196+ </xpath>
197+ <xpath expr="//field[@name='partner_id']" position="replace">
198+ <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Customer"/>
199+ </xpath>
200+ <xpath expr="//field[@name='move_lines']" position="replace">
201+ <field name="move_lines" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
202+ </xpath>
203+ <xpath expr="/form/sheet" position="after">
204+ <div class="oe_chatter">
205+ <field name="message_follower_ids" widget="mail_followers"/>
206+ <field name="message_ids" widget="mail_thread"/>
207+ </div>
208+ </xpath>
209 </field>
210 </record>
211-
212 <record id="view_picking_out_search" model="ir.ui.view">
213 <field name="name">stock.picking.out.search</field>
214 <field name="model">stock.picking</field>
215@@ -1021,29 +1021,30 @@
216 <field name="model">stock.picking.in</field>
217 <field name="inherit_id" ref="view_picking_form"/>
218 <field name="arch" type="xml">
219- <data>
220- <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
221- <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
222- </xpath>
223- <xpath expr="//button[@name='draft_validate']" position="replace">
224- <button name="draft_validate" states="draft" string="Confirm &amp; Receive" type="object" class="oe_highlight"/>
225- </xpath>
226- <xpath expr="//button[@name='action_process']" position="replace">
227- <button name="action_process" states="assigned" string="Receive" type="object" class="oe_highlight"/>
228- </xpath>
229- <xpath expr="//field[@name='partner_id']" position="replace">
230- <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Supplier"/>
231- </xpath>
232- <xpath expr="//field[@name='move_lines']" position="replace">
233- <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
234- </xpath>
235- <xpath expr="/form/sheet" position="after">
236- <div class="oe_chatter">
237- <field name="message_follower_ids" widget="mail_followers"/>
238- <field name="message_ids" widget="mail_thread"/>
239- </div>
240- </xpath>
241- </data>
242+ <field name="date_done" position="attributes" version="7.0">
243+ <attribute name="string">Date of Reception</attribute>
244+ </field>
245+ <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
246+ <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
247+ </xpath>
248+ <xpath expr="//button[@name='draft_validate']" position="replace">
249+ <button name="draft_validate" states="draft" string="Confirm &amp; Receive" type="object" class="oe_highlight"/>
250+ </xpath>
251+ <xpath expr="//button[@name='action_process']" position="replace">
252+ <button name="action_process" states="assigned" string="Receive" type="object" class="oe_highlight"/>
253+ </xpath>
254+ <xpath expr="//field[@name='partner_id']" position="replace">
255+ <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Supplier"/>
256+ </xpath>
257+ <xpath expr="//field[@name='move_lines']" position="replace">
258+ <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
259+ </xpath>
260+ <xpath expr="/form/sheet" position="after">
261+ <div class="oe_chatter">
262+ <field name="message_follower_ids" widget="mail_followers"/>
263+ <field name="message_ids" widget="mail_thread"/>
264+ </div>
265+ </xpath>
266 </field>
267 </record>
268 <record id="view_picking_in_search" model="ir.ui.view">

Subscribers

People subscribed via source and target branches

to all changes: