Saurang Suthar(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-calendar-phase1-states_button_remove-ssu
 into lp:~openerp-dev/openobject-addons/trunk-calendar-phase1.

Requested reviews:
  Jigar Amin  (OpenERP) (jam-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-calendar-phase1-states_button_remove-ssu/+merge/90864

Hello sir,

I have remove the state field and also its related effects from calendar.event.

Thank you.
   SSU
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-calendar-phase1-states_button_remove-ssu/+merge/90864
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-calendar-phase1.
=== modified file 'base_calendar/calendar_event.py'
--- base_calendar/calendar_event.py	2012-01-12 13:30:46 +0000
+++ base_calendar/calendar_event.py	2012-01-31 13:27:25 +0000
@@ -41,33 +41,29 @@
     _columns = {
         'id': fields.integer('ID'),
         'sequence': fields.integer('Sequence'),
-        'name': fields.char('Summary', size=64, required=False, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
-        'date': fields.datetime('Date', states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
-        'date_deadline': fields.datetime('Deadline', states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+        'name': fields.char('Summary', size=64, required=False),
+        'date': fields.datetime('Date'),
+        'date_deadline': fields.datetime('Deadline'),
         'create_date': fields.datetime('Created', readonly=True),
-        'duration': fields.float('Duration', states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]} , help="Meeting duration in hours."),
-        'description': fields.text('Description', states={'done': [('readonly', True)]}),
-        'location': fields.char('Location', size=264, help="Location of Event", states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+        'duration': fields.float('Duration', help="Meeting duration in hours."),
+        'description': fields.text('Description'),
+        'location': fields.char('Location', size=264, help="Location of Event"),
         'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
-             ('confidential', 'Confidential')], 'Mark as', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+             ('confidential', 'Confidential')], 'Mark as'),
         'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
-                                                'Show as', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+                                                'Show as'),
 
-        'calendar_id': fields.many2one('calendar.calendar', 'Calendar', states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+        'calendar_id': fields.many2one('calendar.calendar', 'Calendar'),
         'vtimezone': fields.selection([(x.lower(), x) for x in pytz.all_timezones], size=64, string='Timezone'),
-        'user_id': fields.many2one('res.users', 'Resposible', required=True, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
-        'organizer_id': fields.many2one('res.users', 'Organizer', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
-        'category_id': fields.many2one('calendar.event.category', 'Category', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
-        'allday': fields.boolean('All Day', states={'confirm': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+        'user_id': fields.many2one('res.users', 'Resposible', required=True),
+        'organizer_id': fields.many2one('res.users', 'Organizer'),
+        'category_id': fields.many2one('calendar.event.category', 'Category'),
+        'allday': fields.boolean('All Day'),
         'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the event information without removing it."),
-        'state': fields.selection([('draft', 'Unconfirmed'),
-                        ('confirm', 'Confirmed'),
-                        ('cancel', 'Cancelled'), ('done', 'Done')], 'State', readonly=True),
         'color': fields.integer('Color Index'),
     }
 
     _defaults = {
-            'state': 'draft',
             'show_as': 'busy',
             'active': True,
             'organizer_id': lambda self, cr, uid, ctx: uid,
@@ -127,26 +123,5 @@
             value['duration'] = round(duration, 2)
 
         return {'value': value}
-    
-
-    def set_as_draft(self, cr, uid, ids, context=None, *args):
-        """ Makes event as Tentative
-        """
-        return self.write(cr, uid, ids, {'state': 'draft'}, context)
-
-    def do_cancel(self, cr, uid, ids, context=None, *args):
-        """ Makes event as Cancellled
-        """
-        return self.write(cr, uid, ids, {'state': 'cancel'}, context)
-
-    def do_confirm(self, cr, uid, ids, context=None, *args):
-        """ Makes event as Confirmed
-        """
-        return self.write(cr, uid, ids, {'state': 'confirm'}, context)
-
-    def do_done(self, cr, uid, ids, context=None, *args):
-        """ Makes event as closed
-        """
-        return self.write(cr, uid, ids, {'state': 'done'}, context)
 
 calendar_event()

=== modified file 'base_calendar/calendar_event_view.xml'
--- base_calendar/calendar_event_view.xml	2012-01-31 09:01:05 +0000
+++ base_calendar/calendar_event_view.xml	2012-01-31 13:27:25 +0000
@@ -19,6 +19,7 @@
                         <ul class="oe_kanban_tooltip">
                         </ul>
                     </t>						
+<<<<<<< TREE
                     <t t-name="kanban-box">
                     	<div t-attf-class="#{kanban_color(record.color.raw_value)} #{border || ''}">
                     		<div class="oe_kanban_box oe_kanban_color_border">
@@ -47,6 +48,24 @@
                                         <a name="do_done" string="Done" state="confirm" type="object" icon="kanban-apply"/>
 									</div>	
 									<div class="oe_kanban_clear"/>
+=======
+						<t t-name="kanban-box">
+							<div t-attf-class="#{kanban_color(record.color.raw_value)} #{border || ''}">
+								<div class="oe_kanban_box oe_kanban_color_border">
+									<table>
+									</table>
+									<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
+										<div class="oe_kanban_description">
+										</div>
+									</div>
+									<div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
+										<div class="oe_kanban_left">
+											<a string="Edit" icon="gtk-edit" type="edit"/>
+                                        	<a string="Change Color" icon="color-picker" type="color" name="color"/>
+										</div>
+										<div class="oe_kanban_clear"/>
+									</div>
+>>>>>>> MERGE-SOURCE
 								</div>
 							</div>
 						</div>
@@ -91,7 +110,6 @@
                         <field name="date_deadline" string="End Date" required="1"
                             on_change="onchange_dates(date,False,date_deadline)"/>
                         <field name="location"/>
-                        
                         <field name="category_id" widget="selection" />
                     </group>
                     <notebook colspan="4">
@@ -103,38 +121,14 @@
                              <field name="organizer_id" string="Organizer" />
                              <field name="show_as" string="Show time as" attrs="{'invisible':[('attendee_request_id','!=', False)]}"/>
                              <field name="class" attrs="{'invisible':[('attendee_request_id','!=', False)]}"/>
-                             
                         </group>
                         
                         <separator string="Description" colspan="4" />
                         <field name="description" nolabel="1" colspan="4" attrs="{'readonly':[('attendee_request_id','!=', False)]}"/>
                         <separator colspan="4" string="" />
-                           <group col="8" colspan="4">
-                               <field name="state" select="2" />
-                               <button name="do_done"
-                                   string="_Done"
-                                   states="confirm"
-                                   type="object"
-                                   icon="gtk-apply"/>
-                               <button name="set_as_draft"
-                                   string="Set _As Unconfirmed"
-                                   states="confirm,done"
-                                   type="object"
-                                   icon="gtk-convert" />
-                               <button name="do_cancel"
-                                   string="_Cancel"
-                                   states="confirm"
-                                   type="object"
-                                   icon="gtk-cancel"/>
-                               <button name="do_confirm"
-                                   string="C_onfirm"
-                                   states="draft"
-                                   type="object"
-                                   icon="gtk-apply" />                                                                                               
-                           </group>
                         </page>
                         <page string="Reminders">
-                                <field name="alarm_ids"  nolabel="1"  widget="one2many" mode="tree,form" attrs="{'readonly': ['|', ('state', '=', 'done'), ('state', '=', 'cancel')]}">
+                                <field name="alarm_ids"  nolabel="1"  widget="one2many" mode="tree,form">
                                 <tree string="Reminder details" editable="top">
                                     <field name="interval_type" />
                                     <field name="interval_number"/>
@@ -154,7 +148,7 @@
                                 </form>
                         </field>
                         </page>
-                        <page string="Attendees"  attrs="{'readonly': ['|', ('state', '=', 'done'), ('state', '=', 'cancel')]}">
+                        <page string="Attendees">
                             <field name="notification"/>
                             <button
                                 name="%(action_calendar_event_add_attendee_wizard)d"
@@ -164,7 +158,7 @@
                              />
                             <separator string="Attendee List" colspan="4" />
                             <field name="attendee_ids" colspan="4" 
-                                nolabel="1"  widget="one2many" mode="tree,form" attrs="{'readonly': [('state', '=', 'done')]}">
+                                nolabel="1"  widget="one2many" mode="tree,form">
                                 <tree string="Attendees details" editable="top">
                                     <field name="email" />
                                     <field name="total_members"/>
@@ -189,7 +183,6 @@
                                 </form>
                             </field>
                         </page>
-                    
                     </notebook>
                 </form>
             </field>
@@ -210,27 +203,6 @@
                     <field name="organizer_id"/>
                     <field name="user_id" invisible="1"/>
                     <field name="category_id" invisible="1"/>
-                    <field name="state" select="1" />
-                        <button name="do_done"
-                            string="_Done"
-                            states="confirm"
-                            type="object"
-                            icon="gtk-apply"/>
-                        <button name="set_as_draft"
-                            string="Set _As Unconfirmed"
-                            states="confirm,done"
-                            type="object"
-                            icon="gtk-convert" />
-                        <button name="do_cancel"
-                            string="_Cancel"
-                            states="confirm"
-                            type="object"
-                            icon="gtk-cancel"/>
-                        <button name="do_confirm"
-                            string="C_onfirm"
-                            states="draft"
-                            type="object"
-                            icon="gtk-apply" />
                 </tree>
             </field>
         </record>
@@ -249,9 +221,6 @@
             </field>
         </record>
 
-
-
-
         <!--     Event Search View-->
 
         <record id="view_calendar_event_filter" model="ir.ui.view">
@@ -262,13 +231,13 @@
                 <search string="Search Events">
                        <group col="12" colspan="4">
                            <filter icon="terp-check" string="Unconfirmed"
-                               domain="[('state','=','draft')]"
+                               domain="[]"
                                help="Unconfirmed Events" />
                            <filter icon="terp-check" string="Upcoming"
-                               domain="[('state','=','confirm')]"
+                               domain="[]"
                                help="Upcoming Events" />
                            <filter icon="terp-check" string="Done"
-                               domain="[('state','=','done')]"
+                               domain="[]"
                                help="Confirmed Events" />
                            <separator orientation="vertical"/>
                            <field name="user_id" groups="base.group_extended">
@@ -291,11 +260,8 @@
                             <filter string="Organizer" icon="terp-personal"
                                 context="{'group_by':'organizer_id'}" />
                             <separator orientation="vertical" />
-                            <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]"
-                                context="{'group_by':'state'}" />
                             <filter string="Category" icon="terp-stock_symbol-selection"
                                 context="{'group_by':'category_id'}" />
-
                         </group>
                 </search>
             </field>
@@ -336,10 +302,12 @@
                 <field name="res_model">calendar.event</field>
                 <field name="view_type">form</field>
                 <field name="view_mode">calendar,tree,kanban,form</field>
+<<<<<<< TREE
                 <field name="context">{'search_default_user_id':1}</field>
+=======
+>>>>>>> MERGE-SOURCE
         </record>
 
-
         <record id="action_view_event_category" model="ir.actions.act_window">
                 <field name="name">Category </field>
                 <field name="type">ir.actions.act_window</field>
@@ -347,6 +315,7 @@
                 <field name="view_type">form</field>
                 <field name="view_mode">tree,form</field>
         </record>
+        
         <!-- Event menu  -->
 
         <menuitem name="Meetings" id="menu_calendar_event"

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to