mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
Merge pull request #60 from Eficent/11.0-fix-rma
[11.0] various minor fixes
This commit is contained in:
@@ -620,7 +620,7 @@ class RmaOrderLine(models.Model):
|
||||
result = action.read()[0]
|
||||
# choose the view_mode accordingly
|
||||
if rma_lines and len(rma_lines) != 1:
|
||||
result['domain'] = rma_lines.ids
|
||||
result['domain'] = [('id', 'in', rma_lines)]
|
||||
elif len(rma_lines) == 1:
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = rma_lines[0]
|
||||
|
||||
@@ -176,7 +176,7 @@ class StockWarehouse(models.Model):
|
||||
customer_loc, supplier_loc = self._get_partner_locations()
|
||||
# TODO: company_id?
|
||||
rma_rules['rma_customer_in'] = {
|
||||
'name': self._format_rulename(self, customer_loc, self.lot_rma_id),
|
||||
'name': self._format_rulename(customer_loc, self.lot_rma_id, ''),
|
||||
'action': 'move',
|
||||
'warehouse_id': self.id,
|
||||
'location_src_id': customer_loc.id,
|
||||
@@ -187,7 +187,7 @@ class StockWarehouse(models.Model):
|
||||
'active': True,
|
||||
}
|
||||
rma_rules['rma_customer_out'] = {
|
||||
'name': self._format_rulename(self, self.lot_rma_id, customer_loc),
|
||||
'name': self._format_rulename(self.lot_rma_id, customer_loc, ''),
|
||||
'action': 'move',
|
||||
'warehouse_id': self.id,
|
||||
'location_src_id': self.lot_rma_id.id,
|
||||
@@ -198,7 +198,7 @@ class StockWarehouse(models.Model):
|
||||
'active': True,
|
||||
}
|
||||
rma_rules['rma_supplier_in'] = {
|
||||
'name': self._format_rulename(self, supplier_loc, self.lot_rma_id),
|
||||
'name': self._format_rulename(supplier_loc, self.lot_rma_id, ''),
|
||||
'action': 'move',
|
||||
'warehouse_id': self.id,
|
||||
'location_src_id': supplier_loc.id,
|
||||
@@ -209,7 +209,7 @@ class StockWarehouse(models.Model):
|
||||
'active': True,
|
||||
}
|
||||
rma_rules['rma_supplier_out'] = {
|
||||
'name': self._format_rulename(self, self.lot_rma_id, supplier_loc),
|
||||
'name': self._format_rulename(self.lot_rma_id, supplier_loc, ''),
|
||||
'action': 'move',
|
||||
'warehouse_id': self.id,
|
||||
'location_src_id': self.lot_rma_id.id,
|
||||
|
||||
@@ -154,7 +154,7 @@ class RmaLineMakeSupplierRma(models.TransientModel):
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'rma.order',
|
||||
'view_id': False,
|
||||
'view_id': self.env.ref('rma.view_rma_supplier_form').id,
|
||||
'res_id': rma.id,
|
||||
'context': {'supplier': True, 'customer': False},
|
||||
'type': 'ir.actions.act_window'
|
||||
@@ -165,7 +165,7 @@ class RmaLineMakeSupplierRma(models.TransientModel):
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'rma.order.line',
|
||||
'view_id': False,
|
||||
'view_id': self.env.ref('rma.view_rma_line_supplier_form').id,
|
||||
'res_id': rma_line.id,
|
||||
'context': {'supplier': True, 'customer': False},
|
||||
'type': 'ir.actions.act_window'
|
||||
|
||||
@@ -59,7 +59,8 @@ class RmaOrderLine(models.Model):
|
||||
sale_policy = fields.Selection(selection=[
|
||||
('no', 'Not required'), ('ordered', 'Based on Ordered Quantities'),
|
||||
('received', 'Based on Received Quantities')],
|
||||
string="Sale Policy", default='no', required=True)
|
||||
string="Sale Policy", default='no', required=True,
|
||||
readonly=True, states={'draft': [('readonly', False)]})
|
||||
sales_count = fields.Integer(
|
||||
compute=_compute_sales_count, string='# of Sales')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user