mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] View and sequence management (default value)
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import wizard
|
||||
from . import crm_claim_rma
|
||||
from . import account_invoice
|
||||
|
||||
@@ -247,7 +247,9 @@ class crm_claim(orm.Model):
|
||||
_inherit = 'crm.claim'
|
||||
|
||||
def _get_sequence_number(self, cr, uid, context=None):
|
||||
return obj.pool.get('ir.sequence').get(cr, uid, 'crm.claim')
|
||||
res = self.pool.get('ir.sequence').get(cr, uid,
|
||||
'crm.claim.rma', context=context) or '/'
|
||||
return res
|
||||
|
||||
def _get_default_warehouse(self, cr, uid, context=None):
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid,
|
||||
@@ -260,7 +262,7 @@ class crm_claim(orm.Model):
|
||||
return wh_ids[0]
|
||||
|
||||
_columns = {
|
||||
'number': fields.char('Number', size=128, readonly=True,
|
||||
'number': fields.char('Number', readonly=True,
|
||||
states={'draft': [('readonly', False)]},
|
||||
required=True,
|
||||
help="Company internal claim unique number"),
|
||||
@@ -284,6 +286,7 @@ class crm_claim(orm.Model):
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',
|
||||
required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'number': _get_sequence_number,
|
||||
'claim_type': 'customer',
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
<field name="move_in_id"/>
|
||||
<field name="move_out_id"/>
|
||||
</group>
|
||||
<!-- button name="%(action_get_empty_serial)d" string="Get possible values for empty serial" states="draft,confirmed" type="action" target="new"/ -->
|
||||
<separator string="Problem" colspan="4"/>
|
||||
<field name="claim_origine" nolabel="1" colspan="4"/>
|
||||
<field name="claim_descr" nolabel="1" colspan="4"/>
|
||||
|
||||
Reference in New Issue
Block a user