Browse Source

[S0046] 0046 - Faciliter la réception de marchandises: Add a button to copy all qty in done column at reception

pull/111/head
tfrancoi 8 years ago
committed by Rémy Taymans
parent
commit
6330e28c91
  1. 2
      beesdoo_inventory/__openerp__.py
  2. 10
      beesdoo_inventory/models/stock.py
  3. 4
      beesdoo_inventory/views/stock.xml

2
beesdoo_inventory/__openerp__.py

@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['delivery'],
'depends': ['delivery', 'beesdoo_base'],
# always loaded
'data': [

10
beesdoo_inventory/models/stock.py

@ -8,7 +8,7 @@ class StockPicking(models.Model):
responsible = fields.Many2one('res.partner', string="Responsible")
def _add_follower(self):
if(self.responsible):
if(self.responsible):
types = self.env['mail.message.subtype'].search(['|',('res_model','=','stock.picking'),('name','=','Discussions')])
self.env['mail.followers'].create({'res_model' : 'stock.picking',
'res_id' : self.id,
@ -23,6 +23,14 @@ class StockPicking(models.Model):
@api.model
def create(self, values):
print "Values", values
picking = super(StockPicking, self).create(values)
picking._add_follower()
return picking
@api.multi
def copy_qty(self):
self.ensure_one()
for pack_operation in self.pack_operation_product_ids:
pack_operation.qty_done = pack_operation.product_qty
return True

4
beesdoo_inventory/views/stock.xml

@ -23,6 +23,10 @@
<field name="backorder_id" position="after">
<field name="responsible" />
</field>
<button name="do_new_transfer" position="before">
<button name="copy_qty" string="Copy Pack Quantity" states="partially_available,assigned" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('picking_type_code', '!=', 'incoming')]}"/>
</button>
</field>
</record>
Loading…
Cancel
Save