mirror of
https://github.com/bringout/oca-financial.git
synced 2026-04-23 06:42:01 +02:00
Initial commit: OCA Financial packages (186 packages)
This commit is contained in:
commit
3e0e8473fb
8757 changed files with 947473 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
# Copyright 2023 Quartile Limited
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountAnalyticApplicability(models.Model):
|
||||
_inherit = "account.analytic.applicability"
|
||||
|
||||
business_domain = fields.Selection(
|
||||
selection_add=[("stock_move", "Stock Move")],
|
||||
ondelete={"stock_move": "cascade"},
|
||||
)
|
||||
stock_picking_type_id = fields.Many2one(
|
||||
"stock.picking.type",
|
||||
string="Operation Type",
|
||||
)
|
||||
|
||||
def _get_score(self, **kwargs):
|
||||
score = super()._get_score(**kwargs)
|
||||
if score >= 0 and self.stock_picking_type_id:
|
||||
if kwargs.get("picking_type") == self.stock_picking_type_id.id:
|
||||
score += 1
|
||||
else:
|
||||
return -1
|
||||
return score
|
||||
Loading…
Add table
Add a link
Reference in a new issue