[MIG][WIP][12.0] agreement_stock

[UPD] README.rst

[UPD] Update agreement_stock.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: contract-12.0/contract-12.0-agreement_stock
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_stock/

[UPD] README.rst

Added translation using Weblate (Chinese (Simplified))

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (17 of 17 strings)

Translation: contract-12.0/contract-12.0-agreement_stock
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_stock/zh_CN/

Added translation using Weblate (Spanish)

Added translation using Weblate (French)

Added translation using Weblate (Italian)

Added translation using Weblate (Portuguese (Brazil))

Translated using Weblate (Portuguese (Brazil))

Currently translated at 76.5% (13 of 17 strings)

Translation: contract-12.0/contract-12.0-agreement_stock
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_stock/pt_BR/
This commit is contained in:
Murtuza Saleh
2019-03-28 17:52:39 +05:30
committed by Patrick Wilson
parent a9e007ae35
commit 13829b491d
14 changed files with 594 additions and 79 deletions

View File

@@ -14,30 +14,18 @@ class Agreement(models.Model):
@api.multi
def _compute_picking_count(self):
data = self.env['stock.picking'].read_group(
[('agreement_id', 'in', self.ids)],
['agreement_id'], ['agreement_id'])
count_data = dict((item['agreement_id'][0],
item['agreement_id_count']) for item in data)
for agreement in self:
agreement.picking_count = count_data.get(agreement.id, 0)
for ag_rec in self:
ag_rec.picking_count = self.env['stock.picking'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
@api.multi
def _compute_move_count(self):
data = self.env['stock.move'].read_group(
[('agreement_id', 'in', self.ids)],
['agreement_id'], ['agreement_id'])
count_data = dict((item['agreement_id'][0],
item['agreement_id_count']) for item in data)
for agreement in self:
agreement.move_count = count_data.get(agreement.id, 0)
for ag_rec in self:
ag_rec.move_count = self.env['stock.move'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
@api.multi
def _compute_lot_count(self):
data = self.env['stock.production.lot'].read_group(
[('agreement_id', 'in', self.ids)],
['agreement_id'], ['agreement_id'])
count_data = dict((item['agreement_id'][0],
item['agreement_id_count']) for item in data)
for agreement in self:
agreement.lot_count = count_data.get(agreement.id, 0)
for ag_rec in self:
ag_rec.lot_count = self.env['stock.production.lot'].search_count(
[('agreement_id', 'in', ag_rec.ids)])