mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] default operation in product and product_categ for customer and supplier
[IMP]Separate menus for customer and supplier operations * Add active field to rma operation * Added tests * Fix travis * Fix create supplier rma from customer rma
This commit is contained in:
committed by
JasminSForgeFlow
parent
5ffc2ab326
commit
d056a3c323
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from openerp import _, api, fields, models
|
||||
from openerp import fields, models
|
||||
|
||||
|
||||
class RmaOperation(models.Model):
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from openerp import _, api, fields, models
|
||||
from openerp.addons import decimal_precision as dp
|
||||
from openerp import api, fields, models
|
||||
|
||||
|
||||
class RmaOrder(models.Model):
|
||||
_inherit = "rma.order"
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
def _compute_sales_count(self):
|
||||
self.ensure_one()
|
||||
sales_list = []
|
||||
for rma_line in self.rma_line_ids:
|
||||
if rma_line.sale_line_id and rma_line.sale_line_id.id:
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from openerp import _, api, fields, models
|
||||
from openerp import api, fields, models
|
||||
from openerp.addons import decimal_precision as dp
|
||||
|
||||
|
||||
class RmaOrderLine(models.Model):
|
||||
_inherit = "rma.order.line"
|
||||
|
||||
@api.model
|
||||
def _default_sale_type(self):
|
||||
return self.sale_type or False
|
||||
|
||||
sale_type = fields.Selection([
|
||||
('no', 'Not required'), ('ordered', 'Based on Ordered Quantities'),
|
||||
('received', 'Based on Received Quantities')],
|
||||
string="Sale Policy", default=_default_sale_type)
|
||||
|
||||
@api.one
|
||||
@api.depends('sale_line_ids', 'sale_type', 'sales_count',
|
||||
'sale_line_ids.state')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from openerp import _, api, fields, models
|
||||
from openerp import api, fields, models
|
||||
from openerp.exceptions import ValidationError
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ class RmaAddSale(models.TransientModel):
|
||||
{'in_route_id': operation.in_route_id.id or route,
|
||||
'out_route_id': operation.out_route_id.id or route,
|
||||
'receipt_policy': operation.receipt_policy,
|
||||
'location_id': operation.location_id.id or
|
||||
self.env.ref('stock.stock_location_stock').id,
|
||||
'location_id': operation.location_id.id or self.env.ref(
|
||||
'stock.stock_location_stock').id,
|
||||
'operation_id': operation.id,
|
||||
'refund_policy': operation.refund_policy,
|
||||
'delivery_policy': operation.delivery_policy
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from openerp import _, api, fields, models
|
||||
from openerp import api, fields, models
|
||||
|
||||
|
||||
class RmaRefund(models.TransientModel):
|
||||
|
||||
Reference in New Issue
Block a user