~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to delete_button/delete_button.py

  • Committer: jf
  • Date: 2012-11-29 13:00:27 UTC
  • mfrom: (1287.9.8 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20121129130027-564r4yns8t5d2v7d
UTP-368 [FIX] Shouldn't be possible to source a non-stockable product to stock in the order sourcing tool (fix unit test)
lp:~unifield-team/unifield-wm/utp-368

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
            ids = [ids]
177
177
        return self.unlink(cr, uid, ids, context)
178
178
    
179
 
composition_kit()
180
 
 
181
 
class real_average_consumption(osv.osv):
182
 
    _name = 'real.average.consumption'
183
 
    _inherit = 'real.average.consumption'
184
 
 
185
 
    def delete_button(self, cr, uid, ids, context=None):
186
 
        """
187
 
        This method is called on the button of type object in tree view.
188
 
        The aim is to be able to display the delete button only in draft state, which is not possible with the standard delete button.
189
 
        """
190
 
        if isinstance(ids, (int, long)):
191
 
            ids = [ids]
192
 
        return self.unlink(cr, uid, ids, context)
193
 
 
194
 
real_average_consumption()
195
 
 
 
179
composition_kit()
 
 
b'\\ No newline at end of file'