~georgeyk/stoqlib/ideale-henrique

« back to all changes in this revision

Viewing changes to stoqlib/domain/product.py

  • Committer: georgeyk
  • Date: 2010-03-09 14:25:48 UTC
  • mfrom: (3096.1.57 stoqlib)
  • Revision ID: georgeyk.dev@gmail.com-20100309142548-7whe8gflgb481hs8
Merged master.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        return self.get_components().count() > 0
250
250
 
251
251
    def get_production_cost(self):
252
 
        """ Return the production cost of a Product. The production cost
253
 
        is defined as the sum of the product cost plus the costs of its
254
 
        components.
255
 
 
 
252
        """ Return the production cost of one unit of the Product.
256
253
        @returns: the production cost
257
254
        """
258
 
        value = self.sellable.cost
259
 
        for component in self.get_components():
260
 
            value += (component.component.get_production_cost() *
261
 
                      component.quantity)
262
 
        return value
 
255
        return self.sellable.cost
263
256
 
264
257
    def is_supplied_by(self, supplier):
265
258
        """If this product is supplied by the given supplier, returns the